Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.12] gh-116510: Fix crash during sub-interpreter shutdown #124536

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

nascheme
Copy link
Member

@nascheme nascheme commented Sep 25, 2024

Fix a bug that can cause a crash when sub-interpreters use "basic" single-phase extension modules. Shared objects could refer to PyGC_Head nodes that had been freed as part of interpreter shutdown.

Fix a bug that can cause a crash when sub-interpreters use "basic"
single-phase extension modules.  Shared objects could refer to PyGC_Head
nodes that had been freed as part of interpreter shutdown.
@nascheme
Copy link
Member Author

My fix for this issue is more minimal compared to what was done in gh-30577 (and accidentally reverted in gh-94673). The original fix untracks all GC objects and increfs them. I think that's more than required. We just need to make sure none of them refer to the GC head nodes that we are going to free. At least, I think that's enough and it fixes the weechat crash. Need to check the Kodi crash too.

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

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

LGTM

@nascheme nascheme removed the request for review from pablogsal September 27, 2024 00:49
@nascheme nascheme merged commit 69fd1f2 into python:3.12 Sep 27, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants