Tcl Source Code

View Ticket
Login
Ticket UUID: 3398794
Title: Setting limits on the current interpreter calls Tcl_Panic()
Type: Bug Created on: 2011-08-26 16:46:56
Submitter: egavilan Assigned to: dkf
Subsystem: 20. [interp] Severity:
Priority: 9 Immediate Last modified: 2011-08-30 07:24:31
Status: Closed Closed by: dkf
Resolution: Fixed Closed on: 2011-08-30 00:24:31
Version: obsolete: 8.5.10
Description:
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.
User Comments:
egavilan added on 2011-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)

dkf added on 2011-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).

dkf added on 2011-08-30 07:24:31:

allow_comments - 1