Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-128639: Don't assume one thread in subinterpreter finalization #128640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add another assertion.
  • Loading branch information
ZeroIntensity committed Feb 5, 2025
commit f19e28d631baf23f5d93aa1678746e3b486c2d6c
3 changes: 3 additions & 0 deletions 3 Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1994,6 +1994,7 @@ resolve_final_tstate(_PyRuntimeState *runtime)
}
else {
/* Fall back to the current tstate. It's better than nothing. */
// XXX No it's not
main_tstate = tstate;
}
}
Expand All @@ -2018,6 +2019,8 @@ _Py_Finalize(_PyRuntimeState *runtime)

/* Get final thread state pointer. */
PyThreadState *tstate = resolve_final_tstate(runtime);
// We must be in the main interpreter
assert(tstate->interp == &runtime->_main_interpreter);
ZeroIntensity marked this conversation as resolved.
Show resolved Hide resolved

// Block some operations.
tstate->interp->finalizing = 1;
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.