Menu

#4460 [testconcatobj] leaks memory

obsolete: 8.5.7
closed-fixed
5
2009-12-12
2009-11-10
Don Porter
No

only a testing command, so not chasing at the
moment.

test util-4.7 puts [testconcatobj] to work, and
valgrind sees it leaking badly:

==5975== 12 bytes in 3 blocks are indirectly lost in loss record 1 of 4
==5975== at 0x40053C0: malloc (vg_replace_malloc.c:149)
==5975== by 0x815B8FC: TclpAlloc (tclAlloc.c:708)
==5975== by 0x8071478: Tcl_Alloc (tclCkalloc.c:1046)
==5975== by 0x80FA04C: SetListFromAny (tclListObj.c:1783)
==5975== by 0x80F8C7F: Tcl_ListObjLength (tclListObj.c:730)
==5975== by 0x8060678: TestconcatobjCmd (tclTest.c:7109)
==5975== by 0x8068278: TclInvokeStringCommand (tclBasic.c:2145)
==5975== by 0x806A065: TclEvalObjvInternal (tclBasic.c:3689)
==5975==
==5975==
==5975== 72 bytes in 3 blocks are indirectly lost in loss record 2 of 4
==5975== at 0x40053C0: malloc (vg_replace_malloc.c:149)
==5975== by 0x815B8FC: TclpAlloc (tclAlloc.c:708)
==5975== by 0x8071478: Tcl_Alloc (tclCkalloc.c:1046)
==5975== by 0x80FA09B: SetListFromAny (tclListObj.c:1791)
==5975== by 0x80F8C7F: Tcl_ListObjLength (tclListObj.c:730)
==5975== by 0x8060678: TestconcatobjCmd (tclTest.c:7109)
==5975== by 0x8068278: TclInvokeStringCommand (tclBasic.c:2145)
==5975== by 0x806A065: TclEvalObjvInternal (tclBasic.c:3689)
==5975==
==5975==
==5975== 136 (24 direct, 112 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 4
==5975== at 0x40053C0: malloc (vg_replace_malloc.c:149)
==5975== by 0x815B8FC: TclpAlloc (tclAlloc.c:708)
==5975== by 0x8071478: Tcl_Alloc (tclCkalloc.c:1046)
==5975== by 0x8108EF8: Tcl_DuplicateObj (tclObj.c:1522)
==5975== by 0x80606FA: TestconcatobjCmd (tclTest.c:7127)
==5975== by 0x8068278: TclInvokeStringCommand (tclBasic.c:2145)
==5975== by 0x806A065: TclEvalObjvInternal (tclBasic.c:3689)
==5975== by 0x80C322D: TclExecuteByteCode (tclExecute.c:2327)
==5975==
==5975==
==5975== 28 bytes in 1 blocks are indirectly lost in loss record 4 of 4
==5975== at 0x40053C0: malloc (vg_replace_malloc.c:149)
==5975== by 0x815B8FC: TclpAlloc (tclAlloc.c:708)
==5975== by 0x807152A: Tcl_AttemptAlloc (tclCkalloc.c:1098)
==5975== by 0x80F8396: NewListIntRep (tclListObj.c:94)
==5975== by 0x80F9F29: SetListFromAny (tclListObj.c:1750)
==5975== by 0x80F8C7F: Tcl_ListObjLength (tclListObj.c:730)
==5975== by 0x8060678: TestconcatobjCmd (tclTest.c:7109)
==5975== by 0x8068278: TclInvokeStringCommand (tclBasic.c:2145)
==5975==

Discussion

  • Donal K. Fellows

    Ugly code in that function! Hacky cleanup code added. Don't look at the idioms! (Fixed on 8.5 and 8.6.)

     
  • Donal K. Fellows

    • assigned_to: msofer --> dkf
    • status: open --> closed-fixed