Skip to content
Tcl Source Code History Of Ticket 275db3d985
Login

History Of Ticket 275db3d985

Artifacts Associated With Ticket 275db3d985

  1. Ticket change [e0212174de] (rid 252721) by apnadkarni on 2026-04-13 06:26:35:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      Valgrind shows the following error on trunk
      
      ```
      ==116613== HEAP SUMMARY:
      ==116613==     in use at exit: 753 bytes in 1 blocks
      ==116613==   total heap usage: 483,621 allocs, 483,620 frees, 55,033,094 bytes allocated
      ==116613==
      ==116613== Searching for pointers to 1 not-freed blocks
      ==116613== Checked 140,904 bytes
      ==116613==
      ==116613== 753 bytes in 1 blocks are definitely lost in loss record 1 of 1
      ==116613==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==116613==    by 0x489FC16: TclpAlloc (tclAlloc.c:700)
      ==116613==    by 0x48BFB4C: Tcl_Alloc (tclCkalloc.c:1035)
      ==116613==    by 0x4A06360: Tcl_DStringSetLength (tclUtil.c:2873)
      ==116613==    by 0x4A1FA2A: ZipFSCatalogFilesystem (tclZipfs.c:2143)
      ==116613==    by 0x4A203A0: TclZipfs_Mount (tclZipfs.c:2437)
      ==116613==    by 0x4A20B6F: ZipFSMountObjCmd (tclZipfs.c:2681)
      ==116613==    by 0x48AF5FA: Dispatch (tclBasic.c:4637)
      ==116613==    by 0x48AF662: TclNRRunCallbacks (tclBasic.c:4653)
      ==116613==    by 0x48AEEAE: Tcl_EvalObjv (tclBasic.c:4391)
      ==116613==    by 0x48B188B: TclEvalEx (tclBasic.c:5492)
      ==116613==    by 0x49A33F5: Tcl_FSEvalFileEx (tclIOUtil.c:1792)
      ==116613==    by 0x49B81BD: Tcl_MainEx (tclMain.c:404)
      ==116613==    by 0x10B63B: main (tclAppInit.c:100)
      ==116613==
      ==116613== LEAK SUMMARY:
      ==116613==    definitely lost: 753 bytes in 1 blocks
      ==116613==    indirectly lost: 0 bytes in 0 blocks
      ==116613==      possibly lost: 0 bytes in 0 blocks
      ==116613==    still reachable: 0 bytes in 0 blocks
      ==116613==         suppressed: 0 bytes in 0 blocks
      ==116613==
      ==116613== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
      ```
      
    5. is_private initialized to: "0"
    6. login: "apnadkarni"
    7. priority initialized to: "5 Medium"
    8. private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
    9. resolution initialized to: "None"
    10. severity initialized to: "Important"
    11. status initialized to: "Open"
    12. submitter initialized to: "apnadkarni"
    13. subsystem initialized to: "- New Builtin Commands"
    14. title initialized to: "Memory leak in zipfs"
    15. type initialized to: "Bug"
  2. Ticket change [f73b69726e] (rid 252722) by apnadkarni on 2026-04-13 06:32:47:

    1. comment changed to:
      Valgrind shows the following error on trunk (but not core-9-0-branch)
      
      ```
      ==116613== HEAP SUMMARY:
      ==116613==     in use at exit: 753 bytes in 1 blocks
      ==116613==   total heap usage: 483,621 allocs, 483,620 frees, 55,033,094 bytes allocated
      ==116613==
      ==116613== Searching for pointers to 1 not-freed blocks
      ==116613== Checked 140,904 bytes
      ==116613==
      ==116613== 753 bytes in 1 blocks are definitely lost in loss record 1 of 1
      ==116613==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==116613==    by 0x489FC16: TclpAlloc (tclAlloc.c:700)
      ==116613==    by 0x48BFB4C: Tcl_Alloc (tclCkalloc.c:1035)
      ==116613==    by 0x4A06360: Tcl_DStringSetLength (tclUtil.c:2873)
      ==116613==    by 0x4A1FA2A: ZipFSCatalogFilesystem (tclZipfs.c:2143)
      ==116613==    by 0x4A203A0: TclZipfs_Mount (tclZipfs.c:2437)
      ==116613==    by 0x4A20B6F: ZipFSMountObjCmd (tclZipfs.c:2681)
      ==116613==    by 0x48AF5FA: Dispatch (tclBasic.c:4637)
      ==116613==    by 0x48AF662: TclNRRunCallbacks (tclBasic.c:4653)
      ==116613==    by 0x48AEEAE: Tcl_EvalObjv (tclBasic.c:4391)
      ==116613==    by 0x48B188B: TclEvalEx (tclBasic.c:5492)
      ==116613==    by 0x49A33F5: Tcl_FSEvalFileEx (tclIOUtil.c:1792)
      ==116613==    by 0x49B81BD: Tcl_MainEx (tclMain.c:404)
      ==116613==    by 0x10B63B: main (tclAppInit.c:100)
      ==116613==
      ==116613== LEAK SUMMARY:
      ==116613==    definitely lost: 753 bytes in 1 blocks
      ==116613==    indirectly lost: 0 bytes in 0 blocks
      ==116613==      possibly lost: 0 bytes in 0 blocks
      ==116613==    still reachable: 0 bytes in 0 blocks
      ==116613==         suppressed: 0 bytes in 0 blocks
      ==116613==
      ==116613== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
      ```
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  3. Ticket change [9757ecafac] (rid 252723) by apnadkarni on 2026-04-13 07:07:35:

    1. icomment:
      Bisect points to [42764583](https://core.tcl-lang.org/tcl/info/427645831a). The change to using `Tcl_ExternalToUtfDStringEx` loses dynamic memory already allocated to the passed `Tcl_DString` (it assumes it is uninitialized and overwrites the fields). I think the original code was optimized to not require reallocation of memory for every file in a zip for long pathnames.
      
      Possible solutions are
      
      1. Revert above commit but I'm unclear as to whether the commit was primarily code reduction or also a bug fix.
      
      2. Call `Tcl_DStringFree` before the call to `Tcl_ExternalToUtfDStringEx` which would be (potentially) a performance hit requiring new memory free/allocation on every zipfs entry (when paths exceeded `Tcl_DString` static size).
      
      3. Modify `Tcl_ExternalToUtfDStringEx` to accept a flag when the output `Tcl_DString` has already been initialized. But requires a TIP.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  4. Ticket change [8518adeb1b] (rid 252755) by apnadkarni on 2026-04-13 17:54:15:

    1. icomment:
      Proposed fix in [bug-275db3d985](https://core.tcl-lang.org/tcl/timeline?r=bug-275db3d985). Went with option 2 for simplicity for reasons note in comments.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  5. Ticket change [4e1a56afba] (rid 252763) by apnadkarni on 2026-04-14 08:20:13:

    1. closedate changed to: "2461144.8473835187"
    2. closer changed to: "apnadkarni"
    3. login: "apnadkarni"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"