-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
The following code paths should probably returns some sort of exception status (possibly _PyStatus_NO_MEMORY()).
Lines 2084 to 2088 in a1551b4
| PyInterpreterState *interp = PyInterpreterState_New(); | |
| if (interp == NULL) { | |
| *tstate_p = NULL; | |
| return _PyStatus_OK(); | |
| } |
Lines 2090 to 2096 in a1551b4
| PyThreadState *tstate = _PyThreadState_New(interp, | |
| _PyThreadState_WHENCE_INTERP); | |
| if (tstate == NULL) { | |
| PyInterpreterState_Delete(interp); | |
| *tstate_p = NULL; | |
| return _PyStatus_OK(); | |
| } |
Note that PyInterpreterState_New() currently never returns NULL -- it calls Py_FatalError() instead -- but we should probably still handle that case as well.
_PyThreadState_New can return NULL when out of memory.
Linked PRs
- gh-112729: Correctly fail when the process is out of memory during interpreter creation #139164
- [3.14] gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164) #139168
- [3.13] gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164) #139169
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done