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 does not handle correctly some errors when parsin from stdin #87576

Closed
pablogsal opened this issue Mar 5, 2021 · 4 comments
Closed

Parser does not handle correctly some errors when parsin from stdin #87576

pablogsal opened this issue Mar 5, 2021 · 4 comments
Labels
3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@pablogsal
Copy link
Member

BPO 43410
Nosy @pmp-p, @lysnikolaou, @pablogsal
PRs
  • bpo-43410: Fix crash in the parser when producing syntax errors when reading from stdin #24763
  • 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 2021-03-14.03:39:08.649>
    created_at = <Date 2021-03-05.17:22:35.377>
    labels = ['interpreter-core', '3.10']
    title = 'Parser does not handle correctly some errors when parsin from stdin'
    updated_at = <Date 2021-03-14.03:39:08.648>
    user = 'https://github.com/pablogsal'

    bugs.python.org fields:

    activity = <Date 2021-03-14.03:39:08.648>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-03-14.03:39:08.649>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2021-03-05.17:22:35.377>
    creator = 'pablogsal'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43410
    keywords = ['patch']
    message_count = 4.0
    messages = ['388157', '388159', '388172', '388654']
    nosy_count = 3.0
    nosy_names = ['pmpp', 'lys.nikolaou', 'pablogsal']
    pr_nums = ['24763']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue43410'
    versions = ['Python 3.10']

    @pablogsal
    Copy link
    Member Author

    The parser crashes when there are some syntax errors from stdin:

    echo "(1+34" | ./python.exe -
    [1] 54046 done echo "(1+34" |
    54047 segmentation fault ./python.exe -

    @pablogsal pablogsal added 3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Mar 5, 2021
    @pablogsal
    Copy link
    Member Author

    I think we should look into having some variable holding all the text that we have parsed so far. All the workarounds to fetch the text from the file or from stdin or whatnot are getting very very complicated.

    @pablogsal
    Copy link
    Member Author

    I modified PR 24763 to implement this idea.

    @pablogsal
    Copy link
    Member Author

    New changeset cd8dcbc by Pablo Galindo in branch 'master':
    bpo-43410: Fix crash in the parser when producing syntax errors when reading from stdin (GH-24763)
    cd8dcbc

    @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

    1 participant