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

pegen (PEP 617): bug in error handling #84735

Closed
vstinner opened this issue May 7, 2020 · 4 comments
Closed

pegen (PEP 617): bug in error handling #84735

vstinner opened this issue May 7, 2020 · 4 comments
Labels
3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@vstinner
Copy link
Member

vstinner commented May 7, 2020

BPO 40555
Nosy @gvanrossum, @vstinner, @lysnikolaou, @pablogsal
PRs
  • bpo-40555: Check for p->error_indicator in loop rules after the main loop is done #19986
  • 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-05-08.02:39:00.559>
    created_at = <Date 2020-05-07.23:48:56.181>
    labels = ['interpreter-core', '3.9']
    title = 'pegen (PEP 617): bug in error handling'
    updated_at = <Date 2020-05-08.02:39:00.559>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-05-08.02:39:00.559>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-08.02:39:00.559>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2020-05-07.23:48:56.181>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40555
    keywords = ['patch']
    message_count = 4.0
    messages = ['368391', '368392', '368396', '368408']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'vstinner', 'lys.nikolaou', 'pablogsal']
    pr_nums = ['19986']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue40555'
    versions = ['Python 3.9']

    @vstinner
    Copy link
    Member Author

    vstinner commented May 7, 2020

    autopep8 test suite does crash on Python 3.9.0a6. The bug can be reproduced with:

    Python 3.9.0a6+ (heads/master:b7a78ca74a, May  8 2020, 01:46:01) 
    [GCC 10.0.1 20200430 (Red Hat 10.0.1-0.14)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> compile('"\\xhh" \\',  '<string>', 'exec', dont_inherit=True)
    python: Objects/typeobject.c:984: type_call: Assertion `!_PyErr_Occurred(tstate)' failed.
     Abandon (core dumped)

    It seems like p->error_condition should be checked more often in Parser/pegen/parse.c.

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

    vstinner commented May 7, 2020

    Workaround: use python3.9 -X oldparser.

    @lysnikolaou
    Copy link
    Contributor

    That's because we're not checking for errors after a loop is done. Pushing a fix.

    @pablogsal
    Copy link
    Member

    New changeset db9163c by Pablo Galindo in branch 'master':
    bpo-40555: Check for p->error_indicator in loop rules after the main loop is done (GH-19986)
    db9163c

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

    No branches or pull requests

    3 participants