Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0d32e5d1c321345ad1c1c629b6665a4a03b0f3a62f57bb20b3bc4d94ec32e14c
Ticket: fb2a411b91973d3b6d9d10d434b368a677289978
tclZipfs.c exit handlers don't deallocate allocated storage.
User & Date: pooryorick on 2021-05-14 20:29:27
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    Up to at least commit [45fa0ff557cfdb12], tclZipfs.c exit handlers don't
    deallocate allocated storage.  The command,
    
    <code><verbatim>
    make TESTFLAGS='-file zipfs.test' valgrind
    </verbatim></code>
    
    , produces the following results:
    
    <code><verbatim>
    zipfs.test
    
    Tests ended at Fri May 14 23:20:09 EEST 2021
    all.tcl:	Total	48	Passed	37	Skipped	11	Failed	0
    Sourced 1 Test Files.
    Number of tests skipped for each constraint:
    	11	zipfslib
    --446328-- Discarding syms at 0x5830550-0x583617c in /usr/lib/libnss_files-2.33.so (have_dinfo 1)
    ==446328== 
    ==446328== HEAP SUMMARY:
    ==446328==     in use at exit: 518 bytes in 2 blocks
    ==446328==   total heap usage: 344,223 allocs, 344,221 frees, 88,414,723 bytes allocated
    ==446328== 
    ==446328== Searching for pointers to 2 not-freed blocks
    ==446328== Checked 151,904 bytes
    ==446328== 
    ==446328== 6 bytes in 1 blocks are still reachable in loss record 1 of 2
    ==446328==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
    ==446328==    by 0x488C464: TclpAlloc (tclAlloc.c:699)
    ==446328==    by 0x48A89FE: Tcl_Alloc (tclCkalloc.c:1054)
    ==446328==    by 0x4A34950: ZipfsSetup (tclZipfs.c:1853)
    ==446328==    by 0x4A3C176: TclZipfs_Init (tclZipfs.c:5655)
    ==446328==    by 0x4A3C553: TclZipfs_AppHook (tclZipfs.c:5773)
    ==446328==    by 0x10A38A: main (tclAppInit.c:88)
    ==446328== 
    ==446328== 512 bytes in 1 blocks are still reachable in loss record 2 of 2
    ==446328==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
    ==446328==    by 0x488C464: TclpAlloc (tclAlloc.c:699)
    ==446328==    by 0x48A89FE: Tcl_Alloc (tclCkalloc.c:1054)
    ==446328==    by 0x499CC7C: RebuildTable (tclHash.c:1022)
    ==446328==    by 0x499C2D9: CreateHashEntry (tclHash.c:368)
    ==446328==    by 0x4A344AD: ZipFSCatalogFilesystem (tclZipfs.c:1755)
    ==446328==    by 0x4A34C3B: TclZipfs_Mount (tclZipfs.c:2016)
    ==446328==    by 0x4A3522A: ZipFSMountObjCmd (tclZipfs.c:2243)
    ==446328==    by 0x4899194: Dispatch (tclBasic.c:4817)
    ==446328==    by 0x489921A: TclNRRunCallbacks (tclBasic.c:4857)
    ==446328==    by 0x4898ADC: Tcl_EvalObjv (tclBasic.c:4576)
    ==446328==    by 0x489B1AF: TclEvalEx (tclBasic.c:5728)
    ==446328==    by 0x49C60E8: Tcl_FSEvalFileEx (tclIOUtil.c:1782)
    ==446328==    by 0x49D4BFD: Tcl_MainEx (tclMain.c:399)
    ==446328==    by 0x10A3B4: main (tclAppInit.c:91)
    ==446328== 
    ==446328== LEAK SUMMARY:
    ==446328==    definitely lost: 0 bytes in 0 blocks
    ==446328==    indirectly lost: 0 bytes in 0 blocks
    ==446328==      possibly lost: 0 bytes in 0 blocks
    ==446328==    still reachable: 518 bytes in 2 blocks
    ==446328==         suppressed: 0 bytes in 0 blocks
    ==446328== 
    ==446328== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
    </code></verbatim>
    
  5. is_private changed to: "0"
  6. login: "pooryorick"
  7. priority changed to: "5 Medium"
  8. resolution changed to: "None"
  9. severity changed to: "Important"
  10. status changed to: "Open"
  11. submitter changed to: "pooryorick"
  12. subsystem changed to: "- New Builtin Commands"
  13. title changed to:
    tclZipfs.c exit handlers don't deallocate allocated storage.
    
  14. type changed to: "Bug"