cpython icon indicating copy to clipboard operation
cpython copied to clipboard

[3.13] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865)

Open miss-islington opened this issue 1 year ago • 2 comments

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

Co-authored-by: Eric Snow [email protected]

  • Issue: gh-116510

miss-islington avatar Oct 09 '24 17:10 miss-islington

Please don't merge until the TraceRefs regression is fixed: https://github.com/python/cpython/pull/124865#issuecomment-2404820325

vstinner avatar Oct 10 '24 11:10 vstinner

I think this can be merged now with GH-125709 applied on top or squashed into it.

nascheme avatar Oct 23 '24 17:10 nascheme

Thanks @miss-islington for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. 🐍🍒⛏🤖

miss-islington-app[bot] avatar Nov 13 '24 13:11 miss-islington-app[bot]

Sorry, @miss-islington and @encukou, I could not cleanly backport this to 3.12 due to a conflict. Please backport using cherry_picker on command line.

cherry_picker 02cd3ce0f201df98939c65bcba8445bb0b70717b 3.12

miss-islington-app[bot] avatar Nov 13 '24 13:11 miss-islington-app[bot]