[SRU] openblas: -Wl,-Bsymbolic-functions should be stripped from LDFLAGS

Bug #1860601 reported by Graham Inggs
58
This bug affects 10 people
Affects Status Importance Assigned to Milestone
hypre (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Invalid
Undecided
Unassigned
openblas (Debian)
Fix Released
Unknown
openblas (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Graham Inggs

Bug Description

[Impact]
Users of GNU R and GNU Octave in Ubuntu 20.04 found that certain operations hang, never returning results.

[Test Case]
apt install r-base-core
Rscript -e "example(solve)"
apt install libopenblas-dev
Rscript -e "example(solve)"

Executing Rscript the first time should return results almost instantly.
Installing libopenblas-dev ensures that libopenblas0-pthread is installed.
If the bug is present, running Rscript the second time will hang.

Another test case, using Octave, can be found in #1870138

[Regression Potential]
This fix is already present in lapack for some time, see Debian bug #722252
In case of regression, users should be able to switch to alternate blas variants.
.
It may be possible that in fixing libopenblas0-pthread, libopenblas0-openmp and libopenblas0-serial might break in a similar way.
We should watch out for test timeouts or incorrect results.
Hopefully the autopkgtests will catch any of that.

--------------------------------------------------------------------------

openblas >= 0.3.7+ds-3 causes an autopkgtest regression in hypre on armhf on Ubuntu infrastructure.

There was a major restructuring of the openblas packaging in Debian version 0.3.7+ds-2 uploaded to experimental.

http://autopkgtest.ubuntu.com/packages/h/hypre/focal/armhf

Running tests
running TEST_ams ... autopkgtest [17:08:06]: ERROR: timed out on command

I have tried to reproduce this error on a Debian porterbox (armhf chroot on arm64 kernel) and on a Raspberry Pi 3 (armhf focal-proposed chroot on focal arm64 kernel). The autopkgtests using binaries from the archive are successful, and rebuilding the packages locally is fine too.

While investigating, I found the same tests are run while building the hypre package.
I uploaded the hypre package to my PPA with the following change:

--- a/debian/control
+++ b/debian/control
@@ -10,8 +10,8 @@
  debhelper-compat (= 12),
  pkg-config,
  gfortran,
- libblas-dev | libopenblas-dev | libatlas-base-dev | libblas.so,
- liblapack-dev | libopenblas-dev | libatlas-base-dev | liblapack.so,
+ libopenblas-dev | libblas-dev | libatlas-base-dev | libblas.so,
+ libopenblas-dev | liblapack-dev | libatlas-base-dev | liblapack.so,
  libsuperlu-dev, libsuperlu-dist-dev,
  libltdl-dev,
  libtool,

i.e. building the package with libopenblas-dev instead of libblas-dev and liblapack-dev.

https://launchpad.net/~ginggs/+archive/ubuntu/testing/+sourcepub/10932575/+listing-archive-extra

The builds across all architectures seemed to fail in the same way as the autopkgtests on armhf.
TEST_ams would start, and eventually the build would time out.

see e.g. the build log for amd64:

https://launchpad.net/~ginggs/+archive/ubuntu/testing/+build/18567417/+files/buildlog_ubuntu-focal-amd64.hypre_2.18.2-1~ppa2_BUILDING.txt.gz

Again, I was unable to reproduce this error locally on amd64 or armhf.

This regression prevents openblas, yade, eckit, sdpa, openmolcas and bolt-lmm from migrating from -proposed.

Graham Inggs (ginggs)
tags: added: update-excuse
summary: - openblas: cause autopkgtest failure in hypre armhf
+ openblas: causes autopkgtest failure in hypre armhf
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Re: openblas: causes autopkgtest failure in hypre armhf

I would like someone to investigate this further: if this is a real issue and how users can be affected. Since this looks like a regression in openblas. I built the same package that Graham prepared on a PPA with only Updates enabled and it built fine - so it's proof that the openblas in -proposed does something really fishy.

On one hand it feels like something we might hint, but first I'd like to know if this is something we only see on builders/Ubuntu-ADT and why that is happening. Julian is investigating this further.

Revision history for this message
Julian Andres Klode (juliank) wrote :

I have reproduced the issue on the infrastructure. This seems to be related to pthread support in openblas, as if I swap it out for openblas' openmp variant, it works.

Now there have been no changes in openblas aside from restructuring the packaging, so the real cause must surely lie elsewhere - maybe it picked up a newer pthread symbol version from libc, or an inline function from liblapack?

It does not hang - it seems to be stuck in an infinite loops - all 4 processes run at 400% CPU usage, and seem busy locking and unlocking a mutex.

I also rebuilt openblas on the autopkgtest host (w/o proposed) and tested with that, but the failure is the same.

I don't think it's worthwhile exploring this further - users can switch to the openmp variant of openblas if they encounter issues in the pthread one, and who uses this on armhf anyway?

tags: added: id-5e29cc4b6b85874329c04089
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Ok, in lieu of Julian's and Graham's investigations, I will be hinting this failure - but let's maybe forward this upstream (possibly to openblas, maybe hypre to let them know it's broken).

Revision history for this message
Graham Inggs (ginggs) wrote :

Confirming that rebuilding openblas 0.3.8+ds-1 in Focal with

    export DEB_LDFLAGS_MAINT_STRIP="-Wl,-Bsymbolic-functions"

makes hypre autopkgtest pass on armhf.

Graham Inggs (ginggs)
summary: - openblas: causes autopkgtest failure in hypre armhf
+ openblas: -Wl,-Bsymbolic-functions should be stripped from LDFLAGS
Changed in hypre (Ubuntu):
status: New → Invalid
Changed in hypre (Ubuntu Focal):
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: openblas: -Wl,-Bsymbolic-functions should be stripped from LDFLAGS

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openblas (Ubuntu Focal):
status: New → Confirmed
Changed in openblas (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openblas - 0.3.9+ds-1ubuntu1

---------------
openblas (0.3.9+ds-1ubuntu1) groovy; urgency=medium

  * Strip -Wl,-Bsymbolic-functions from LDFLAGS (LP: #1860601)
    also see #961725 and #722252

 -- Graham Inggs <email address hidden> Sun, 31 May 2020 06:00:25 +0000

Changed in openblas (Ubuntu):
status: Confirmed → Fix Released
Graham Inggs (ginggs)
description: updated
summary: - openblas: -Wl,-Bsymbolic-functions should be stripped from LDFLAGS
+ [SRU] openblas: -Wl,-Bsymbolic-functions should be stripped from LDFLAGS
Graham Inggs (ginggs)
Changed in openblas (Ubuntu Focal):
status: Confirmed → In Progress
assignee: nobody → Graham Inggs (ginggs)
Changed in openblas (Debian):
status: Unknown → Fix Committed
Revision history for this message
Robie Basak (racb) wrote :

Thank you for working on this. Accepting into Focal, but please could you update "Regression Potential" with a discussion of how regressions are most likely to manifest, or may manifest even if it is unlikely, as a result of this change? See https://wiki.ubuntu.com/StableReleaseUpdates#Procedure - this is useful for making sure that appropriate testing is performed during SRU verification.

Changed in openblas (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Graham, or anyone else affected,

Accepted openblas into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/openblas/0.3.8+ds-1ubuntu0.20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (openblas/0.3.8+ds-1ubuntu0.20.04.1)

All autopkgtests for the newly accepted openblas (0.3.8+ds-1ubuntu0.20.04.1) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

gemma/0.98.1+dfsg-1 (arm64)
r-bioc-deseq2/unknown (armhf)
python-ltfatpy/unknown (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#openblas

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Graham Inggs (ginggs)
description: updated
Revision history for this message
Graham Inggs (ginggs) wrote :

The autopkgtests listed below all passed when retried.

gemma/0.98.1+dfsg-1 (arm64)
r-bioc-deseq2/unknown (armhf)
python-ltfatpy/unknown (armhf)

Revision history for this message
Dirk Eddelbuettel (edd) wrote :

Installed in two stages (first OpenMP, then Pthread) verifying that

   Rscript -e 'example(solve)' # known example to 'hang' under openblas-pthread

now works again. Thanks for the fix!

edd@rob:~$ dpkg -l | grep openblas | cut -c -70
ii libopenblas-dev:amd64 0.3.8+ds-1ubuntu0.20.04
ii libopenblas-openmp-dev:amd64 0.3.8+ds-1ubuntu0.20.04
ii libopenblas-pthread-dev:amd64 0.3.8+ds-1ubuntu0.20.04
ii libopenblas0:amd64 0.3.8+ds-1ubuntu0.20.04
ii libopenblas0-openmp:amd64 0.3.8+ds-1ubuntu0.20.04
ii libopenblas0-pthread:amd64 0.3.8+ds-1ubuntu0.20.04
edd@rob:~$

Graham Inggs (ginggs)
tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Dirk! Thank you for the verification. At first I was worried about the version numbers you have posted in your verification comment, as the -proposed version is 0.3.8+ds-1ubuntu0.20.04.1 instead of 0.3.8+ds-1ubuntu0.20.04 (as per your dpkg -l snippet). But then I noticed that you have used `cut -c -70`, and in this case it indeed cuts the last ".1" from the output.

Phew! So, with this in mind, I accept the verification. But next time please make sure that the full version number is recorded!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openblas - 0.3.8+ds-1ubuntu0.20.04.1

---------------
openblas (0.3.8+ds-1ubuntu0.20.04.1) focal; urgency=medium

  * Strip -Wl,-Bsymbolic-functions from LDFLAGS (LP: #1860601)
    also see #961725 and #722252

 -- Graham Inggs <email address hidden> Tue, 02 Jun 2020 10:55:55 +0000

Changed in openblas (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for openblas has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in openblas (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.