Overview
| Artifact ID: | e3890451896771f779e0ee63dff9940166852ac0 |
|---|---|
| Ticket: | 3394654fffffffffffffffffffffffffffffffff
leak due to non closing base of stacked channels |
| User & Date: | dgp on 2014-05-08 15:59:59 |
Changes
- closedate changed to: "2456786.16665822"
- comment changed to:
$ cat leak.tcl set nested 0 proc foo {fd args} { switch -exact [lindex $args 0] { initialize {return {initialize finalize read write}} finalize {return {}} } global nested if {$nested} { return } set nested 1 chan pop $fd } set b [open /dev/null w] set c [chan push $b [list foo $b]] puts $c a flush $c close $c $ valgrind --leak-check=yes ./tclsh leak.tcl ... ==27262== 8,577 (16 direct, 8,561 indirect) bytes in 1 blocks are definitely lost in loss record 20 of 20 ==27262== at 0x4A05E1C: malloc (vg_replace_malloc.c:195) ==27262== by 0x482844: Tcl_Alloc (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x453534: TclpOpenFileChannel (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x42066F: Tcl_FSOpenFileChannel (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x4E0073: Tcl_OpenObjCmd (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x47CF39: TclNREvalObjv (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x47D583: Tcl_EvalObjv (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x47DFF3: TclEvalEx (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x42CE58: TclSubstTokens (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x47D8BF: TclEvalEx (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x47E325: Tcl_EvalEx (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) ==27262== by 0x421169: Tcl_FSEvalFileEx (in /local/tmp/dgp/fossil/tcl-only/valgrind/tclsh) - icomment:
Turns out this was a band-aid solution, and the design troubles with sharing of ChannelBuffers ran much deeper. Now the band-aid is corrupting the actual fix. Removing it allows the real fix (refcounting ChannelBuffers) to function properly.
- login: "dgp"
- mimetype: "text/plain"
- severity changed to: "Minor"