GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — gh-101765: Fix SystemError / segmentation fault in iter `__reduce__` when internal access of `builtins.__dict__` exhausts the iterator by ionite34 · Pull Request #101769 · python/cpython Conversation
|
|
Since this could cause a segfault, it should perhaps be considered a security issue to be backported to the security branches. However, the way to trigger it is so obscure that I'm not sure it's worth backporting. @ambv what do you think? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @ionite34 for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @ionite34 and @JelleZijlstra, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry @ionite34 and @JelleZijlstra, I had trouble checking out the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@ionite34 are you interested in doing the 3.10/3.11 backports (and potentially 3.7-3.9 if we decide this is important enough)? It's probably a matter of installing cherry-picker locally and fixing a few conflicts. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yeah I could try 👀, though uh, I don't think I saw anything on the dev guide regarding backports. Am I essentially doing the stuff mentioned here? https://pypi.org/project/cherry_picker/#example |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! Yes, cherrry-picker will do most of the work of actually creating the PR, you just have to do the manual work to fix the merge. Just as general background, we develop every 3.x version in a separate branch. PRs are usually first against the main branch (which will be 3.12). If the PR fixes a bug (as opposed to a new feature), we'll backport the change into the bugfix branches, which are currently for 3.10 and 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…`__reduce__` when internal access of `builtins.__dict__` exhausts the iterator (pythonGH-101769). (cherry picked from commit 54dfa14) Co-authored-by: Ionite <[email protected]>
…`__reduce__` when internal access of `builtins.__dict__` exhausts the iterator (pythonGH-101769). (cherry picked from commit 54dfa14) Co-authored-by: Ionite <[email protected]>
|
GH-102228 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…`__reduce__` when internal access of `builtins.__dict__` exhausts the iterator (pythonGH-101769). (cherry picked from commit 54dfa14) Co-authored-by: Ionite <[email protected]>
|
GH-102229 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } else { | ||
| PyObject *reversed = _PyEval_GetBuiltin(&_Py_ID(reversed)); | ||
| listreviterobject *it = (listreviterobject *)_it; | ||
| if (it->it_seq) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If it_seq is NULL then reversed is leaked here, _PyEval_GetBuiltin returns a strong reference.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good point, but doesn't that mean the old code also leaked references? I'll prepare a PR to fix this now.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, the N code to Py_BuildValue steals a reference, so the previous code was right in terms of refcounting.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ing (pythonGH-102265) Followup from pythonGH-101769.. (cherry picked from commit d71edbd) Co-authored-by: Jelle Zijlstra <[email protected]>
…ing (pythonGH-102265) Followup from pythonGH-101769.. (cherry picked from commit d71edbd) Co-authored-by: Jelle Zijlstra <[email protected]>
…ce__` when internal access of `builtins.__dict__` exhausts the iterator (python#101769)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.