PyGILStateEnsure() (Probably) Crashes If Called After Finalization · Issue #124619 · python/cpython (original) (raw)

Bug report

Bug description:

I'm pretty sure PyGILState_Ensure() will crash if called after finalization, particularly in the case where the thread doesn't already have a thread state active. I noticed this while looking at the function for something else.

CC @gpshead

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response