This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients gregory.p.smith, vstinner
Date 2017-05-09.21:33:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1494365616.09.0.154394246988.issue30165@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-05-09 21:33:36gregory.p.smithsetrecipients: + gregory.p.smith, vstinner
2017-05-09 21:33:36gregory.p.smithsetmessageid: <1494365616.09.0.154394246988.issue30165@psf.upfronthosting.co.za>
2017-05-09 21:33:36gregory.p.smithlinkissue30165 messages
2017-05-09 21:33:36gregory.p.smithcreate