Skip to content
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

assertion failure in f-string parsing Parser/string_parser.c #90918

Closed
ammaraskar opened this issue Feb 15, 2022 · 6 comments
Closed

assertion failure in f-string parsing Parser/string_parser.c #90918

ammaraskar opened this issue Feb 15, 2022 · 6 comments
Assignees
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@ammaraskar
Copy link
Member

BPO 46762
Nosy @gpshead, @ericvsmith, @ammaraskar, @lysnikolaou, @pablogsal, @miss-islington
PRs
  • bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. #31365
  • [3.10] bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (GH-31365) #31370
  • [3.9] bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (GH-31365) #31371
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ericvsmith'
    closed_at = <Date 2022-02-16.12:17:31.927>
    created_at = <Date 2022-02-15.22:19:52.557>
    labels = ['interpreter-core', 'type-crash', '3.11']
    title = 'assertion failure in f-string parsing Parser/string_parser.c'
    updated_at = <Date 2022-02-16.12:17:31.927>
    user = 'https://github.com/ammaraskar'

    bugs.python.org fields:

    activity = <Date 2022-02-16.12:17:31.927>
    actor = 'pablogsal'
    assignee = 'eric.smith'
    closed = True
    closed_date = <Date 2022-02-16.12:17:31.927>
    closer = 'pablogsal'
    components = ['Parser']
    creation = <Date 2022-02-15.22:19:52.557>
    creator = 'ammar2'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46762
    keywords = ['patch']
    message_count = 6.0
    messages = ['413302', '413303', '413324', '413325', '413326', '413328']
    nosy_count = 6.0
    nosy_names = ['gregory.p.smith', 'eric.smith', 'ammar2', 'lys.nikolaou', 'pablogsal', 'miss-islington']
    pr_nums = ['31365', '31370', '31371']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue46762'
    versions = ['Python 3.11']

    @ammaraskar
    Copy link
    Member Author

    Similar to https://bugs.python.org/issue46503 found by the ast.literal_eval fuzzer

    >>> f'{<'
    python: Parser/string_parser.c:346: fstring_compile_expr: Assertion `*expr_end == '}' || *expr_end == '!' || *expr_end == ':' || *expr_end == '='' failed.
    [1]    14060 abort      ./python
    

    @ammaraskar ammaraskar added the 3.11 only security fixes label Feb 15, 2022
    @ammaraskar ammaraskar added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump 3.11 only security fixes labels Feb 15, 2022
    @ammaraskar ammaraskar added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 15, 2022
    @ericvsmith
    Copy link
    Member

    Good catch! I'll have a patch tonight.

    @ericvsmith
    Copy link
    Member

    New changeset ffd9f8f by Eric V. Smith in branch 'main':
    bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (bpo-31365)
    ffd9f8f

    @miss-islington
    Copy link
    Contributor

    New changeset 3d407b9 by Miss Islington (bot) in branch '3.10':
    bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (GH-31365)
    3d407b9

    @pablogsal
    Copy link
    Member

    Thanks for the quick fix, Eric!

    @miss-islington
    Copy link
    Contributor

    New changeset a657bff by Miss Islington (bot) in branch '3.9':
    bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (GH-31365)
    a657bff

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants