Skip to content

crash: Assertion `target->b_startdepth >= 0 && target->b_startdepth == start_depth' failed #162952

Todo

Description

@15r10nk

Crash report

I found the following bug with fuzzing

import ast

source = """\
while x:
    break
else:
    try:
        pass
    finally:
        pass
lambda: 0
"""
tree = ast.parse(source)
# Compiles normally with the parser's original locations.
compile(tree, '<parsed AST>', 'exec')
# Generated ASTs commonly give every node the same source location.
for node in ast.walk(tree):
    if hasattr(node, 'lineno'):
        node.lineno = node.end_lineno = 1
compile(tree, '<generated AST>', 'exec')
print('Compiled successfully')

output python 3.15.2:

> uv run -p 3.15.2 /tmp/codegen-cpython-assertion.py
python: Python/flowgraph.c:2846: load_fast_push_block: Assertion `target->b_startdepth >= 0 && target->b_startdepth == start_depth' failed.

I bisected it down to e05182f (@DinoV)

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

Linked PRs

Activity

  1. added
    type-crash
    on Dec 1, 2026
  2. added
    interpreter-core
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

interpreter-coretype-crash

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions