You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.
but is called from the signal handler. this tries to acquire a lock via PyGILState_GetThisThreadState() which ultimately calls into Python's thread.c which uses PyThread_acquire_lock(_Py_thread_keymutex) and later calls malloc() (which also uses locks).
This can lead to deadlocks when crashing instead of a stacktrace.
The text was updated successfully, but these errors were encountered:
On CPython 2.7, PyGILState_GetThisThreadState() uses a lock and so is not signal safe. To prevent the risk of race condition, there are two options:
Always dump all threads and loose the "Current thread" information
Use PyThreadState_Get() which means that "Current thread" is the thread holding the GIL which can be different than the thread which caused the fault (got the signal).
https://github.com/haypo/faulthandler/blob/master/faulthandler.c#L254
but is called from the signal handler. this tries to acquire a lock via
PyGILState_GetThisThreadState()
which ultimately calls into Python's thread.c which usesPyThread_acquire_lock(_Py_thread_keymutex)
and later callsmalloc()
(which also uses locks).This can lead to deadlocks when crashing instead of a stacktrace.
The text was updated successfully, but these errors were encountered: