Uh oh!
There was an error while loading. Please reload this page.
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.
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.
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.
Uh oh!
There was an error while loading. Please reload this page.
Spelling fix. Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
nascheme
commented
Oct 1, 2024
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). |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.