Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4430 leaking two hashtables and some data in tclObj.c

obsolete: 8.5.7
closed-fixed
9
2009-10-07
2009-10-02
Joe Mistachkin
No

The lineCLPtr hashtable structure is being leaked. The entire objThreadMap hashtable and its contained data are also being leaked.

This bug also applies to the 8.5 branch.

Discussion

  • Can you describe the code path you are considering ?
    Are you calling Tcl_Exit or Tcl_Finalize ?
    Remember that since the exit reform of 2001201, Tcl_Exit only calls the finalizer of the calling thread. Another way of missing a finalizer in Tcl_Exit, even if no extra threads are created, is the test on currentAppExitPtr. Can you say which scenario you are reporting ?

     
  • Joe Mistachkin
    Joe Mistachkin
    2009-10-04

     
  • Joe Mistachkin
    Joe Mistachkin
    2009-10-04

     
    Attachments
  • Joe Mistachkin
    Joe Mistachkin
    2009-10-04

    Attached initial patch. Sorry for the previous blank comment, SF UI is acting weird.

     
  • Joe Mistachkin
    Joe Mistachkin
    2009-10-06

    • milestone: 897381 --> obsolete: 8.5.7
     
  • Review patch ... Looks ok, after some thinking.
    Agreed, applies to 8.5 as well. 8.5 actually has the whole TclFinalizeThreadObjects() function missing.

    Patch applies ok, modulo ChangeLog entry.

    I see no test cases however. How can I check the leak from the testsuite ?

     
  • Applied patch to head and 8.5 branches. Please check in your environ that the leaks are gone.
    My system passes testsuite before and after.

     
    • assigned_to: mistachkin --> andreas_kupries
    • status: open --> closed-fixed
     
  • Joe Mistachkin
    Joe Mistachkin
    2009-10-08

    It would be very hard to duplicate the leaks from the existing test suite since the leaks are per-thread and are only really seen after Tcl_Finalize is called. Just ran my tests here and the leaks appear to be fixed in HEAD. Thanks.

     
  • Joe Mistachkin
    Joe Mistachkin
    2009-10-18

    Corrected some issues with this in both HEAD and core-8-5-branch.