Skip to content

Segmentation fault in running compile() with large expression size. #2780

@xiaxinmeng

Description

@xiaxinmeng

Calling function compile() in "single" mode to compile large size expression can cause a segmentation fault On RustPython. See the following example. The example cause segmentation fault on Rust Python 0.1.2 interpreter when n > 10000, e.g. n = 1000,100000,1000000

test.py

mylist = []
n = 10000
print(compile("mylist"+"+mylist"*n,'','single'))

Actual output:

Segmentation fault (core dumped)

System:

Ubuntu 16.04
Rust Python 0.1.2 interpreter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions