Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 53627a92987ef2a792b5af051151a26b35be305a
Ticket: 467523ffffffffffffffffffffffffffffffffff
memory leak in [namespace eval foo {}]
User & Date: rbrunner on 2001-10-05 02:27:06
Changes

  1. icomment:
    Logged In: YES 
    user_id=205230
    
    Some further observations:
    Any recursive call to Tcl_EvalObjEx with an empty string 
    object to eval leaks:
    
      time {time {}}
      time {switch 1 1 {}}
      switch 1 1 {time {}}
    
    In addition I found out, that these calls leak, whenever 
    the innermost empty code matches the Literal that is added 
    in TclCompile.c line 1041 (tcl8.4a3):
    
      TclRegisterLiteral(envPtr, "", 0, /*onHeap*/ 0)
    
    Setting this to
    
      TclRegisterLiteral(envPtr, "  ", 2, /*onHeap*/ 0)
    
    makes 
    
      time {time {  }}
    
    leak. It seems that this equality increments the empty 
    codes object's refCount (objPtr in Tcl_evalObjEx) to be too 
    high -> it is not cleaned up properly.
    
    
    
  2. login: "rbrunner"
  3. mimetype: "text/plain"
  4. username: "rbrunner"