Gregory P. Smith added the comment:

Follow up note:

Note that even with POSIX TLS in use, it isn't entirely safe.  
pthread_getspecific() as used by the posix thread code is not required to be 
async signal safe by the POSIX standard.  :(

The Linux glibc implementation thankfully does not use locks.  But it does 
suffer from a consistency issue in its current implementation when used 
asynchronously.  A trivial patch to fix glibc's pthread_getspecific() with a 
test exists - https://sourceware.org/ml/libc-alpha/2014-12/msg00583.html - but 
upstream glibc maintainers are obstinate as usual.

Regardless, I believe the worst that happens in that relatively uncommon race 
condition situation is a faulthandler crash reporting odd information or 
crashes while crashing.  not a deadlock.

I have not investigated other pthread_getspecific implementations.

The systems I care most about today thankfully run a modified glibc.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to