Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-125286: Share the Main Refchain With Legacy Interpreters#125709
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-125286: Share the Main Refchain With Legacy Interpreters#125709
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nascheme commentedOct 18, 2024
Rather than open-code the Py_RTFLAGS_USE_MAIN_OBMALLOC flag test in multiple places, I think a helper function is better, something like: I was working on a similar patch but my approach was to copy the REFCHAIN pointer, e.g. Is |
ericsnowcurrently commentedOct 18, 2024
+1 I'll do that.
I'm unclear on how that's different from what I've done.
I left it for the sake of the sanity check. Given the lingering pain in this area, especially related to immortal objects, I figured it might not hurt to preserve such checks.
Thanks! Sorry if we ended up duplicating effort. I should have checked with you first. |
nascheme commentedOct 18, 2024
I think it's a bit less code and would be a bit faster, since you can just use
Hmm, I think it's a bit confusing to leave it since it really shouldn't be doing anything useful. Or, is there a reason we think it might do something? The second part of the function shouldn't do anything. If
Your code runs without crashing, which is a plus. ;-) I'm glad you made a PR. |
nascheme commentedOct 18, 2024
Oh, I missed this part of your code change: That explains why you're unclear how my code is different. But if you do this in the init, I don't think the check for |
ericsnowcurrently commentedOct 21, 2024
Good point. I'll remove the superfluous calls. |
ericsnowcurrently commentedOct 21, 2024
Also, you're right about |
This reverts commitffe2633.
ericsnowcurrently commentedOct 21, 2024
I realized the problem with dropping all the extra
At step (3) we rely on the feature flags being set, but we don't set them until step (5). Fixing this is a bit messy and may be too much to backport, so I'd like to merge this fix with the various |
This reverts commit3421a19.
ericsnowcurrently commentedOct 22, 2024
It wasn't as bad as I thought, so I believe I've got things in a good place here. |
ericsnowcurrently commentedOct 22, 2024
!buildbot AMD64 Arch Linux TraceRefs |
bedevere-bot commentedOct 22, 2024
🤖 New build scheduled with the buildbot fleet by@ericsnowcurrently for commit7ab086c 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
encukou commentedOct 22, 2024
I think this change should have a What's New entry, which in turn needs documentation for |
ericsnowcurrently commentedOct 22, 2024
I'm fine with that. |
ericsnowcurrently commentedOct 22, 2024
!buildbot AMD64 Arch Linux TraceRefs |
bedevere-bot commentedOct 22, 2024
🤖 New build scheduled with the buildbot fleet by@ericsnowcurrently for commit1360d86 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
encukou commentedOct 23, 2024
One more doc fix in a place where I couldn't add a GitHub suggestion. I hope you don't mind me pushing this directly to the PR. The |
encukou left a comment
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.
This looks great! Thank you@nascheme &@ericsnowcurrently!
ericsnowcurrently commentedOct 23, 2024
@nascheme, this should be backported to 3.13 (and 3.12), right? |
nascheme commentedOct 23, 2024
…ers (pythongh-125709)They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds.
…gh-124865) (gh-125709) (GH-125204)*gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865)Fix a crash caused by immortal interned strings being shared betweensub-interpreters that use basic single-phase init. In that case, the stringcan be used by an interpreter that outlives the interpreter that created andinterned it. For interpreters that share obmalloc state, also share theinterned dict with the main interpreter.This is an un-revert ofgh-124646 that then addresses the Py_TRACE_REFSfailures identified bygh-124785.(cherry picked from commitf2cb399)Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>* [3.13]gh-125286: Share the Main Refchain With Legacy Interpreters (gh-125709)They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds.---------Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
…ers (pythongh-125709)They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds.
…gh-125205)Fix a crash caused by immortal interned strings being shared betweensub-interpreters that use basic single-phase init. In that case, the stringcan be used by an interpreter that outlives the interpreter that created andinterned it. For interpreters that share obmalloc state, also share theinterned dict with the main interpreter.This is an un-revert ofgh-124646 that then addresses the Py_TRACE_REFSfailures identified bygh-124785 (i.e. backportinggh-125709 too).(cherry picked from commitf2cb399, AKAgh-124865)Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
…thongh-125709)They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds.Co-authored-by: Petr Viktorin <encukou@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
They used to be shared, before 3.12. Returning to sharing them resolves a failure on
Py_TRACE_REFSbuilds.