-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-123657: Fix crash and refleak in decimal.getcontext()
#123703
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
Conversation
@ZeroIntensity Could you verify this fix? |
I can take a look in an hour or so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that this fixes the assertion failure, as well as the memory leak:
./python -Xshowrefcount -c "import decimal; decimal.getcontext()"
[0 refs, 0 blocks]
@encukou, this needs the 3.13 backport label. |
This makes
Since |
…honGH-123703) (cherry picked from commit 853588e) Co-authored-by: neonene <[email protected]>
GH-123774 is a backport of this pull request to the 3.13 branch. |
Thanks! |
Thanks for this nice fix. It does fix this leak. Before:
After (with this fix):
cc @picnixz |
…-123703) (GH-123774) (cherry picked from commit 853588e) Co-authored-by: neonene <[email protected]>
decimal.getcontext
crashes with--with-decimal-contextvar=no
and-X showrefcount
#123657