[issue44917] interpreter hangs on recursion in both body and handler of a try block

Mark Shannon report at bugs.python.org
Sun Aug 15 05:29:35 EDT 2021


Mark Shannon <mark at hotpy.org> added the comment:

A recursion limit of 30 is effectively infinite.
With a debug build of 3.11, the time to execute grows very fast indeed, probably super-exponentially.

mark at nero:~/repos/cpython$ time ./python ~/test/test.py 15

real	0m1.107s
user	0m1.099s
sys	0m0.008s
mark at nero:~/repos/cpython$ time ./python ~/test/test.py 16

real	0m4.468s
user	0m4.464s
sys	0m0.004s
mark at nero:~/repos/cpython$ time ./python ~/test/test.py 17

real	0m20.968s
user	0m20.928s
sys	0m0.040s
mark at nero:~/repos/cpython$ time ./python ~/test/test.py 18

real	2m29.562s
user	2m29.270s
sys	0m0.140s


I would expect ./python ~/test/test.py 30 to take millions of years.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44917>
_______________________________________


More information about the Python-bugs-list mailing list