Skip to content

remove_unreachable: Assertion `target->b_predecessors == 0 || target == b->b_next' failed #124871

@15r10nk

Description

@15r10nk

Crash report

What happened?

The following code causes an assertion in a cpython debug build

name_3=5
name_2=2
name_1=0

while name_3 <= name_2 > name_1:
    try:
        raise
    except:
        pass
    finally:
        pass

output (Python 3.13.0a5+):

python3: Python/flowgraph.c:994: remove_unreachable: Assertion `target->b_predecessors == 0 || target == b->b_next' failed.

The bug is in the current 3.13 branch.
I bisected the problem down to 04697bc
@iritkatriel I think this is again one for you.

Little side note. I found this bug after fuzzing for ~3 days. I want to start to test the cpython main branch in the future and I hope to find bugs like this earlier.

CPython versions tested on:

3.13

Operating systems tested on:

No response

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

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions