Skip to content
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-95818: Skip incomplete frames in PyThreadState_GetFrame #95886

Merged
merged 5 commits into from
Aug 11, 2022

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Aug 11, 2022

if (tstate->cframe->current_frame == NULL) {
_PyInterpreterFrame *f = tstate->cframe->current_frame;
while (f && _PyFrame_IsIncomplete(f)) {
f = f->previous;
Copy link
Member

Choose a reason for hiding this comment

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

Is previous guaranteed to be initialized in an incomplete frame?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. A _PyInterpreterFrame is never incomplete in the sense that it is partially initialized. "Incomplete" just means that the resulting frame object wouldn't be valid because stuff like MAKE_CELL hasn't run yet (or we just want to hide the frame).

@miss-islington
Copy link
Contributor

Thanks @markshannon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-95890 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Aug 11, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 11, 2022
…ythonGH-95886)

(cherry picked from commit 1b46d11)

Co-authored-by: Mark Shannon <mark@hotpy.org>
pablogsal pushed a commit that referenced this pull request Aug 12, 2022
… (#95890)

(cherry picked from commit 1b46d11)

Co-authored-by: Mark Shannon <mark@hotpy.org>

Co-authored-by: Mark Shannon <mark@hotpy.org>
@markshannon markshannon deleted the check-frame-in-get-frame branch September 26, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants