cpython icon indicating copy to clipboard operation
cpython copied to clipboard

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

Open miss-islington opened this issue 1 year ago • 3 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

@nascheme I thought the backport wouldn't apply cleanly, but here we are. Do you recall what was different about the 3.12 fix?

ericsnowcurrently avatar Oct 09 '24 18:10 ericsnowcurrently

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

@ericsnowcurrently, is this the way you'd do it in 3.12?

encukou avatar Nov 13 '24 16:11 encukou

:robot: New build scheduled with the buildbot fleet by @encukou for commit e9591b2f3d5ab4c75d4ca4f6d14a01db3767889c :robot:

If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again.

bedevere-bot avatar Dec 02 '24 16:12 bedevere-bot

The failed buildbots aren't applicable to 3.12, or fail for unrelated & pre-existing reasons.

encukou avatar Dec 03 '24 12:12 encukou

@ericsnowcurrently, is this the way you'd do it in 3.12?

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.

ericsnowcurrently avatar Dec 03 '24 17:12 ericsnowcurrently