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-101765: Fix refcount issues in list and unicode pickling #102265
Conversation
|
If you want to schedule another build, you need to add the |
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
|
Thanks @JelleZijlstra for the PR |
|
Sorry, @JelleZijlstra, I could not cleanly backport this to |
|
Sorry @JelleZijlstra, I had trouble checking out the |
|
Working on the backports |
|
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>
|
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>
| @@ -14794,8 +14794,10 @@ unicodeiter_reduce(unicodeiterobject *it, PyObject *Py_UNUSED(ignored)) | |||
| return Py_BuildValue("N(O)n", iter, it->it_seq, it->it_index); | |||
| } else { | |||
| 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.
Followup from #101769.
__reduce__can segfault if accessing__builtins__.__dict__['iter']mutates the iter object #101765