Message292315
> 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() |
|
Date |
User |
Action |
Args |
2017-04-26 08:02:55 | vstinner | set | recipients:
+ vstinner, gregory.p.smith |
2017-04-26 08:02:55 | vstinner | set | messageid: <1493193775.56.0.270167837935.issue30165@psf.upfronthosting.co.za> |
2017-04-26 08:02:55 | vstinner | link | issue30165 messages |
2017-04-26 08:02:55 | vstinner | create | |
|