This is the mail archive of the
mailing list for the glibc project.
Re: Dummy pthread functions in libc considered harmful
- From: Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 24 Aug 2015 17:38:16 +0200
- Subject: Re: Dummy pthread functions in libc considered harmful
- Authentication-results: sourceware.org; auth=none
- References: <mvmr3ms4sbj dot fsf at hawking dot suse dot de>
Andreas Schwab, le Mon 24 Aug 2015 17:30:40 +0200, a écrit :
> BZ #18853 shows how the use of the dummy pthread functions in libc can
> be harmful if dlopen brings in libpthread by dependency.
I have to admit I've always wondered about this case, and never took
the time to report the issue, partly because I guessed people wouldn't
dlopen() while "owning" a mutex. This can be fixed by making the mutex
stubs really modify the mutex, possibly optimized into just not using
lock prefixes etc.
Not having proper stubs in libc makes applications write their own stubs
(see libpthread-stubs in freedesktop for instance), which will suffer
from the same issue.