[Bug 251112] Compiling C++ with asan fails by default because libclang_rt.asan-x86_64.so uses symbol pthread_attr_get_np but doesn't link to libpthread.so

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Nov 19 08:03:30 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251112

--- Comment #6 from Konstantin Belousov <kib at FreeBSD.org> ---
(In reply to Andrew Stitcher from comment #5)
Depending on whether libpthread linked into the process or not (as well it
might be not linked but loaded later), libc changes its algorithms.  For
instance, stdio FILEs are locked if libpthread is present, and not locked
otherwise.  Similarly, rtld uses real (but custom) rw locks to protect it
internal state if libpthread is there, otherwise it just masks signals using
cheap sigfastblock(2) backdoor.

This is why I asked whether it acceptable to change the C runtime behavior
by sneaky linking with libpthread if ASAN is used.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list