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

Parser/pegen.c:68: _PyPegen_check_barry_as_flufl: Assertion `t->type == NOTEQUAL' failed #86380

Closed
vstinner opened this issue Oct 30, 2020 · 5 comments
Labels
3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@vstinner
Copy link
Member

BPO 42214
Nosy @gvanrossum, @warsaw, @vstinner, @lysnikolaou, @pablogsal, @isidentical
PRs
  • bpo-42214: Fix check for NOTEQUAL token in the PEG parser for the barry_as_flufl rule #23048
  • [3.9] bpo-42214: Fix check for NOTEQUAL token in the PEG parser for the barry_as_flufl rule (GH-23048). #23051
  • Files
  • pgen_bug.py
  • 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 = None
    closed_at = <Date 2020-10-31.00:40:51.564>
    created_at = <Date 2020-10-30.22:05:31.222>
    labels = ['interpreter-core', '3.10']
    title = "Parser/pegen.c:68: _PyPegen_check_barry_as_flufl: Assertion `t->type == NOTEQUAL' failed"
    updated_at = <Date 2020-10-31.00:40:51.564>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-10-31.00:40:51.564>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-10-31.00:40:51.564>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2020-10-30.22:05:31.222>
    creator = 'vstinner'
    dependencies = []
    files = ['49555']
    hgrepos = []
    issue_num = 42214
    keywords = ['patch']
    message_count = 5.0
    messages = ['380002', '380003', '380004', '380014', '380025']
    nosy_count = 6.0
    nosy_names = ['gvanrossum', 'barry', 'vstinner', 'lys.nikolaou', 'pablogsal', 'BTaskaya']
    pr_nums = ['23048', '23051']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue42214'
    versions = ['Python 3.10']

    @vstinner
    Copy link
    Member Author

    When Python is built in debug mode, it fails with an assertion error on the following code:
    ---

    def func1():
        if a != b:
            raise ValueError
    
    def func2():
        try
            return 1
        finally:
            pass

    Try attached pgen_bug.py:

    $ ./python pgen_bug.py 
    python: Parser/pegen.c:68: _PyPegen_check_barry_as_flufl: Assertion `t->type == NOTEQUAL' failed.
    Abandon (core dumped)

    @vstinner vstinner added 3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Oct 30, 2020
    @vstinner
    Copy link
    Member Author

    Barry: what did you do?

    @vstinner
    Copy link
    Member Author

    In release mode, there is no assertion error:

    $ python3.10 pgen_bug.py 
      File "/home/vstinner/python/master/pgen_bug.py", line 6
        try
           ^
    SyntaxError: invalid syntax

    @pablogsal
    Copy link
    Member

    New changeset 06f8c33 by Pablo Galindo in branch 'master':
    bpo-42214: Fix check for NOTEQUAL token in the PEG parser for the barry_as_flufl rule (GH-23048)
    06f8c33

    @pablogsal
    Copy link
    Member

    New changeset ddcd57e by Pablo Galindo in branch '3.9':
    [3.9] bpo-42214: Fix check for NOTEQUAL token in the PEG parser for the barry_as_flufl rule (GH-23048) (GH-23051)
    ddcd57e

    @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.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants