GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-94262: Don't create frame objects for frames that aren't complete. by markshannon · Pull Request #94371 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented Jun 28, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Since 3.11 we have moved some low level operations to the bytecode which mean that frames can be in a partially constructed state during GC, or other operations that could expose them to Python code (or third party C code).

We already avoid tracing any instructions before the first RESUME when executing a frame.
This PR prevents creating a frame object before the first RESUME has been reached.

  • Issue: Crash when inspecting frame of generator #94262

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
markshannon added 2 commits June 27, 2022 19:09
@markshannon
Add test for creating frame object when making a generator.
87e97ae
@markshannon
Don't expose incomplete frames as frame objects.
583d164
@markshannon markshannon added the needs backport to 3.11 only security fixes label Jun 28, 2022
@bedevere-bot bedevere-bot added the awaiting core review label Jun 28, 2022
@markshannon
Add news
5043a8b
@markshannon markshannon added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 28, 2022
@bedevere-bot

bedevere-bot commented Jun 28, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @markshannon for commit 5043a8b 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 28, 2022
@markshannon markshannon mentioned this pull request Jun 28, 2022
[3.11] GH-93516: Backport GH-93769 #94231
Merged
pablogsal
pablogsal requested changes Jun 28, 2022
View reviewed changes
Comment thread Lib/test/test_generators.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting core review label Jun 28, 2022
@bedevere-bot

bedevere-bot commented Jun 28, 2022

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added the awaiting changes label Jun 28, 2022
pablogsal
pablogsal reviewed Jun 28, 2022
View reviewed changes
Comment thread Include/internal/pycore_frame.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

pablogsal
pablogsal reviewed Jun 28, 2022
View reviewed changes
Comment thread Include/internal/pycore_frame.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

markshannon added 2 commits June 28, 2022 12:57
@markshannon
Cleanup after test.
e81c1f3
@markshannon
Explain _PyFrame_IsIncomplete()
6d07165
@markshannon

markshannon commented Jun 28, 2022

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting change review and removed awaiting changes labels Jun 28, 2022
@bedevere-bot

bedevere-bot commented Jun 28, 2022

Copy link
Copy Markdown

Thanks for making the requested changes!

@pablogsal: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot
bedevere-bot requested a review from pablogsal June 28, 2022 12:10
kumaraditya303
kumaraditya303 reviewed Jun 28, 2022
View reviewed changes
Comment thread Lib/test/test_generators.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

markshannon added 5 commits June 28, 2022 15:21
@markshannon
Try harder to break things
ce0d4b5
@markshannon
Avoid creating frame objects for incomplete frames vai f_back.
f56451b
@markshannon
Fix test
b69e803
@markshannon
Assert frame is valid when creating frame object.
c648d46
@markshannon
Prevent test polluting environment
cf0b32c
kumaraditya303
kumaraditya303 reviewed Jun 28, 2022
View reviewed changes
Comment thread Lib/test/test_generators.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@markshannon
Create all frames on stack from finalizer.
939769c
@markshannon markshannon added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 29, 2022
@bedevere-bot

bedevere-bot commented Jun 29, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @markshannon for commit 939769c 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 29, 2022
@markshannon
markshannon merged commit 544531d into python:main Jul 1, 2022
@miss-islington

miss-islington commented Jul 1, 2022

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting change review label Jul 1, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 1, 2022
@markshannon @miss-islington
pythonGH-94262: Don't create frame objects for frames that aren't yet…
96cbfad
… complete. (pythonGH-94371)

(cherry picked from commit 544531d)

Co-authored-by: Mark Shannon <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 1, 2022
@bedevere-bot

bedevere-bot commented Jul 1, 2022

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pablogsal pushed a commit that referenced this pull request Jul 4, 2022
@miss-islington @markshannon
[3.11] GH-94262: Don't create frame objects for frames that aren't ye…
68f5fa6
…t complete. (GH-94371) (#94482)

Co-authored-by: Mark Shannon <[email protected]>
@ericsnowcurrently ericsnowcurrently mentioned this pull request Sep 21, 2022
PyEval_GetFrame crashes when it returns incomplete frames #96975
Closed
@markshannon
markshannon deleted the no-frame-object-too-early branch September 26, 2023 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kumaraditya303 kumaraditya303 kumaraditya303 left review comments
@pablogsal pablogsal Awaiting requested review from pablogsal

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@markshannon @bedevere-bot @miss-islington @pablogsal @kumaraditya303
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.