bpo-36027: Fix a potential refcount bug in long_pow#26690
Merged
mdickinson merged 1 commit intopython:mainfrom Jun 13, 2021
Merged
bpo-36027: Fix a potential refcount bug in long_pow#26690mdickinson merged 1 commit intopython:mainfrom
mdickinson merged 1 commit intopython:mainfrom
Conversation
Member
Author
|
3.8 is in security-fix-only mode; adjusting the backport labels. |
Member
|
Yes, this showed up for me because I introduced a new path that, for exponent 1 and no modulus, invoked REDUCE but not MULT. Without a modulus, REDUCE didn't overwrite |
Contributor
|
Thanks @mdickinson for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9. |
Contributor
|
Sorry @mdickinson, I had trouble checking out the |
|
GH-26702 is a backport of this pull request to the 3.9 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jun 13, 2021
(cherry picked from commit 5924243) Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
|
GH-26703 is a backport of this pull request to the 3.10 branch. |
mdickinson
added a commit
that referenced
this pull request
Jun 13, 2021
mdickinson
added a commit
that referenced
this pull request
Jun 13, 2021
jdevries3133
pushed a commit
to jdevries3133/cpython
that referenced
this pull request
Jun 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a reference counting bug introduced in #13266 and identified by @tim-one in #26662: if we don't set
temptoNULL, and if the value it has at this point is retained until the end of the function, then we end up doing an extra decref. I spent some time trying to identify a test-case that exercises this bug, and failed - I couldn't find a code path wheretempisn't re-used at some point. Nevertheless, it's a potential point of fragility for maintenance of this code.https://bugs.python.org/issue36027