Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6ef28da950ddb0f1e111846c67032cf1595538802337b9ff53fced1433f6850e
Ticket: c58729527114216540ced9f26d1e3afd602f9410
Valgrind shows small memory leak after TIP 720 merge
User & Date: apnadkarni on 2025-05-27 03:29:32
Changes

  1. assignee changed to: "dkf"
  2. icomment:
    A proposed fix for the leak in TclCompileTryCmd is in the [bug-c587295271-trycompile-leak] branch. This seems to fix the error.test leaks.
    
    However, assemble.test (see below) still shows a separate leak. I'm not sure where the AllocJumptable call at tclAssembly.c:1514 is supposed to have a matching free, both for error and success cases.
    
    Volunteering @dkf for a fix :-)
    
    ==3567== 104 bytes in 1 blocks are definitely lost in loss record 6 of 10
    ==3567==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==3567==    by 0x488EC2A: TclpAlloc (tclAlloc.c:700)
    ==3567==    by 0x48AE3C1: Tcl_Alloc (tclCkalloc.c:1035)
    ==3567==    by 0x4890E05: AllocJumptable (tclCompile.h:1134)
    ==3567==    by 0x4892D0A: AssembleOneLine (tclAssembly.c:1514)
    ==3567==    by 0x4891CBA: TclAssembleCode (tclAssembly.c:1059)
    ==3567==    by 0x4891A78: TclCompileAssembleCmd (tclAssembly.c:943)
    ==3567==    by 0x49320B0: TclAttemptCompileProc (tclEnsemble.c:3353)
    ==3567==    by 0x490D1B6: CompileCmdCompileProc (tclCompile.c:2252)
    ==3567==    by 0x490D694: CompileCommandTokens (tclCompile.c:2382)
    ==3567==    by 0x490DB8B: TclCompileScript (tclCompile.c:2568)
    ==3567==    by 0x490B52B: TclSetByteCodeFromAny (tclCompile.c:1143)
    ==3567==    by 0x4939053: TclCompileObj (tclExecute.c:1790)
    ==3567==    by 0x48A1453: TclNREvalObjEx (tclBasic.c:6235)
    ==3567==    by 0x48C11D6: TclNRCatchObjCmd (tclCmdAH.c:195)
    ==3567==    by 0x489E179: Dispatch (tclBasic.c:4639)
    ==3567==    by 0x489E1E1: TclNRRunCallbacks (tclBasic.c:4655)
    ==3567==    by 0x489DA3C: Tcl_EvalObjv (tclBasic.c:4394)
    ==3567==    by 0x48A03E9: TclEvalEx (tclBasic.c:5494)
    ==3567==    by 0x498B7DC: Tcl_FSEvalFileEx (tclIOUtil.c:1792)
    ==3567==    by 0x499FFC5: Tcl_MainEx (tclMain.c:404)
    ==3567==    by 0x10B63B: main (tclAppInit.c:94)
    
  3. login: "apnadkarni"
  4. mimetype: "text/x-fossil-plain"