|
2026-10-22
| ||
| 17:19 | • Ticket [2824981fff] lack of set causes infinite loop through unknown sta... artifact: 1988d92ae9 user: serhiy.storchaka | |
|
2026-10-12
| ||
| 17:47 | • Closed ticket [2824981fff]. artifact: f2710ba5a9 user: serhiy.storchaka | |
|
2012-05-11
| ||
| 04:20 | • Ticket [2824981fff]: 5 changes artifact: 30459f3239 user: ferrieux | |
|
2012-01-28
| ||
| 00:09 | • Ticket [2824981fff]: 4 changes artifact: 30a39c4e72 user: dgp | |
|
2012-01-27
| ||
| 23:43 | • Ticket [2824981fff]: 4 changes artifact: bd3ebfc976 user: dgp | |
| 23:24 | • Ticket [2824981fff]: 4 changes artifact: e0f43d092c user: sebres | |
| 22:10 | • Ticket [2824981fff]: 4 changes artifact: f28b37479e user: dgp | |
| 22:07 | • Ticket [2824981fff]: 4 changes artifact: 59251cef75 user: msofer | |
| 21:42 | • Ticket [2824981fff]: 4 changes artifact: a6e7fd0bcb user: dgp | |
| 21:37 | • Ticket [2824981fff]: 4 changes artifact: 5cfcd75c74 user: msofer | |
| 21:32 | • Ticket [2824981fff]: 8 changes artifact: 6f60990762 user: dgp | |
|
2009-12-30
| ||
| 20:52 | • Ticket [2824981fff]: 5 changes artifact: 5300556018 user: msofer | |
| 00:11 | • Ticket [2824981fff]: 1 change artifact: d5ea519413 user: dkf | |
| 00:11 | • Ticket [2824981fff]: 4 changes artifact: 01f376dc2d user: dkf | |
|
2009-12-11
| ||
| 10:29 | • Ticket [2824981fff]: 6 changes artifact: dc1adad403 user: msofer | |
|
2009-07-22
| ||
| 12:41 | • Ticket [2824981fff]: 1 change artifact: 69b8307b39 user: dkf | |
| 06:47 | • Ticket [2824981fff]: 4 changes artifact: 3677014633 user: msofer | |
| 04:24 | • Ticket [2824981fff]: 4 changes artifact: b4f2f57620 user: msofer | |
|
2009-07-21
| ||
| 19:47 | • New ticket [2824981fff]. artifact: b39ea1ae51 user: zbigniew_b | |
lack of [set] causes infinite loop through [unknown]
Closed / Fixed2824981fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 41 days ago
Descriptionplain2009-07-21 19:47:09
It seems, that "rename" command is faulty - by trying, as example: % rename set asd % asd a 0 ...one can see, that any other input is impossible, while CPU is at full power. Tested on Linux. Test with tclsh8.5 revealed no such problem, but still another one: $tclsh8.5 % rename set asd % asd a 1 1 % asd b 2 2 % set a 1 too many nested evaluations (infinite loop?) ...and since this time, every try to run any other non-existing command is answered with "too many nested evaluations (infinite loop?)" instead of with usual "invalid command name".
msoferplain2009-07-22 04:24:36
The 8.5 behaviour is correct - it is a consequence of your breaking [unknown] (which uses [set]) by not providing a reasonable implementation of [set]. This causes [unknown] to call itself recursively. Not sure yet about what is happening with 8.6
msoferplain2009-07-22 06:47:10
8.6 seems to be miscounting recursion levels from [unknown]
proc history args {}
rename set xx
set x 1
enters a busy loop and never hits the recursion limit.
dkf Ticket [2824981fff]: 1 change
[History diff]2009-07-22 12:41:38
msoferplain2009-12-11 10:29:58
still present
dkfplain2009-12-30 00:11:51
Updated title to be more descriptive of the real issue
dkf Ticket [2824981fff]: 1 change
[History diff]2009-12-30 00:11:52
msoferplain2009-12-30 20:52:27
The problem with [unknown] is now fixed in HEAD: errors in setting two variables were [catch]ed, so that the infinite loop was not being detected. Bug kept open because there is a deeper problem: this behaviour should NOT be triggerable with a plain script, infinite recursion of the unknown handler should never happen.
dgpplain2012-01-27 21:32:42
This bug fix didn't get backported to 8.5.
msoferplain2012-01-27 21:37:57
The fix was for the 8.6 behaviour (busy loop at 100% cpu), which does not happen in 8.5 The deeper bug (recursive calling of unknown) is present in both ... and possibly since the dawn of time.
dgpplain2012-01-27 21:42:35
Help me out. Was the busy loop behavior fixed, or avoided?
msoferplain2012-01-27 22:07:09
The infinite loop in [unknown] happens when there is an unknown command in the body of [unknown] itself. Still there. The bug in 8.6 was that that particular infinite loop was not being counted as a nesting level, so that "too many nested evaluations" was never triggered. The patch http://core.tcl.tk/tcl/ci/0c8502aa1f?sbs=1 just allows differentiating errors: is it that errorInfo does not exist? Or rather that [set] is not defined? The first should keep going, the second should recursively call [unknown] outside of a [catch]. That is fixed now. I forget now why that diff seems not to be important in 8.5 :(
dgpplain2012-01-27 22:10:34
I'm still puzzled. Why is it that the same code in 8.5 and 8.6 has its nesting levels counted differently?
sebresplain2012-01-27 23:24:14
the command "set" that used in "unknown" is not available - also call "unknown" again and again ...
8.6b
% puts [regexp -inline {(?:[^\n]*\n){1,6}} $::errorInfo]
{too many nested evaluations (infinite loop?)
while executing
"set savedErrorInfo $::errorInfo"
(procedure "::unknown" line 7)
invoked from within
"set savedErrorInfo $::errorInfo"
}
8.5.11
% puts [regexp -inline {(?:[^\n]*\n){1,6}} $::errorInfo]
{too many nested evaluations (infinite loop?)
while executing
"set cmd [lindex $args 0]"
(procedure "::unknown" line 8)
invoked from within
"set cmd [lindex $args 0]"
}
dgpplain2012-01-27 23:43:37
New bug 3480592 demonstrates the core real issue of how a busy loop can be created the evades inf recursion detection. It avoids all potentialy confusing interactions with ::error* variables and the unknown mechanism.
dgpplain2012-01-28 00:09:34
FWIW, the reason the problem arose in Tcl 8.6
is that we removed "Aunt Millie" from [::unknown].
She was using [set] before the [catch {set ...}] that
came later, which avoided the Houdini structure.
ferrieuxplain2012-05-11 04:20:32
Doesn't look like a showstopper. Lowering prio.
serhiy.storchakawiki2026-10-12 17:47:52
The busy loop was fixed in [0c8502aa1f]. In 8.6.18, 9.0 and 9.1, after
rename set asd an unknown command fails at once with "too many
nested evaluations (infinite loop?)", as in 8.5. This is the expected result of
removing a command that unknown uses; the remaining case
[3480592] was closed as not a bug.
serhiy.storchaka Ticket [2824981fff]: 3 changes
[History diff]2026-10-22 17:19:24
Log in (anonymous is fine) to add a comment.