diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-11-12 12:45:12 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-12 12:45:12 (GMT) |
| commit | 02cd3ce0f201df98939c65bcba8445bb0b70717b (patch) | |
| tree | b9c41e26f84bc71aa464253d010ebdfaf27ac87a /Python/pystate.c | |
| parent | 4f1440fd89c58c46094422423972496b5d870316 (diff) | |
| download | cpython-02cd3ce0f201df98939c65bcba8445bb0b70717b.zip cpython-02cd3ce0f201df98939c65bcba8445bb0b70717b.tar.gz cpython-02cd3ce0f201df98939c65bcba8445bb0b70717b.tar.bz2 | |
[3.13] gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (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 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 <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>
Diffstat (limited to 'Python/pystate.c')
| -rw-r--r-- | Python/pystate.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 66fd392..ad3fdce 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -632,10 +632,8 @@ init_interpreter(PyInterpreterState *interp, assert(next != NULL || (interp == runtime->interpreters.main)); interp->next = next; - PyStatus status = _PyObject_InitState(interp); - if (_PyStatus_EXCEPTION(status)) { - return status; - } + // We would call _PyObject_InitState() at this point + // if interp->feature_flags were alredy set. _PyEval_InitState(interp); _PyGC_InitState(&interp->gc); |
