bpo-15108: Prevent accessing the result tuple from Python in PySequence_Tuple by pablogsal · Pull Request #24510 · python/cpython
|
|
||
| // bpo-15108: Code can access the result tuple while being | ||
| // incomplete when calling PyIter_Next(). | ||
| PyObject_GC_UnTrack(result); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss int the issue, then I can modify the PR :)
FWIW: Traditionally any "crasher" that depended on gc.get_referrers was not considered a bug. These do not seem to affect "normal code" and are hard to fix without doing brain surgery to Python.
Yeah, I have to say that I am not very convinced about this change because it also fixes a bigger problem only on one place.
What worries me the most here is not using gc.get_referrers, but the GC crashing because it does a GC pass when the tuple is invalid.
pxd
mannequin
mentioned this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters