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

gh-124538: Fix crash when using gc.get_referents on an untracked capsule object #124559

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

ZeroIntensity
Copy link
Member

@ZeroIntensity ZeroIntensity commented Sep 25, 2024

@Yhg1s Yhg1s added the needs backport to 3.13 bugs and security fixes label Sep 25, 2024
Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

cc @vstinner who implemented this in #108417.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1048,6 +1048,24 @@ class Z:
callback.assert_not_called()
gc.enable()

@cpython_only
def test_get_referents_on_capsule(self):
# See GH-124538
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind to elaborate?

Lib/test/test_gc.py Outdated Show resolved Hide resolved
Co-authored-by: Victor Stinner <[email protected]>
@vstinner vstinner merged commit f923605 into python:main Sep 26, 2024
37 checks passed
@miss-islington-app
Copy link

Thanks @ZeroIntensity for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 26, 2024
…ked capsule object (pythonGH-124559)

(cherry picked from commit f923605)

Co-authored-by: Peter Bierma <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 26, 2024

GH-124588 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Sep 26, 2024
@vstinner
Copy link
Member

Merged, thanks.

Yhg1s pushed a commit that referenced this pull request Sep 26, 2024
…cked capsule object (GH-124559) (#124588)

gh-124538: Fix crash when using `gc.get_referents` on an untracked capsule object (GH-124559)
(cherry picked from commit f923605)

Co-authored-by: Peter Bierma <[email protected]>
@ZeroIntensity ZeroIntensity deleted the fix-capsule-traverse branch October 24, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants