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 — exec() crashes Rust Python when taking large expression as argument · Issue #2783 · RustPython/RustPython

exec() crashes Rust Python when taking large expression as argument #2783

New issue
Copy link
New issue
Copy link
Closed
Closed
exec() crashes Rust Python when taking large expression as argument#2783
Copy link

Description

@xiaxinmeng
xiaxinmeng
opened on Aug 2, 2021
Issue body actions

When we set the argument of exec() as a complex expression, Rust Python interpreter crashes Please check the following example. This example triggers segmentation fault on Rust Python 0.1.2 interpreter.

test.py

mylist = []
n = 10000
print(exec("mylist"+"+mylist"*n))

Actual output:

Segmentation fault (core dumped)

System:

Ubuntu 16.04
Rust Python 0.1.2 interpreter

Activity

  1. DimitrisJim commented on Aug 5, 2021

    @DimitrisJim
    DimitrisJim
    on Aug 5, 2021
    Member
    More actions

    I'm under the impression that all these issues (#2782, #2781 and #2780) are related. We don't yet detect recursions when they appear in Rust level code (i.e rebinding __repr__ as __str__ then __str__ calls vm.to_repr and the loop begins). Similar things probably happen for exec and family.

    For Python code this appears to have been fixed in #1477.

    I'll open an umbrella issue to track all these and keep them localized in one overarching issue.

  2. DimitrisJim commented on Aug 5, 2021

    @DimitrisJim
    DimitrisJim
    on Aug 5, 2021
    Member
    More actions

    Yup, exec, eval and compile all loop on SymbolTableBuilder.scan_expression.

  3. DimitrisJim commented on Aug 5, 2021

    @DimitrisJim
    DimitrisJim
    on Aug 5, 2021
    Member
    More actions

    Thanks for all these @xiaxinmeng, I'll be closing them in favor of #2796

  4. DimitrisJim
    closed this as completedon Aug 5, 2021
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.