[Bug libstdc++/96817] __cxa_guard_acquire unsafe against dynamically loaded pthread

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 27 13:15:28 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96817

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It will work when Glibc defines all the pthread functions in libc.so and
libpthread.so becomes empty. There's not really any way to make it work until
then that wouldn't pessimize programs that are entirely single-threaded.

You can use LD_PRELOAD=libpthread.so to "fix" the program by ensuring the
pthread symbols are present early, before any __cxa_guard_acquire calls happen.


More information about the Gcc-bugs mailing list