musl/ldso
Rich Felker 8e43b5613e synchronize shared library dtor exec against concurrent loads/ctors
previously, going way back, there was simply no synchronization here.
a call to exit concurrent with ctor execution from dlopen could cause
a dtor to execute concurrently with its corresponding ctor, or could
cause dtors for newly-constructed libraries to be skipped.

introduce a shutting_down state that blocks further ctor execution,
producing the quiescence the dtor execution loop needs to ensure any
kind of consistency, and that blocks further calls to dlopen so that a
call into dlopen from a dtor cannot deadlock.

better approaches to some of this may be possible, but the changes
here at least make things safe.
2019-03-03 12:06:44 -05:00
..
dlstart.c define and use internal macros for hidden visibility, weak refs 2018-09-05 14:05:14 -04:00
dynlink.c synchronize shared library dtor exec against concurrent loads/ctors 2019-03-03 12:06:44 -05:00