-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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-116099: Fix refcounting bug in _queueobj_shared()
#116164
gh-116099: Fix refcounting bug in _queueobj_shared()
#116164
Conversation
This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with `Py_CLEAR()` to make it clear that the variable is dead. With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref count`.
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.
LGTM
The macOS builds have been queued for over 1.5 hours. Considering how unlikely they are to find something on this change that the Linux/Windows builds didn't, would it be worth merging before they're done (to fix the refleak buildbot)? |
This PR is next in queue so it should start soon: https://github.com/python/cpython/actions?query=is%3Aqueued I don't think there's a way to land PRs without the required tests passing (or changing the GitHub project configuration). |
Thanks again for doing this, @swtaarrs! |
|
FYI, I'm pretty sure that buildbot failure is unrelated. |
…h-116164) This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with `Py_CLEAR()` to make it clear that the variable is dead. With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref count`.
…h-116164) This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with `Py_CLEAR()` to make it clear that the variable is dead. With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref count`.
…h-116164) This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with `Py_CLEAR()` to make it clear that the variable is dead. With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref count`.
This code decrefs
qidobj
twice in some paths. Sinceqidobj
isn't used after the firstPy_DECREF()
, remove the others, and replace thePy_DECREF()
withPy_CLEAR()
to make it clear that the variable is dead.With this fix,
python -mtest test_interpreters -R 3:3 -mtest_queues
no longer fails with_Py_NegativeRefcount: Assertion failed: object has negative ref count
.test_interpreters
fails when running with-R 3:3
argument #116099