]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-125205)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 3 Dec 2024 17:26:25 +0000 (18:26 +0100)
committerGitHub <noreply@github.com>
Tue, 3 Dec 2024 17:26:25 +0000 (10:26 -0700)
commit49da170709dd47c49bfc1e5d4b5d46122a049a3b
treeffe9d0289f8a1098ec779d9c97371ab0e38771bd
parentb49e902b81a0ead84e2002f94a2a2b2ae9b09ada
[3.12] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-125205)

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 (i.e. backporting gh-125709 too).

(cherry picked from commit f2cb39947093feda3ff85b8dc820922cc5e5f954, AKA gh-124865)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Doc/library/sys.rst
Doc/using/configure.rst
Doc/whatsnew/3.12.rst
Include/internal/pycore_object_state.h
Include/internal/pycore_runtime_init.h
Misc/NEWS.d/next/Core_and_Builtins/2024-09-26-18-21-06.gh-issue-116510.FacUWO.rst [new file with mode: 0644]
Objects/object.c
Objects/unicodeobject.c
Python/pylifecycle.c
Python/pystate.c