Original gist: https://gist.githubusercontent.com/devdanzin/55ed5cf0d452eb6ce881e7a8fad30ddb/raw/aec57efe5d45a6995757b60970173d5dca92f188/ceval_stackref_oom.md
ceval.c: Missing PyErr_NoMemory in _PyObjectArray_FromStackRefArray + PyEval_GetLocals NULL deref Summary _PyObjectArray_FromStackRefArray (line 1112): PyMem_Malloc returns NULL without exception. Affects ~10 vectorcall functions → SystemError. PyEval_GetLocals (line 2622): _PyFrame_GetFrameObject can return NULL, immediately dereferenced → segfault. Fix Add PyErr_NoMemory() after PyMem_Malloc failure. Add NULL check after _PyFrame_GetFrameObject.
_PyObjectArray_FromStackRefArray
PyMem_Malloc
PyEval_GetLocals
_PyFrame_GetFrameObject
PyErr_NoMemory()
But the second _PyFrame_GetFrameObject issue is already resolved by #146124
CPython main branch
No response
MemoryError
gh-153205: Set `MemoryError` in stackref array conversion (#153206)
[3.14] gh-153205: Set `MemoryError` in stackref array conversion (GH-…
[3.15] gh-153205: Set `MemoryError` in stackref array conversion (GH-…
Activity
gh-153205: Set `MemoryError` in stackref array conversion (#153206)
[3.14] gh-153205: Set `MemoryError` in stackref array conversion (GH-…
[3.15] gh-153205: Set `MemoryError` in stackref array conversion (GH-…