Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-21
10:03 • Closed ticket [3048353fff]: interp limit ... can dump core plus 4 other ch... artifact: 1d7baa69b4 user: serhiy.storchaka
2011-08-30
07:24 • Closed ticket [3398794fff]: Setting limits on the current interpreter calls Tcl_... artifact: 27aa44be09 user: dkf
2011-08-29
21:47 • Ticket [3398794fff]: 7 changes artifact: 5b729a3197 user: dkf
2011-08-28
08:02 • Ticket [3398794fff]: 4 changes artifact: 44bef7bb85 user: egavilan
2011-08-26
16:46 • New ticket [3398794fff]. artifact: 144698331e user: egavilan

Setting limits on the current interpreter calls Tcl_Panic()

Closed / Fixed3398794fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2011-08-26 16:46:56
Trying to set an interp limit on the current interpreter calls Tcl_Panic().

$ tclsh8.6 
% interp limit {} time -command foo
installing limit callback to the limited interpreter
Abort trap (core dumped)

The backtrace points to the lines 4156-4158 of generic/tclInterp.c, which reads

    if (interp == targetInterp) {
Tcl_Panic("installing limit callback to the limited interpreter");
    }

This fact is:
* Not documented in the interp manual page.
* An incorrect use of Tcl_Panic() IMO. Simply ignoring the request or generating a standard, [catch]eable error is enough.
egavilanplain2011-08-28 08:02:44
More brokenness due to this design choice:

$ tclsh8.6 
% set i [interp create -safe]  
interp0
% $i eval {interp limit {} time -command foo}
installing limit callback to the limited interpreter
Abort trap (core dumped)
dkfplain2011-08-29 21:47:27
My fault, as I should have added protection against this situation in the Tcl command; this is hitting a trap in the lower-level C API. Also panics in 8.5 (expected; 8.6 hasn't had any updates in this area).
dkfplain2011-08-30 07:24:31
allow_comments - 1
Log in (anonymous is fine) to add a comment.