Crash report
remove_unused_constsinPython/flowgraph.c
When PyMem_Malloc(nconsts * sizeof(Py_ssize_t)); fails, we need to set an exception.
| static int | |
| remove_unused_consts(basicblock *entryblock, PyObject *consts) | |
| { | |
| assert(PyList_CheckExact(consts)); | |
| Py_ssize_t nconsts = PyList_GET_SIZE(consts); | |
| if (nconsts == 0) { | |
| return SUCCESS; /* nothing to do */ | |
| } | |
| Py_ssize_t *index_map = NULL; | |
| Py_ssize_t *reverse_index_map = NULL; | |
| int err = ERROR; | |
| index_map = PyMem_Malloc(nconsts * sizeof(Py_ssize_t)); | |
| if (index_map == NULL) { | |
| goto end; | |
| } |
gethandlelistandgetattributelistin_winapi.c
This place misses it:
| ret = PyMem_Malloc(*size); | |
| if (ret == NULL) | |
| goto cleanup; |
All other error paths set exceptions, except this if:
| attribute_list->attribute_list = PyMem_Malloc(attribute_list_size); | |
| if (attribute_list->attribute_list == NULL) { | |
| ret = -1; | |
| goto cleanup; | |
| } |
_channelends_newinModules/_interpchannelsmodule.c
| static _channelends * | |
| _channelends_new(void) | |
| { | |
| _channelends *ends = GLOBAL_MALLOC(_channelends); | |
| if (ends== NULL) { | |
| return NULL; | |
| } |
Later we check for errors in handle_channel_error, it requires either setting err to non -1 or to set Python exception. Both are false, it fails with the assertion failure.
Linked PRs
- gh-151126: Fix missing
PyErr_NoMemory()inremove_unused_consts#151127 - [3.15] gh-151126: Fix missing
PyErr_NoMemory()inremove_unused_consts(GH-151127) #151134 - [3.14] gh-151126: Fix missing
PyErr_NoMemory()inremove_unused_consts(GH-151127) #151135 - [3.13] gh-151126: Fix missing
PyErr_NoMemory()inremove_unused_consts(GH-151127) #151136 - gh-151126: Add
PyErr_NoMemory()instrong_cache_node_new#151137 - gh-151126: Add missing
PyErr_NoMemoryin_winapimodule #151154 - [3.15] gh-151126: Add missing
PyErr_NoMemoryin_winapimodule (GH-151154) #151180 - [3.14] gh-151126: Add missing
PyErr_NoMemoryin_winapimodule (GH-151154) #151181 - [3.13] gh-151126: Add missing
PyErr_NoMemoryin_winapimodule (GH-151154) #151182 - gh-151126: Fix missing memory errors in
_interpchannelsmodule.c#151239 - [3.15] gh-151126: Fix missing memory errors in
_interpchannelsmodule.c(GH-151239) #151265 - [3.13] gh-151126: Fix missing memory errors in
_interpchannelsmodule.c(GH-151239) #151266 - [3.14] gh-151126: Fix missing memory errors in
_interpchannelsmodule.c(GH-151239) #151336 - [3.13] gh-151126: Fix missing memory errors in
_interpchannelsmodule.c(GH-151239) #151338 - gh-151126: Fix missing memory error in
os._path_splitroot#151339 - [3.15] gh-151126: Fix missing memory error in
os._path_splitroot(GH-151339) #151360 - [3.14] gh-151126: Fix missing memory error in
os._path_splitroot(GH-151339) #151361 - [3.13] gh-151126: Fix missing memory error in
os._path_splitroot(GH-151339) #151362 - gh-151126: Fix crash on unset memory error in
ctypes.get_errno#151382 - [3.15] gh-151126: Fix crash on unset memory error in
ctypes.get_errno(GH-151382) #151398 - [3.14] gh-151126: Fix crash on unset memory error in
ctypes.get_errno(GH-151382) #151399 - [3.13] gh-151126: Fix crash on unset memory error in
ctypes.get_errno(GH-151382) #151400 - gh-151126: Fix missing
PyErr_NoMemoryinfileutils.c#151580 - gh-151126: Fix missing
PyErr_NoMemoryintypeobject.c#151582 - gh-151126: Add missing
PyErr_NoMemoryin_winapi.c#151588 - gh-151126: Fix missing
PyErr_NoMemoryingetpath.c#151590 - gh-151126:Fix missing memory errors in _interpretersmodule.c #151624
- gh-151126: Fix missing memory errors in _interpqueuesmodule.c #151639
- [3.13] gh-151126: Add missing
PyErr_NoMemory()intype_from_slots_or_spec(GH-151582) #152014 - [3.14] gh-151126: Add missing
PyErr_NoMemory()intype_from_slots_or_spec(GH-151582) #152015 - [3.15] gh-151126: Add missing
PyErr_NoMemory()intype_from_slots_or_spec(GH-151582) #152016 - [3.15] gh-151126: Fix missing memory errors in
_interpretersmodule.c(GH-151624) #152169 - [3.14] gh-151126: Fix missing memory errors in
_interpretersmodule.c(GH-151624) #152170 - gh-151126: Fix missing
PyErr_NoMemoryintestinternalcapi.c#152177 - [3.15] gh-151126: Fix missing
PyErr_NoMemoryintestinternalcapi.c(GH-152177) #152179 - [3.14] gh-151126: Fix missing
PyErr_NoMemoryintestinternalcapi.c(GH-152177) #152180 - [3.13] gh-151126: Fix missing
PyErr_NoMemoryintestinternalcapi.c(GH-152177) #152181 - [3.15] gh-151126: Add missing
PyErr_NoMemoryin_winapi.c(GH-151588) #152182 - [3.14] gh-151126: Add missing
PyErr_NoMemoryin_winapi.c(GH-151588) #152183 - [3.13] gh-151126: Add missing
PyErr_NoMemoryin_winapi.c(GH-151588) #152184 - gh-151126: Sets missing exceptions in
tkinterandsocketmodules initializations #152418 - [3.15] gh-151126: Sets missing exceptions in
tkinterandsocketmodules initializations (GH-152418) #152420 - [3.14] gh-151126: Sets missing exceptions in
tkinterandsocketmodules initializations (GH-152418) #152421 - [3.13] gh-151126: Sets missing exceptions in
tkinterandsocketmodules initializations (GH-152418) #152422 - gh-151126: Fix a possible crash during the startup with no memory under
Py_STACKREF_DEBUG#152478 - [3.15] gh-151126: Fix a possible crash during the startup with no memory under
Py_STACKREF_DEBUG(GH-152478) #152677 - [3.14] gh-151126: Fix a possible crash during the startup with no memory under
Py_STACKREF_DEBUG(GH-152478) #152678 - gh-151126: Fix
PyErr_NoMemoryerrors in_ctypes.c#152720 - gh-151126: Set MemoryError in test C API allocation failures #153215
- [3.13] gh-151126: Fix
PyErr_NoMemoryerrors in_ctypes.c(GH-152720) #153708 - [3.14] gh-151126: Fix
PyErr_NoMemoryerrors in_ctypes.c(GH-152720) #153709 - [3.15] gh-151126: Fix
PyErr_NoMemoryerrors in_ctypes.c(GH-152720) #153710 - [3.13] gh-151126: Fix missing memory errors in
_interpretersmodule.c#153765