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 — Fix confusion of `enum _framestate` with `enum _frameowner` by andersk · Pull Request #106156 · python/cpython

Conversation

@andersk

@andersk andersk commented Jun 27, 2023

Copy link
Copy Markdown
Contributor

The owner field of _PyInterpreterFrame is supposed to be a member of enum _frameowner, but FRAME_CLEARED is a member of enum _framestate. Add FRAME_OWNED_BY_ACCIDENT to enum _frameowner and use that instead. (It happens to have the same numerical value, but we shouldn’t rely on that anywhere.)

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added the awaiting review label Jun 27, 2023
@andersk andersk mentioned this pull request Jun 27, 2023
GH-97002: Prevent _PyInterpreterFrames from backing more than one PyFrameObject #97996
Merged
@andersk andersk mentioned this pull request Jul 31, 2023
gh-106092: Fix use-after-free crash in frame_dealloc #106875
Merged
@andersk
Fix confusion of enum _framestate with enum _frameowner
b3a6775
The owner field of _PyInterpreterFrame is supposed to be a member of
enum _frameowner, but FRAME_CLEARED is a member of enum _framestate.
Add FRAME_OWNED_BY_ACCIDENT to enum _frameowner and use that instead.
(It happens to have the same numerical value, but we shouldn’t rely on
that anywhere.)

Signed-off-by: Anders Kaseorg <[email protected]>
@andersk
andersk force-pushed the frame-enum-confusion branch from 1fc0752 to b3a6775 Compare March 3, 2024 19:15
rruuaanng
rruuaanng reviewed Sep 16, 2024
View reviewed changes
Comment thread Include/internal/pycore_frame.h
FRAME_OWNED_BY_GENERATOR = 1,
FRAME_OWNED_BY_FRAME_OBJECT = 2,
FRAME_OWNED_BY_CSTACK = 3,
FRAME_OWNED_BY_ACCIDENT = 4,

@rruuaanng rruuaanng Sep 16, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Maybe you should add a NEWS describing that you added a new value to the enum_frameowner enumeration in pycore_frame.h.

I think that making modifications to the interpreter core requires adding.

Sorry, something went wrong.

Uh oh!

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

All reactions

@andersk andersk Sep 16, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This is not part of the public API; it’s an internal fix that has no direct relevance to Python users or extension authors.

However, the surrounding code has changed, so I’m closing this in favor of

  • Remove asserts that confuse enum _framestate with enum _frameowner #124148

Sorry, something went wrong.

Uh oh!

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

All reactions
@andersk andersk closed this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@rruuaanng rruuaanng rruuaanng left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

awaiting review

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.

3 participants

@andersk @rruuaanng @bedevere-bot
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.