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-04-27.03:50:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493265043.5.0.372378242753.issue30165@psf.upfronthosting.co.za>
In-reply-to
Content
So... it looks like this could and does happen only on the 2.7 backport of faulthandler.  2.7 is missing the following commit to use pthreads native TLS instead of our lock filled non-async signal safe implementation:
 https://github.com/python/cpython/commit/2fea9b961d6ea1041ace66037513fcad1fc2173d

Which is easy to backport to 2.7 for anyone who maintains their own patched interpreter.  

For the faulthandler backport package on PyPI perspective I'm not sure what if anything you want to do about it or if you want to track that here or on the faulthandler github issue tracker.  It is not safe to call PyGILState_GetThisThreadState() on POSIX systems in a 2.7 extension module without the above patch to the interpreter.

No idea how many people run into this in practice, or if they do, have actually noticed what is going on.  Because the process is already crashing when it deadlocks so if they do, they are likely to just wind up killing it anyways at some point.

We happened to run into it in an integration test framework due to a crash introduced by an unrelated change that caused a single digit percentage of test runs to timeout instead of pass or fail as they had in the past.
History
Date User Action Args
2017-04-27 03:50:43gregory.p.smithsetrecipients: + gregory.p.smith, vstinner
2017-04-27 03:50:43gregory.p.smithsetmessageid: <1493265043.5.0.372378242753.issue30165@psf.upfronthosting.co.za>
2017-04-27 03:50:43gregory.p.smithlinkissue30165 messages
2017-04-27 03:50:42gregory.p.smithcreate