Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b3029448b25c9d071ec6b8c48b78c5d359cb7fb7
Ticket: 3400944fffffffffffffffffffffffffffffffff
[exit] creates leaks
User & Date: dgp on 2011-08-30 18:25:04
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    Even using the special support for valgrind
    (see 2919042) testing any script with [exit]
    in it is going to show leaks of things that would
    be freed by the natural unwinding that the [exit]
    prevents.  For example,
    
    $ cat leak.tcl
    namespace eval foo exit
    
    $ valgrind --leak-check=yes ./tclsh leak.tcl
    ...
    ==13495== 36 bytes in 3 blocks are definitely lost in loss record 40 of 50
    ==13495==    at 0x4005903: malloc (vg_replace_malloc.c:195)
    ==13495==    by 0x80DF060: TclpAlloc (tclAlloc.c:705)
    ==13495==    by 0x80EF8C0: Tcl_Alloc (tclCkalloc.c:1046)
    ==13495==    by 0x80E630A: TclArgumentEnter (tclBasic.c:5473)
    ==13495==    by 0x80E5E98: TclEvalEx (tclBasic.c:5213)
    ==13495==    by 0x80E54BE: Tcl_EvalEx (tclBasic.c:4872)
    ==13495==    by 0x806D584: Tcl_FSEvalFileEx (tclIOUtil.c:1751)
    ==13495==    by 0x8072F0F: Tcl_MainEx (tclMain.c:407)
    ==13495==    by 0x8073573: Tcl_Main (tclMain.c:634)
    ==13495==    by 0x805465B: main (tclAppInit.c:84)
    ==13495==
    ==13495== 201 (48 direct, 153 indirect) bytes in 2 blocks are definitely lost in loss record 47 of 50
    ==13495==    at 0x4005903: malloc (vg_replace_malloc.c:195)
    ==13495==    by 0x80DF060: TclpAlloc (tclAlloc.c:705)
    ==13495==    by 0x80EF8C0: Tcl_Alloc (tclCkalloc.c:1046)
    ==13495==    by 0x808ED07: Tcl_NewStringObj (tclStringObj.c:340)
    ==13495==    by 0x80817A3: TclSubstTokens (tclParse.c:2337)
    ==13495==    by 0x80E5A63: TclEvalEx (tclBasic.c:5101)
    ==13495==    by 0x80E54BE: Tcl_EvalEx (tclBasic.c:4872)
    ==13495==    by 0x806D584: Tcl_FSEvalFileEx (tclIOUtil.c:1751)
    ==13495==    by 0x8072F0F: Tcl_MainEx (tclMain.c:407)
    ==13495==    by 0x8073573: Tcl_Main (tclMain.c:634)
    ==13495==    by 0x805465B: main (tclAppInit.c:84)
    
    The same issue is present using [testthread exit].
    
  4. foundin changed to: "obsolete: 8.6b2"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "dgp"
  10. subsystem changed to: "41. Memory Allocation"
  11. title changed to: "[exit] creates leaks"
  12. type changed to: "Bug"