◐ Shell
clean mode source ↗

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

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