[New-bugs-announce] [issue30734] 200000 indexes crashes eval and python (without eval)

George Shuklin report at bugs.python.org
Thu Jun 22 08:43:13 EDT 2017


New submission from George Shuklin:

If there is too many indexes python crashes:

a[0][0][0][0]....

segfault at 7ffd25fe6ff8 ip 0000564528c8cfe6 sp 00007ffd25fe7000 error 6 in python2.7[564528b6a000+324000]

code to generate code:

>>> i="[0]"*200000
>>> file('/tmp/bad_python.py','w').write('a=[]\na.append(a)\nprint(type(a'+i+'))\n')

python2 /tmp/bad_python.py 
Segmentation fault (core dumped)

python3 /tmp/bad_python.py 
RecursionError: maximum recursion depth exceeded during compilation

Just in case I upload generated code.

This bug affects both eval() function and python interpreter.

----------
components: Interpreter Core
files: bad_python.py.gz
messages: 296626
nosy: george-shuklin
priority: normal
severity: normal
status: open
title: 200000 indexes crashes eval and python (without eval)
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file46968/bad_python.py.gz

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30734>
_______________________________________


More information about the New-bugs-announce mailing list