Skip to content
Tcl Source Code History Of Ticket 1084111
Login

History Of Ticket 1084111

Artifacts Associated With Ticket 1084111

  1. Ticket change [6b70d04094] (rid 128334) by pointsman on 2004-12-13 01:23:23:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      tcl head as of 2004-12-13 02:19:05 CET
      
      This script let tclsh8.5 (slowly) grow indefinitely:
      
      package require tcltest
      while {1} {
          namespace import ::tcltest::*
          namespace forget ::tcltest::*
      }
      
      (It's only 24 bytes per loop. That is, grows slow
      enough to watch it  with top without real danger.)
      
      valgrind tells me, that the spot is:
      
      24 bytes in 1 blocks are definitely lost in loss record
      1 of 3
         at 0x40027B98: malloc (vg_replace_malloc.c:153)
         by 0x40251A5D: TclpAlloc (../generic/tclAlloc.c:685)
         by 0x40259325: Tcl_Alloc (../generic/tclCkalloc.c:1018)
         by 0x402C511B: Tcl_NewObj (../generic/tclObj.c:628)
         by 0x402EA208: Tcl_ArrayObjCmd
      (../generic/tclVar.c:2924)
         by 0x40254CAB: TclEvalObjvInternal
      (../generic/tclBasic.c:3053)
         by 0x4028F528: TclExecuteByteCode
      (../generic/tclExecute.c:1629)
         by 0x4028DC16: TclCompEvalObj
      (../generic/tclExecute.c:980)
         by 0x402D6D5F: TclObjInterpProc
      (../generic/tclProc.c:1126)
         by 0x40254CAB: TclEvalObjvInternal
      (../generic/tclBasic.c:3053)
         by 0x40254EE4: Tcl_EvalObjv (../generic/tclBasic.c:3167)
         by 0x402BDC8C: Tcl_Import (../generic/tclNamesp.c:1392)
         by 0x402C01EC: NamespaceImportCmd
      (../generic/tclNamesp.c:3544)
         by 0x402BF279: Tcl_NamespaceObjCmd
      (../generic/tclNamesp.c:2800)
         by 0x40254CAB: TclEvalObjvInternal
      (../generic/tclBasic.c:3053)
         by 0x402557F5: Tcl_EvalEx (../generic/tclBasic.c:3537)
         by 0x402B4CF3: Tcl_FSEvalFileEx
      (../generic/tclIOUtil.c:1687)
         by 0x402BC0B4: Tcl_Main (../generic/tclMain.c:434)
         by 0x8048705: main (tclAppInit.c:87)
         by 0x4035D8AD: __libc_start_main (in /lib/libc.so.6)
         by 0x8048630: (within /usr/local/tcl-head/bin/tclsh8.5)
      
      
    4. foundin initialized to: "obsolete: 8.5a3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "pointsman"
    9. subsystem initialized to: "None"
    10. title initialized to: "memory leak with namespace import"
    11. type initialized to: "Bug"
  2. Ticket change [7b7028ecd9] (rid 90513) by msofer on 2004-12-13 08:39:18:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Confirmed by running the script
       namespace eval a {
             proc x args {set x}
             namespace export *
       }
       while 1 {
              namespace import a::*
               namespace forget a::*
       }
      and watching it in top.
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. subsystem changed to: "21. [namespace]"
    5. username: "msofer"
  3. Ticket change [cce672283c] (rid 95788) by msofer on 2004-12-13 08:55:23:

    1. assignee changed to: "msofer"
    2. closedate changed to: "2004-12-13T01:55:23"
    3. closer changed to: "msofer"
    4. icomment:
      Logged In: YES 
      user_id=148712
      
      Great catch and report, thank you. Fixed in HEAD, 8.4 is immune.
      
      
    5. login: "msofer"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. subsystem changed to: "07. Variables"
    10. username: "msofer"
  4. Ticket change [73f6683a2e] (rid 105122) by msofer on 2004-12-13 09:21:53:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Spoke too soon - one leak plugged, but there's some more ...
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. resolution changed to: "None"
    5. status changed to: "Open"
    6. username: "msofer"
  5. Ticket change [820fba7774] (rid 117159) by msofer on 2005-04-16 22:38:08:

    1. priority changed to: "9 Immediate"
  6. Ticket change [3097838597] (rid 93282) by msofer on 2005-04-17 02:14:57:

    1. closedate changed to: "2005-04-16T19:14:57"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      Fixed in HEAD. 
      
      Both leaks were due to refCount mismanagement in the code
      for [array names]. The second one only appeared when the
      array was empty - hence in the test script down below, but
      not in the original script in the report. This ticket's
      summary was edited accordingly.
      
      
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. title changed to: "memory leak in [array names]"
    9. username: "msofer"