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-132744: Check recursion limit in _PY_FRAME_GENERAL by Fidget-Spinner · Pull Request #132746 · python/cpython

Conversation

@Fidget-Spinner

@Fidget-Spinner Fidget-Spinner commented Apr 20, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: Runaway recursion on 3.13 and higher for _PY_FRAME_GENERAL #132744

Sorry, something went wrong.

Uh oh!

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

All reactions
@Fidget-Spinner
Check recursion limit in _PY_FRAME_GENERAL
b4434ad
@Fidget-Spinner
Fidget-Spinner requested a review from markshannon as a code owner April 20, 2025 10:36
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 20, 2025
@python-cla-bot

python-cla-bot Bot commented Apr 20, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot mentioned this pull request Apr 20, 2025
Runaway recursion on 3.13 and higher for _PY_FRAME_GENERAL #132744
Closed
@blurb-it
📜🤖 Added by blurb_it.
2d88db8
@markshannon

markshannon commented Apr 29, 2025

Copy link
Copy Markdown
Member

Would it be better to add the _CHECK_STACK_SPACE micro-op to the CALL_PY_GENERAL and CALL_BOUND_METHOD_GENERAL macro instructions?

All reactions

Sorry, something went wrong.

Uh oh!

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

@Fidget-Spinner
Address review
0a0a496
@Fidget-Spinner

Fidget-Spinner commented Apr 29, 2025

Copy link
Copy Markdown
Member Author

Would it be better to add the _CHECK_STACK_SPACE micro-op to the CALL_PY_GENERAL and CALL_BOUND_METHOD_GENERAL macro instructions?

Done.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Fidget-Spinner

Fidget-Spinner commented Apr 29, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Actually, those two instructions don't need to check stack space (they use the frame push that can fail, instead of the one that pushes without checks), they only need to check recursion remaining. So I split it into another uop to make things more efficient.

All reactions

Sorry, something went wrong.

Uh oh!

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

Fidget-Spinner added 2 commits April 29, 2025 23:47
@Fidget-Spinner
split into another uop
9a5de58
@Fidget-Spinner
Merge remote-tracking branch 'upstream/main' into fix_recursion
60c29f9
markshannon
markshannon approved these changes Apr 30, 2025
View reviewed changes

@markshannon markshannon left a comment

Copy link
Copy Markdown
Member

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.

Thanks

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Apr 30, 2025
@Fidget-Spinner
Merge remote-tracking branch 'upstream/main' into fix_recursion
965c0d8
@markshannon
markshannon merged commit ddac7ac into python:main May 2, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label May 2, 2025
@Fidget-Spinner
Fidget-Spinner deleted the fix_recursion branch May 2, 2025 17:08
@markshannon markshannon mentioned this pull request May 2, 2025
GH-133231: Changes to executor management to support proposed sys._jit module #133287
Merged
@markshannon markshannon added the needs backport to 3.13 only security fixes label May 5, 2025
@miss-islington-app

miss-islington-app Bot commented May 5, 2025

Copy link
Copy Markdown

Thanks @Fidget-Spinner for the PR, and @markshannon for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented May 5, 2025

Copy link
Copy Markdown

Sorry, @Fidget-Spinner and @markshannon, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker ddac7ac59a7dfa4437562b6e705e64865c3b1e9a 3.13
All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app miss-islington-app Bot assigned markshannon May 5, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@Fidget-Spinner @Pranjal095
pythongh-132744: Check recursion limit in CALL_PY_GENERAL (pythonGH-1…
5de6eac
…32746)
@serhiy-storchaka

serhiy-storchaka commented Aug 14, 2025

Copy link
Copy Markdown
Member

Reminder about backporting. @Fidget-Spinner @markshannon

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app

bedevere-app Bot commented Aug 21, 2025

Copy link
Copy Markdown

GH-138032 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Aug 21, 2025
Fidget-Spinner pushed a commit that referenced this pull request Aug 22, 2025
@skv0zsneg
[3.13] gh-132744: Check recursion limit in _PY_FRAME_GENERAL (GH-132746…
ebccd1d
…) (GH-138032)
@marc-hb marc-hb mentioned this pull request Feb 11, 2026
test_import_loop_detection_self() fails since cpython 3.13.8 RecursionError change zephyrproject-rtos/west#908
Closed
@marc-hb marc-hb mentioned this pull request Feb 19, 2026
Recursion check in 3.13.8 in CALL_BOUND_METHOD_GENERAL leaves stack in inconsistent state #145008
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon markshannon approved these changes

Uh oh!

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

Assignees

@markshannon markshannon

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.

3 participants

@Fidget-Spinner @markshannon @serhiy-storchaka
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.