Closed
Description
Bug report
The autoTssKey
is deleted during _PyRuntimeState_Fini
by gilstate_tss_fini
. This isn't safe because other threads may try calling PyGILState_Ensure()
or PyGILState_GetThisThreadState()
concurrently during shutdown.
Lines 486 to 501 in e9d210b
We can:
- Convert
autoTssKey
to a_Py_thread_local
like_Py_tss_tstate
, which doesn't require deletion - Don't delete
autoTssKey
at runtime finalization
My preference is for the first option.
cc @ZeroIntensity @ericsnowcurrently @gpshead