Make sure libpulse never gets unloaded
authorLennart Poettering <lennart@poettering.net>
Sat, 1 Nov 2008 20:11:48 +0000 (21:11 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 1 Nov 2008 20:11:48 +0000 (21:11 +0100)
commit84cd23303550cdc3aa605add9f8a2faa3fc1c3e1
tree49bf7dace71ace1c5c856fab01b5a2e666b44993
parent58b53bbc1adb62f2a55e1654f97f90df7518f7fd
Make sure libpulse never gets unloaded

When an .so is unloaded during runtime all TLS keys it has registered
need to be freed because the destructor callbacks of the TLS key might
otherwise point to invalid code. Hence it would appear sensible to
destruct the TLS keys from a function marked as __attribute__
((destructor)). However functions marked like that are also called when
an application terminates, on exit(). If a thread continues to run until
the very exit it might still want to access that TLS data. The
destructor functions are called while all other threads are still
running. If __attribute ((destructor)) is used to destruct TLS keys for
such threads this might hence cause a crash when the application shuts
down.

To circumvent this problem we'll now compile libpulse with -z nodelete,
to make it unnecessary to delete the TLS data ever and thus avoiding the
problem. It's suboptimal, but for now I see no better solution.
src/Makefile.am