Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 2020 12:01:55 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [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
Message-ID:  <bug-251112-227-f9nEoO4CEB@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-251112-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-251112-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D251112

--- Comment #8 from Konstantin Belousov <kib@FreeBSD.org> ---
(In reply to Andrew Stitcher from comment #7)
Stubs do nothing in different ways.  They never load libpthread.  Mostly th=
ey
do nothing and return success, like pthread_mutex_lock() stub.  Some very
specific stubs return failure since callers are prepared for it, like
pthread_once() or pthread_key_create().

Basically, stubs allow to compile a library with knowledge of threads, but =
only
utilize synchronization and other thread-related services if process actual=
ly
loaded libpthread.

If we add pthread_attr_get_np() stub to libc, most likely it would do nothi=
ng.
It should fit with you description of asan runtime not calling
pthread_attr_get_np() if no threads were spawned.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-251112-227-f9nEoO4CEB>