Skip to content

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 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);

// Block some operations.
tstate->interp->finalizing = 1;
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy