FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-15108: Prevent accessing the result tuple from Python in PySequence_Tuple by pablogsal · Pull Request #24510 · python/cpython · GitHub

Repository navigation

bpo-15108: Prevent accessing the result tuple from Python in PySequence_Tuple - #24510

Closed
pablogsal wants to merge 1 commit into
python:masterfrom
pablogsal:bpo-15108
Closed

pablogsal wants to merge 1 commit into
python:masterfrom
pablogsal:bpo-15108

Conversation

pablogsal commented Feb 12, 2021 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Comment thread Objects/abstract.c

// bpo-15108: Code can access the result tuple while being
// incomplete when calling PyIter_Next().
PyObject_GC_UnTrack(result);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would prefer to add a new API to create an untracked tuple: https://bugs.python.org/issue15108#msg387029

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let's discuss int the issue, then I can modify the PR :)

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL