-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
[3.12] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865) #125205
[3.12] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865) #125205
Conversation
…ythongh-124865) Fix a crash caused by immortal interned strings being shared between sub-interpreters that use basic single-phase init. In that case, the string can be used by an interpreter that outlives the interpreter that created and interned it. For interpreters that share obmalloc state, also share the interned dict with the main interpreter. This is an un-revert of pythongh-124646 that then addresses the Py_TRACE_REFS failures identified by pythongh-124785. (cherry picked from commit f2cb399) Co-authored-by: Eric Snow <[email protected]>
@nascheme I thought the backport wouldn't apply cleanly, but here we are. Do you recall what was different about the 3.12 fix? |
Please don't merge until the TraceRefs regression is fixed: #124865 (comment) |
I think this can be merged now with GH-125709 applied on top or squashed into it. |
…ers (pythongh-125709) They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds.
@ericsnowcurrently, is this the way you'd do it in 3.12? |
The failed buildbots aren't applicable to 3.12, or fail for unrelated & pre-existing reasons. |
This should be good to go. It is backport of gh-124865 + gh-125709. There shouldn't be anything particular to 3.12 that would need to be addressed differently. |
Fix a crash caused by immortal interned strings being shared between
sub-interpreters that use basic single-phase init. In that case, the string
can be used by an interpreter that outlives the interpreter that created and
interned it. For interpreters that share obmalloc state, also share the
interned dict with the main interpreter.
This is an un-revert of gh-124646 that then addresses the Py_TRACE_REFS
failures identified by gh-124785.
(cherry picked from commit f2cb399)
Co-authored-by: Eric Snow [email protected]