Skip to content
Tcl Source Code View Ticket
Login

View Ticket

leaking two hashtables and some data in tclObj.c

Closed / Fixed2871908fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2009-10-02 16:59:45
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.
ferrieuxplain2009-10-03 02:57:54
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 ?
mistachkin Ticket [2871908fff]: 4 changes [History diff]2009-10-05 04:44:33
mistachkinplain2009-10-05 04:45:46
File Added - 345329: leaks.diff
mistachkinplain2009-10-05 04:46:50
Attached initial patch.  Sorry for the previous blank comment, SF UI is acting weird.
mistachkin Ticket [2871908fff]: 1 change [History diff]2009-10-06 10:03:44
andreas_kupriesplain2009-10-08 05:43:53
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 ?
andreas_kupriesplain2009-10-08 06:12:32
allow_comments - 1

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.
mistachkinplain2009-10-09 03:31:47
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.
mistachkinplain2009-10-18 18:23:16
Corrected some issues with this in both HEAD and core-8-5-branch.
Log in (anonymous is fine) to add a comment.

Attachments: