Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-116510: Fix a Crash Due to Shared Immortal Interned Strings#124865

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

Merged

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrentlyericsnowcurrently commentedOct 1, 2024
edited by bedevere-appbot
Loading

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 ofgh-124646 that addresses thePy_TRACE_REFS failures identified bygh-124785.

The 3.12 backport will be slightly different and will need to be done manually.

@ericsnowcurrently
Copy link
MemberAuthor

!buildbot AMD64 Arch Linux TraceRefs

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@ericsnowcurrently for commit623fb87 🤖

The command will test the builders whose names match following regular expression:AMD64 Arch Linux TraceRefs

The builders matched are:

  • AMD64 Arch Linux TraceRefs PR

@@ -2491,6 +2491,24 @@ _Py_ResurrectReference(PyObject *op)


#ifdef Py_TRACE_REFS
void
_Py_NormalizeImmortalReference(PyObject *op)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Having some comment here would be helpful. Otherwise this function looks quite mysterious.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

done!

nascheme and gpshead reacted with thumbs up emoji
@nascheme
Copy link
Member

LGTM other than adding a bit more comments.

@ericsnowcurrently
Copy link
MemberAuthor

The buildbot passed.

@nascheme
Copy link
Member

Any reason not to merge this now?

@ericsnowcurrently
Copy link
MemberAuthor

I can merge it first thing tomorrow if no one objects.

@ericsnowcurrentlyericsnowcurrently merged commitf2cb399 intopython:mainOct 9, 2024
37 checks passed
@miss-islington-app
Copy link

Thanks@ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@ericsnowcurrentlyericsnowcurrently deleted the fix-tracerefs branchOctober 9, 2024 17:32
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 9, 2024
…ythongh-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 ofpythongh-124646 that then addresses the Py_TRACE_REFSfailures identified bypythongh-124785.(cherry picked from commitf2cb399)Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 9, 2024
…ythongh-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 ofpythongh-124646 that then addresses the Py_TRACE_REFSfailures identified bypythongh-124785.(cherry picked from commitf2cb399)Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
@bedevere-app
Copy link

GH-125204 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelOct 9, 2024
@bedevere-app
Copy link

GH-125205 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelOct 9, 2024
@encukou
Copy link
Member

Due to either this change or#125199, theAMD64 Arch Linux TraceRefs 3.x buildbot is failing:https://buildbot.python.org/#/builders/484/builds/6022/steps/6/logs/stdio

ericsnowcurrently reacted with thumbs up emoji

@vstinner
Copy link
Member

Due to either this change or#124865, the AMD64 Arch Linux TraceRefs 3.x buildbot is failing:https://buildbot.python.org/#/builders/484/builds/6022/steps/6/logs/stdio

I checked with git bisect and the regression was introduced by commitf2cb399:

commit f2cb39947093feda3ff85b8dc820922cc5e5f954Author: Eric Snow <ericsnowcurrently@gmail.com>Date:   Wed Oct 9 11:32:16 2024 -0600    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.
encukou reacted with thumbs up emoji

@ericsnowcurrently
Copy link
MemberAuthor

I'll take a look.

encukou pushed a commit that referenced this pull requestNov 12, 2024
…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>
ericsnowcurrently added a commit that referenced this pull requestDec 3, 2024
…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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@naschemenaschemenascheme left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@ericsnowcurrently@bedevere-bot@nascheme@encukou@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp