-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-115618: Remove improper Py_XDECREFs in property methods #115619
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-115618: Remove improper Py_XDECREFs in property methods #115619
Conversation
serhiy-storchaka
commented
Feb 17, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Incorrect Py_XDECREFs in property #115618
It has no effect in main, but in 3.11 the test crashes without the fix. |
@serhiy-storchaka Currently your test passes on 3.12 and main without the fix, because None is immortal. AFAICT it is not possible to write a test to catch refcount bugs for immortal objects. What do you think if we change the debug versions of |
Personally I do not think that this is worth the effort, and this isn't will make test catch this bug (because this test goes along with the fix), it's just make bug reproducible. Actually there's a test ( |
@Eclips4 no, that test doesn't do anything with the total refcount, it only checks that decrefing an immortal object doesn't change its refcount. So it will be fine. We can improve the test by checking incref as well, which will also make it balanced. The test also hard-codes the boundaries of the smallint cache instead of using the macros, which can also be improved. |
I afraid that it is too late, and many tests will show unbalanced refcounts. |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to
|
…ds (pythonGH-115619) (cherry picked from commit 090dd21) Co-authored-by: Serhiy Storchaka <[email protected]>
…ds (pythonGH-115619) (cherry picked from commit 090dd21) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-115620 is a backport of this pull request to the 3.12 branch. |
GH-115621 is a backport of this pull request to the 3.11 branch. |