-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
gh-124785: re-work fix so tracerefs test passes #124808
gh-124785: re-work fix so tracerefs test passes #124808
Conversation
return (interp != main_interp && | ||
!(interp->feature_flags & Py_RTFLAGS_MULTI_INTERP_EXTENSIONS)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, (not Py_RTFLAGS_MULTI_INTERP_EXTENSIONS
) does not imply Py_RTFLAGS_USE_MAIN_OBMALLOC
. Why not stick with Py_RTFLAGS_USE_MAIN_OBMALLOC
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking at reload_singlephase_extension
and when we can end up in the PyDict_Update
case. I think it can only happen if Py_RTFLAGS_MULTI_INTERP_EXTENSIONS
is set. If we do that dict update then we are sharing objects between interpreters.
Spelling fix. Co-authored-by: Eric Snow <[email protected]>
For the backport to 3.12 and 3.13 we could make That's assuming we think this change is appropriate as a backported fix. Another option would be GH-124796, simpler code but it leaks the immortal strings whereas this PR frees them (eventually). |
The previous fix to this bug caused some trace-refs tests to fail. Object references from the sub-interpreters were not being correctly accounted in the main interpreter. Re-work the fix so that the interned strings for sub-interpreters go into their own dict,
interned_strings_legacy
. That allows the main interpreter to clean them knowing that those specific strings have been allocated in sub-interpreters.