Artifacts Associated With Ticket 1084111
Ticket change [6b70d04094] (rid 128334) by pointsman on 2004-12-13 01:23:23:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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) - foundin initialized to: "obsolete: 8.5a3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "pointsman"
- subsystem initialized to: "None"
- title initialized to: "memory leak with namespace import"
- type initialized to: "Bug"
Ticket change [7b7028ecd9] (rid 90513) by msofer on 2004-12-13 08:39:18:
- 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. - login: "msofer"
- mimetype: "text/plain"
- subsystem changed to: "21. [namespace]"
- username: "msofer"
- icomment:
Ticket change [cce672283c] (rid 95788) by msofer on 2004-12-13 08:55:23:
- assignee changed to: "msofer"
- closedate changed to: "2004-12-13T01:55:23"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Great catch and report, thank you. Fixed in HEAD, 8.4 is immune.
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- subsystem changed to: "07. Variables"
- username: "msofer"
Ticket change [73f6683a2e] (rid 105122) by msofer on 2004-12-13 09:21:53:
- icomment:
Logged In: YES user_id=148712 Spoke too soon - one leak plugged, but there's some more ...
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "None"
- status changed to: "Open"
- username: "msofer"
- icomment:
Ticket change [820fba7774] (rid 117159) by msofer on 2005-04-16 22:38:08:
- priority changed to: "9 Immediate"
Ticket change [3097838597] (rid 93282) by msofer on 2005-04-17 02:14:57:
- closedate changed to: "2005-04-16T19:14:57"
- closer changed to: "msofer"
- 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.
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- title changed to: "memory leak in [array names]"
- username: "msofer"