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

Lib/test/test_frame.py Outdated Show resolved Hide resolved
if (tstate->cframe->current_frame == NULL) {
_PyInterpreterFrame *f = tstate->cframe->current_frame;
while (f && _PyFrame_IsIncomplete(f)) {
f = f->previous;
Copy link
Member

@iritkatriel iritkatriel Aug 11, 2022

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

@markshannon markshannon Aug 11, 2022

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).

@markshannon markshannon merged commit 1b46d11 into python:main Aug 11, 2022
14 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Aug 11, 2022

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

@bedevere-bot
Copy link

bedevere-bot commented Aug 11, 2022

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

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>
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.

None yet

5 participants