Houdini escape inf recursion detection
Closed / Invalid3480592fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2012-01-27 16:37:51
This demo script creates a busy loop:
proc demo {} {
catch demo
demo
}
demo
The guards in Tcl meant to detect and stop infinite
recursion don't catch this one.
dgpplain2012-01-27 23:45:48
It's not necessarily a bug. Certainly
we permit scripts that hang Tcl:
while 1 {}
It's at least surprising though, since at
least at a simple level we aim to discover
and report infinite recursions.
dgpplain2012-01-27 23:53:17
Aha! This structure doesn't actually escape
detection. It just delays it a very very great deal.
The time to detect the recursion is quadratic in
the recursionlimit of the interp. Use
interp recursionlimit {} 20
before the script, and it will stop with an error.
sebresplain2012-01-28 00:07:24
this is not a busy loop, it's a "tree" of "demo" calls, where in catch each recusrsion level ends level - 1 times with "too many nested evals...". Also factorial from 1000 - is very very big...
IMO - is not a bug.
while 1 {incr test} - is also "busy loop"?
dkfplain2012-01-30 20:43:16
allow_comments - 1 Confirmed as not a bug, just (eye-wateringly) expensive.
Log in (anonymous is fine) to add a comment.