Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9ca7facb0a2a54b2342e86a82b5acab8fd880b91
Ticket: 467523ffffffffffffffffffffffffffffffffff
memory leak in [namespace eval foo {}]
User & Date: rbrunner on 2001-10-03 15:47:27
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The following code leaks (in every Tcl version):
    
      interp create foo 
      foo eval {
          namespace eval bar {}
      }
      interp delete foo
    
    Note: 
    
      interp create foo 
      foo eval {
          namespace eval bar {\#}
      }
      interp delete foo
    
    does NOT leak.
    
    Unfortunately I didn't really track down the problem, 
    but the call 
    
      result = Tcl_EvalObjEx(interp, objv[3], 0);
    
    in generic/tclNamesp.c line 2955 (tcl8.4.a3), which is 
    called with an empty string in objv[3] seems to cause 
    the leak. Changing this code to 
    
      if (strlen(Tcl_GetString(objv[3])))
        result = Tcl_EvalObjEx(interp, objv[3], 0);
      else
        result = TCL_OK;
    
    fixes the symptoms, but certainly not the problem.
    (Sorry for not having a proper fix.)
    
  4. foundin changed to: "obsolete: 8.4a3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "rbrunner"
  9. subsystem changed to: "21. [namespace]"
  10. title changed to: "memory leak in [namespace eval foo {}]"
  11. type changed to: "Bug"