Multiple missing PyErr_NoMemory calls and NULL dereferences in _interpretersmodule.c under OOM conditions during interpreter creation.
import _testcapi, _interpreters
for n in range(1, 80):
_testcapi.set_nomemory(n, 0)
try:
interp = _interpreters.create()
_testcapi.remove_mem_hooks()
_interpreters.destroy(interp)
break
except MemoryError:
_testcapi.remove_mem_hooks()
except:
_testcapi.remove_mem_hooks()
# SIGSEGV: NULL dereference