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-156091: Fix crash compiling deeply nested inlined comprehensions by iritkatriel · Pull Request #156957 · python/cpython

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Sep 4, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Count inlined-comprehension SETUP_FINALLY handlers toward CO_MAXBLOCKS so the compiler raises SyntaxError instead of overflowing the except stack.

Fixes #156091.

  • Issue: Compiler crash: inlined comprehensions overflow _PyCfgExceptStack, bypassing the u_nfblocks block-nesting limit #156091

Sorry, something went wrong.

Uh oh!

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

All reactions
@iritkatriel @cursoragent
pythongh-156091: Fix crash compiling deeply nested inlined comprehens…
9044124
…ions

Count inlined-comprehension SETUP_FINALLY handlers toward CO_MAXBLOCKS so
the compiler raises SyntaxError instead of overflowing the except stack.

Co-authored-by: Cursor <[email protected]>
@iritkatriel
iritkatriel requested a review from markshannon as a code owner September 4, 2026 18:35
@bedevere-app bedevere-app Bot mentioned this pull request Sep 4, 2026
Compiler crash: inlined comprehensions overflow _PyCfgExceptStack, bypassing the u_nfblocks block-nesting limit #156091
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Sep 4, 2026
@iritkatriel iritkatriel added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes type-crash A hard crash of the interpreter, possibly with a core dump and removed awaiting core review labels Sep 4, 2026
@iritkatriel
iritkatriel requested review from JelleZijlstra and carljm September 4, 2026 18:36
JelleZijlstra
JelleZijlstra approved these changes Sep 5, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added the awaiting merge label Sep 5, 2026
@iritkatriel
Merge branch 'main' into pythongh-156091
1385ed4
@iritkatriel
iritkatriel enabled auto-merge (squash) September 5, 2026 15:30
@iritkatriel
iritkatriel merged commit 14a93f4 into python:main Sep 5, 2026
54 checks passed

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented Sep 5, 2026

Copy link
Copy Markdown

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

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 awaiting merge label Sep 5, 2026
@bedevere-app

bedevere-app Bot commented Sep 5, 2026

Copy link
Copy Markdown

GH-156992 is a backport of this pull request to the 3.15 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.15 bugs and security fixes label Sep 5, 2026
@miss-islington-app

miss-islington-app Bot commented Sep 5, 2026

Copy link
Copy Markdown

Sorry, @iritkatriel, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 14a93f4d91edf767e7b35413127cfcd6a2806983 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 iritkatriel Sep 5, 2026
@bedevere-app

bedevere-app Bot commented Sep 5, 2026

Copy link
Copy Markdown

GH-156993 is a backport of this pull request to the 3.14 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.14 bugs and security fixes label Sep 5, 2026
iritkatriel pushed a commit that referenced this pull request Sep 5, 2026
@miss-islington
[3.14] gh-156091: Fix crash compiling deeply nested inlined comprehen…
dd36d01
…sions (GH-156957) (#156993)
@iritkatriel iritkatriel mentioned this pull request Sep 6, 2026
[3.13] gh-156091: Fix crash compiling deeply nested inlined comprehensions (GH-156957) #157050
Merged
1 task
@bedevere-app

bedevere-app Bot commented Sep 6, 2026

Copy link
Copy Markdown

GH-157050 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 Sep 6, 2026
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
@iritkatriel @clin1234
pythongh-156091: Fix crash compiling deeply nested inlined comprehens…
86c03f3
…ions (python#156957)
iritkatriel added a commit that referenced this pull request Sep 17, 2026
@iritkatriel @cursoragent
[3.13] gh-156091: Fix crash compiling deeply nested inlined comprehen…
d7657d0
…sions (GH-156957) (#157050)

Count inlined-comprehension SETUP_FINALLY handlers toward CO_MAXBLOCKS.
Manual backport of 14a93f4 / GH-156993; 3.13 still has this code in compile.c.

Co-authored-by: Cursor <[email protected]>
serhiy-storchaka pushed a commit that referenced this pull request Oct 10, 2026
@miss-islington @iritkatriel
[3.15] gh-156091: Fix crash compiling deeply nested inlined comprehen…
845fb34
…sions (GH-156957) (GH-156992)

(cherry picked from commit 14a93f4)

Co-authored-by: Irit Katriel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
@carljm carljm Awaiting requested review from carljm

Uh oh!

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

Assignees

@iritkatriel iritkatriel

Labels

type-crash A hard crash of the interpreter, possibly with a core dump

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Compiler crash: inlined comprehensions overflow _PyCfgExceptStack, bypassing the u_nfblocks block-nesting limit

Uh oh!

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

2 participants

@iritkatriel @JelleZijlstra
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.