[issue23886] faulthandler_user should use _PyThreadState_Current

STINNER Victor report at bugs.python.org
Wed Mar 23 05:23:14 EDT 2016


STINNER Victor added the comment:

faulthandler was enhanced in Python 3.6:

* Issue #26563: faulthandler now works in non-Python threads.
* Issue #26154: Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which gets the current thread state, but don't call Py_FatalError() if it is NULL.

Can you please try Python 3.6 (default branch of Mercurial) with your use case to check if the issue is solved? And also Python 3.5 (3.5 branch of Mercurial)?

I can try to backport some enhancements from Python 3.6 to Python 3.5 if needed.

If it's ok for you, I will then port changes to the GitHub project.

Note: I also add new unit tests.

> SIGUSR1/2 will get delivered to any running thread. The current thread of the signal doesn't give any useful information. Try to get the current Python thread which holds the GIL instead, or use NULL.

I don't understand your usecase, since faulthandler displays *all* Python threads by default.

all_threads=True in faulthandler.register(signum, file=sys.stderr, all_threads=True, chain=False):
https://docs.python.org/dev/library/faulthandler.html#faulthandler.register

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23886>
_______________________________________


More information about the Python-bugs-list mailing list