[PATCH] Async signal safe TLS accesses
Joseph S. Myers
joseph@codesourcery.com
Thu Jan 9 16:42:00 GMT 2014
On Thu, 9 Jan 2014, Paul Pluzhnikov wrote:
> What about the race I posited as possible explanation? Do you agree that there
> is a race? Does sleep(1) before dlclose() "fix" it?
I agree there is a race, and the sleep does fix it (of course it also
makes the test very slow).
Maybe have the signal handler outside the loaded module call the function
from the loaded module, but with sem_post in the function outside the
module? I haven't tested whether this fixes the powerpc problem, but it
should avoid the identified race with the module being dlclosed while code
from it is executing. (There would of course then be the need to have
memory barriers to ensure the current pointer obtained from dlsym is
available from the thread calling the signal handler - and it would be
necessary to ensure that the test does still show up the non-signal-safety
if run with older glibc.)
> Also, is the crash you are seeing intermittent (how frequent?) or reliable?
The crash is reliable.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list