Skip to content

Python/flowgraph.c:528: all_exits_have_lineno: Assertion `0' failed #124746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
15r10nk opened this issue Sep 29, 2024 · 4 comments
Closed

Python/flowgraph.c:528: all_exits_have_lineno: Assertion `0' failed #124746

15r10nk opened this issue Sep 29, 2024 · 4 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@15r10nk
Copy link
Contributor

15r10nk commented Sep 29, 2024

Bug report

Bug description:

The following code causes an assertion in a debug build:

def name_4():
    try:
        pass
    except* name_3:
        pass
    else:
        return {}
    finally:
        try:
            pass
        except* name_1:
            pass

output (Python 3.13.0rc2+):

python3: Python/flowgraph.c:528: all_exits_have_lineno: Assertion `0' failed.

This bug can be reproduced with the current 3.13 branch (80de976).
I bisected the issue down to 7e49f27.
@iritkatriel I think this is one for you again.

CPython versions tested on:

3.13

Operating systems tested on:

No response

Linked PRs

@15r10nk 15r10nk added the type-bug An unexpected behavior, bug, or error label Sep 29, 2024
@picnixz picnixz added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Sep 29, 2024
@iritkatriel
Copy link
Member

Thanks. This commit is the one that introduced this assertion. I will remove it from 3.13 so it doesn't block releases, but will leave it in 3.14 so we can keep finding these edge cases.

@iritkatriel
Copy link
Member

iritkatriel commented Sep 30, 2024

This version also crashes (return in try instead of else):

def name_4():
    try:
        return {}
    except* name_3:
        pass
    finally:
        try:
            pass
        except* name_1:
            pass

Also this one (first except* removed):

def name_4():
    try:
        return {}
    finally:
        try:
            pass
        except* name_1:
            pass

@iritkatriel iritkatriel self-assigned this Oct 2, 2024
@picnixz
Copy link
Member

picnixz commented Feb 15, 2025

@iritkatriel anything else to do here?

@iritkatriel
Copy link
Member

These examples don't fail on 3.14 (where the assertion exists) so I guess we fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants