You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
exec() crashes Rust Python when taking large expression as argument #2783
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))
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.
Activity
DimitrisJim commentedon Aug 5, 2021
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__callsvm.to_reprand the loop begins). Similar things probably happen forexecand 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.
DimitrisJim commentedon Aug 5, 2021
Yup,
exec,evalandcompileall loop onSymbolTableBuilder.scan_expression.DimitrisJim commentedon Aug 5, 2021
Thanks for all these @xiaxinmeng, I'll be closing them in favor of #2796