freebsd-src/lib/libthr
Mark Johnston 36f0a34ca6 libthr: Force the thr_wake() symbol to be resolved during initialization
Otherwise the lock upgrade performed by rtld's load_filtees() can result
in infinite recursion, wherein:
1. _rtld_bind() acquires the bind read lock,
2. the source DSO's filtees haven't been loaded yet, so the lock upgrade
   in load_filtees() cause rtld to jump to _rtld_bind() and release the
   bind lock,
3. _thr_rtld_lock_release() calls _thr_ast(), which calls thr_wake(),
   which hasn't been resolved yet,
4. _rtld_bind() acquires the bind read lock in order to resolve
   thr_wake(),
5. ...

See the linked pull request for an instance of this problem arising with
libsys.  That particular instance is also worked around by commit
e7951d0b04.

Reported by:	brooks
Reviewed by:	kib
Pull Request:	https://github.com/freebsd/freebsd-src/pull/908
MFC after:	1 week
Sponsored by:	Innovate UK
2024-02-02 10:32:30 -05:00
..
arch Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
sys Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tests lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
thread libthr: Force the thr_wake() symbol to be resolved during initialization 2024-02-02 10:32:30 -05:00
libthr.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
plockstat.d Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
pthread.map Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00