Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed a possible crash in free-threaded builds when interpreter creation fails
due to memory allocation failure.
3 changes: 3 additions & 0 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,9 @@ new_threadstate(PyInterpreterState *interp, int whence)
if (tstate == NULL) {
return NULL;
}
// Set the back-pointer before init_threadstate() so early cleanup can
// recognize the preallocated initial thread state after allocation failures.
tstate->base.interp = interp;
Comment thread
zainnadeem786 marked this conversation as resolved.

#ifdef Py_GIL_DISABLED
Py_ssize_t qsbr_idx = _Py_qsbr_reserve(interp);
Expand Down
Loading