Artifacts Associated With Ticket 1578454
Ticket change [c0f2a55e64] (rid 102511) by mpc_janssen on 2006-10-16 19:44:46:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
When apply is called using Tcl_EvalObjv, memory is being leaked that doesn't seem possible to reclaim. If puts is used as command instead of apply no memory is lost. Attached a small C lib which defines two commands doputs and doapply where the only difference is the contents of objv[0] in the Tcl_EvalObjv call. doapply leaks, doputs doesn't. System info: % parray tcl_platform tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 5.1 tcl_platform(platform) = windows tcl_platform(threaded) = 1 tcl_platform(user) = mjanssen tcl_platform(wordSize) = 4 % info patchlevel 8.5a5
- foundin initialized to: "obsolete: 8.5a5"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "mpc_janssen"
- subsystem initialized to: "42. Memory Preservation"
- title initialized to: "Tcl_EvalObjv leaks memory when calling apply"
- type initialized to: "Bug"
Ticket change [4791b0afd9] (rid 99728) by mpc_janssen on 2006-10-17 02:44:46:
- icomment:
File Added - 198467: apply.zip
- login: "mpc_janssen"
- mimetype: "text/plain"
- username: "mpc_janssen"
- icomment:
Add attachment "apply.zip" [848bde260d] (rid 117571) by mpc_janssen on 2006-10-17 02:44:46.
Ticket change [63ff69d873] (rid 92674) by mpc_janssen on 2006-10-17 02:58:30:
- icomment:
Logged In: YES user_id=1463011 Attached the memory trace for the following script: memory trace on load leak.dll time { doapply } 5 A quick glance seems to indicate that memory allocated in tclCompile.c 1706 is only sparingly freed: > cat mem.out | grep 124 ckalloc 995860 124 ..\generic\tclCompile.c 1706 ckalloc 995cc0 124 ..\generic\tclCompile.c 1706 ckalloc 996850 124 ..\generic\tclCompile.c 1706 ckalloc 9966b0 124 ..\generic\tclCompile.c 1706 ckalloc 9964e0 124 ..\generic\tclCompile.c 1706 ckalloc 996310 124 ..\generic\tclCompile.c 1706 ckfree 995860 124 ..\generic\tclCompile.c 749 ckalloc 993ad0 124 ..\generic\tclCompile.c 1706 - login: "mpc_janssen"
- mimetype: "text/plain"
- username: "mpc_janssen"
- icomment:
Add attachment "mem.out" [d8150494a2] (rid 107378) by mpc_janssen on 2006-10-17 02:58:30.
Ticket change [fce8a33e94] (rid 108314) by mpc_janssen on 2006-10-17 02:58:31:
- icomment:
File Added - 198471: mem.out
- login: "mpc_janssen"
- mimetype: "text/plain"
- username: "mpc_janssen"
- icomment:
Ticket change [11a291199c] (rid 95184) by msofer on 2006-10-17 03:11:10:
- assignee changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 New test added to show the leak of the internal rep: ==== apply-9.1 leaking internal rep FAILED ==== Contents of test case: set end [getbytes] for {set i 0} {$i < 5} {incr i} { ::apply [lrange $lam 0 end] set tmp $end set end [getbytes] } set leakedBytes [expr {$end - $tmp}] ---- Result was: 222 ---- Result should have been (exact matching): 0 ==== apply-9.1 FAILED - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
Ticket change [258a7e926f] (rid 88189) by msofer on 2006-10-17 03:11:33:
- priority changed to: "9 Immediate"
Ticket change [f2c164ec08] (rid 109607) by msofer on 2006-10-17 03:40:26:
- icomment:
Logged In: YES user_id=148712 Fixed in HEAD; thanks
- login: "msofer"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "msofer"
- icomment:
Ticket change [b105140412] (rid 98078) by msofer on 2006-10-17 03:40:27:
- closedate changed to: "2006-10-16T20:40:27"
- closer changed to: "msofer"
- resolution changed to: "Fixed"