Skip to content
Tcl Source Code History Of Ticket c7d0bc9a549714e0
Login

History Of Ticket c7d0bc9a549714e0

Artifacts Associated With Ticket c7d0bc9a549714e0

  1. Ticket change [d39da93dea] (rid 148783) by mr_calvin on 2016-09-15 10:41:54:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      The recently applied changes in response to http://core.tcl.tk/tcl/tktview?name=d4e7780ca1 open up a Tcl_Obj leak because refcounting was not adjusted accordingly, e.g.:
      
      ==28916== 93 (48 direct, 45 indirect) bytes in 1 blocks are definitely lost in loss record 35 of 64
      ==28916==    at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
      ==28916==    by 0x50ED4F2: TclpAlloc (tclAlloc.c:699)
      ==28916==    by 0x5104DDC: Tcl_Alloc (tclCkalloc.c:1059)
      ==28916==    by 0x521525E: TclCreateLiteral (tclLiteral.c:236)
      ==28916==    by 0x52155F9: TclRegisterLiteral (tclLiteral.c:445)
      ==28916==    by 0x51A0F99: CompileCmdLiteral (tclCompile.c:1794)
      ==28916==    by 0x51A1242: TclCompileInvocation (tclCompile.c:1814)
      ==28916==    by 0x51A252B: CompileCommandTokens (tclCompile.c:2074)
      ==28916==    by 0x51A2940: TclCompileScript (tclCompile.c:2193)
      ==28916==    by 0x51A3BE6: TclCompileTokens (tclCompile.c:2442)
      ==28916==    by 0x5157AFC: TclCompileNamespaceTailCmd (tclCompCmdsGR.c:2055)
      ==28916==    by 0x51C2F67: TclAttemptCompileProc (tclEnsemble.c:3212)
      
      The literal Tcl_Obj kept being bumped to reflect a global literal reference unconditionally, i.e., even when it is treated as unshared, local-only literal in subsequent steps. The fix is to move Tcl_IncrRefCount(objPtr) further down in TclCreateLiteral(), when it becomes certain that the literal actually becomes global.
      I would also suggest adjusting the in-code comments slightly, to better reflect the modified literal handling.
      
      See attached path for both.
      
    5. foundin initialized to: "core-8-6-branch"
    6. is_private initialized to: "0"
    7. login: "mr_calvin"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "d4d1d8192a46acf2c7d58cddc1040ecdbc9c9d77"
    10. resolution initialized to: "None"
    11. severity initialized to: "Critical"
    12. status initialized to: "Open"
    13. submitter initialized to: "mr_calvin"
    14. subsystem initialized to: "45. Parsing and Eval"
    15. title initialized to:
      Newly introduced unshared (local-only) literals from cmd resolvers cause Tcl_Obj leaks
      
    16. type initialized to: "Bug"
  2. Add attachment "unsharedLiteral.patch" [2f7cc1858e] (rid 148784) by mr_calvin on 2016-09-15 10:42:12.

  3. Ticket change [5ba697742f] (rid 148785) by mr_calvin on 2016-09-15 10:43:24:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Assigned to Jan, because he also sponsored the original patch.
      
    3. login: "mr_calvin"
    4. mimetype: "text/plain"
  4. Ticket change [be1a07d8a6] (rid 148790) by jan.nijtmans on 2016-09-15 13:27:56:

    1. icomment:
      Proposed fix committed to branch bug-c7d0bc9a549714e0. Appears fully valid to me. Asking feedback from Gustaf Neumann.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [fc61efd0e4] (rid 148792) by gustafn2 on 2016-09-16 07:51:08:

    1. icomment:
      The fix is correct. i did some larger tests (naviserver, valgrind, ...) everything looks ok.
      
    2. login: "gustafn2"
    3. mimetype: "text/plain"
  6. Ticket change [383b9e2aca] (rid 148795) by jan.nijtmans on 2016-09-16 09:09:50:

    1. icomment:
      Fix committed to core-8-6-branch and trunk. In-code oomments not taken into account yet, I'll leave that in the hands of Gustaf. Therefore keeping this ticket open for the moment.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
    4. resolution changed to: "Fixed"
  7. Ticket change [737509a1d5] (rid 148831) by gustafn2 on 2016-09-21 09:08:06:

    1. icomment:
      The modified inline comments reflect the differentiation between global (shared) and unshared literals properly.
      
    2. login: "gustafn2"
    3. mimetype: "text/plain"
  8. Ticket change [f7bcc5e0a6] (rid 148840) by jan.nijtmans on 2016-09-21 09:30:54:

    1. closedate changed to: "2457652.89646866"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Better inline comment handled by "trunk" now. Closing
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"