#1650 QuadratureRules sometimes cause runtime error on Ubuntu 14.04
Metadata
Property | Value |
---|---|
Reported by | Steffen Müthing (steffen.muething@iwr.uni-heidelberg.de) |
Reported at | May 12, 2015 13:10 |
Type | Bug Report |
Version | Git (pre2.4) [cmake] |
Operating System | Linux |
Last edited by | Carsten Gräser (graeser@math.fu-berlin.de) |
Last edited at | Jun 12, 2015 22:56 |
Closed by | Carsten Gräser (graeser@math.fu-berlin.de) |
Closed at | Jun 12, 2015 22:56 |
Closed in version | 2.4 |
Resolution | Fixed |
Comment | Fixed in master. |
Fix was cherry-picked to releases/2.4. |
Description
When using the QuadratureRules from dune-geometry without using any other feature that requires a symbol from libdunegeometry, the resulting program aborts on Ubuntu 14.04 with an error message because the call_once assertion has detected a system exception. After some fun investigation by Dominic and me, it turns out that the -Wl,-as-needed "feature" of Ubuntu (as described by Ansgar in https://dune-project.org/flyspray/index.php?do=details&task_id=1611#comment6249) causes this problem. I think it comes up because the guard variable introduced by the call_once() call in the assertion inside libdunecommon is private to that library, and because of that, the linker doesn't find a dependency of the program on libpthread if there are no other places requiring libpthread and doesn't link the executable against pthread even though -pthread was specified on the command line.
This is really ugly, because users will be totally lost. And as Ubuntu 14.04 is not exactly an exotic distribution, this will bite some users.
I suggest brute-forcing this and checking whether we are on Ubuntu and in that case dropping -Wl,-no-as-needed into the compiler flags.
Are there any better ideas?