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 vstinner
Recipients gregory.p.smith, vstinner
Date 2017-04-26.08:02:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493193775.56.0.270167837935.issue30165@psf.upfronthosting.co.za>
In-reply-to
Content
> I _believe_ we always want to use _PyThreadState_UncheckedGet()

faulthandler_dump_traceback() uses PyGILState_GetThisThreadState(). There is a comment to explain why:

    /* SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL are synchronous signals and
       are thus delivered to the thread that caused the fault. Get the Python
       thread state of the current thread.

       PyThreadState_Get() doesn't give the state of the thread that caused the
       fault if the thread released the GIL, and so this function cannot be
       used. Read the thread local storage (TLS) instead: call
       PyGILState_GetThisThreadState(). */

See also test_faulthandler tests, especially tests releasing the GIL:

* test_gil_released()
* test_fatal_error_without_gil()
History
Date User Action Args
2017-04-26 08:02:55vstinnersetrecipients: + vstinner, gregory.p.smith
2017-04-26 08:02:55vstinnersetmessageid: <1493193775.56.0.270167837935.issue30165@psf.upfronthosting.co.za>
2017-04-26 08:02:55vstinnerlinkissue30165 messages
2017-04-26 08:02:55vstinnercreate