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

Open
wants to merge 1 commit into
base: 3.12
Choose a base branch
from

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.

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 awaiting core review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant