New GitHub issue #101437 from ericsnowcurrently:<br>

<hr>

<pre>
`_PyInterpreterState_DeleteExceptMain()` first sets the "current" thread state to NULL (while still holding the GIL) but then calls `PyInterpreterState_Clear()` on any other interpreter, even though it depends on there being a "current" thread set.  I would expect this to cause crashes when a process with multiple interpreters if forked, since `PyOS_AfterFork_Child()` calls `_PyInterpreterState_DeleteExceptMain()`. This might explain some intermittent CI failures (e.g. with `test__xxsubinterpreters` or `test_multiprocessing_*`)

See https://github.com/python/cpython/blob/main/Python/pystate.c#L930-L932.
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/101437">View on GitHub</a>
<p>Labels: type-bug, interpreter-core, expert-subinterpreters, 3.12</p>
<p>Assignee: </p>