Tcl Source Code

View Ticket
Login
Ticket UUID: 3393280
Title: iortrans-11.0 leaks
Type: Bug Created on: 2011-08-17 19:16:52
Submitter: dgp Assigned to: dgp
Subsystem: 26. Channel Transforms Severity:
Priority: 5 Medium Last modified: 2011-09-20 20:51:35
Status: Closed Closed by: dgp
Resolution: Fixed Closed on: 2011-08-19 20:28:28
Version: obsolete: 8.6b2
Description:
$  make valgrind TESTFLAGS="-file ioTrans.test -match iortrans-11.0"
...
==2696== 405 (88 direct, 317 indirect) bytes in 1 blocks are definitely lost in loss record 23 of 23
==2696==    at 0x4A05E1C: malloc (vg_replace_malloc.c:195)
==2696==    by 0x493654: Tcl_Alloc (in /local/tmp/dgp/fossil/tcl-only/valgrind/tcltest)
==2696==    by 0x4F3827: TclChanPushObjCmd (in /local/tmp/dgp/fossil/tcl-only/valgrind/tcltest)
==2696==    by 0x48DD49: TclNREvalObjv (in /local/tmp/dgp/fossil/tcl-only/valgrind/tcltest)
==2696==    by 0x48F4EC: TclNREvalObjEx (in /local/tmp/dgp/fossil/tcl-only/valgrind/tcltest)
==2696==    by 0x4D8996: NsEnsembleImplementationCmdNR (in /local/tmp/dgp/fossil/tcl-only/valgrind/tcltest)
==2696==    by 0x489435: TclNRRunCallbacks (in /local/tmp/dgp/fossil/tcl-only/valgrind/tcltest)
==2696==    by 0x4207B2: SlaveEval (in /local/tmp/dgp/fossil/tcl-only/valgrind/tcltest)
User Comments:
dgp added on 2011-08-20 02:34:27:
The value returned by NewReflectedTransform
(tclIORTrans.c, line 580) is what is leaking.
Suspect a missing Tcl_Release() call somewhere.

dgp added on 2011-08-20 02:58:51:
ReflectClose simply has a few exits
that fail to call Tcl_EventuallyFree

andreas_kupries added on 2011-08-20 03:04:09:
Oops. Sorry.

(Has ReflectClose in tclIORChan.c similar missing T_EF ?)

dgp added on 2011-08-20 03:28:28:

allow_comments - 1

fixed in trunk

dgp added on 2011-09-19 23:23:17:
This was the wrong fix.  Adding Tcl_EventuallyFree() calls
without regard to what thread its called from started reporting
"free Tcl_Obj in wrong thread" errors with memory debugging on.

I expect to have a proper fix done soon.

dgp added on 2011-09-20 20:51:35:
fix on the trunk now should be better,