Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-101765: Fix refcount issues in list and unicode pickling#102265
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
JelleZijlstra commented Feb 25, 2023 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
bedevere-bot commented Feb 25, 2023
🤖 New build scheduled with the buildbot fleet by @JelleZijlstra for commit b8ad59e 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
iritkatriel left a comment
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
miss-islington commented Feb 26, 2023
Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
miss-islington commented Feb 26, 2023
Sorry, @JelleZijlstra, I could not cleanly backport this to |
miss-islington commented Feb 26, 2023
Sorry @JelleZijlstra, I had trouble checking out the |
JelleZijlstra commented Feb 26, 2023
Working on the backports |
bedevere-bot commented Feb 26, 2023
GH-102268 is a backport of this pull request to the 3.11 branch. |
…ing (pythonGH-102265) Followup from pythonGH-101769.. (cherry picked from commit d71edbd) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
bedevere-bot commented Feb 26, 2023
GH-102269 is a backport of this pull request to the 3.10 branch. |
…ing (pythonGH-102265) Followup from pythonGH-101769.. (cherry picked from commit d71edbd) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
| PyObject*u=unicode_new_empty(); | ||
| if (u==NULL) | ||
| if (u==NULL){ | ||
| Py_DECREF(iter); |
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.
Shouldn't this be Py_XDECREF? There is no null check above for iter.
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.
Good point. But shouldn’t it be a null check and return above, if iter is null I think it would crash in the BuildValue before we even get here.
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.
Py_BuildValue deals with NULL internally; if one of the args is NULL it itself returns NULL, propagating the exception. So changing to XDECREF here should be enough.
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.
Followup from #101769.
__reduce__can segfault if accessing__builtins__.__dict__['iter']mutates the iter object #101765