GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — A long string in ast.parse() leads to a segfault · Issue #4857 · RustPython/RustPython

A long string in ast.parse() leads to a segfault #4857

New issue
Copy link
New issue
Copy link
Closed
Closed
A long string in ast.parse() leads to a segfault#4857
Copy link

Description

@xiaxinmeng
xiaxinmeng
opened on Apr 6, 2023
Issue body actions

ast.parse() takes a long string as the argument leading to a segfault.

test.py

import ast
x = ast.parse('+chr(33)'*1000000)

Crash message: Segmentation fault (core dumped)

Environment:
Ubuntu 18.04
rustpython v0.2.0

Activity

  1. DimitrisJim commented on Apr 6, 2023

    @DimitrisJim
    DimitrisJim
    on Apr 6, 2023
    Member
    More actions

    Nice, this seems like a variation of #4862. Basically we're creating a deeply nested AST here since the rhs of every BinOp will be another BinOp so it fails while trying to recurse into this.

    Both these issues will most likely be solved by the same solution: checks while recursing deeply during the compilation phase (I'm guessing the AST traversal is the cause here but I'd need to check to make sure).

    Thanks a lot for reporting and feel free to re-open if you disagree.

  2. DimitrisJim
    closed this as completedon Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.