Gregory P. Smith added the comment:

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.

----------
assignee: gregory.p.smith -> haypo
versions: +Python 2.7 -Python 3.6, Python 3.7

_______________________________________
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