From: SourceForge.net <no...@so...> - 2006-10-16 20:11:33
|
Bugs item #1578454, was opened at 2006-10-16 16:44 Message generated for change (Settings changed) made by msofer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1578454&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 41. Memory Preservation Group: development: 8.5a5 Status: Open Resolution: None >Priority: 9 Submitted By: Mark Janssen (mpc_janssen) Assigned to: miguel sofer (msofer) Summary: Tcl_EvalObjv leaks memory when calling apply Initial Comment: 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 ---------------------------------------------------------------------- Comment By: miguel sofer (msofer) Date: 2006-10-16 17:11 Message: 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 ---------------------------------------------------------------------- Comment By: Mark Janssen (mpc_janssen) Date: 2006-10-16 16:58 Message: 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 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1578454&group_id=10894 |