Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-07-13
09:20 • Closed ticket [1811706fff]: Memory Leak, caused in Tcl_DeleteInterp plus 6 o... artifact: ce9d836804 user: sf-robot
2008-06-28
20:48 • Pending ticket [1811706fff]. artifact: 2e076a797e user: msofer
2008-01-12
20:25 • Ticket [1811706fff]: 4 changes artifact: 9f8d889c56 user: msofer
2007-10-14
23:18 • Ticket [1811706fff]: 4 changes artifact: 332174b28e user: nobody
01:33 • Ticket [1811706fff]: 4 changes artifact: 93a829aa46 user: nobody
01:28 • Ticket [1811706fff]: 4 changes artifact: 5800265971 user: nobody
2007-10-12
01:21 • Ticket [1811706fff]: 4 changes artifact: 8050f726f1 user: nobody
00:34 • Ticket [1811706fff]: 4 changes artifact: 4e54d2ca24 user: nobody
00:23 • Ticket [1811706fff]: 1 change artifact: f646ee7716 user: msofer
00:22 • Open ticket [1811706fff]. artifact: 8b047a38bc user: msofer
00:21 • Ticket [1811706fff]: 4 changes artifact: 6977aa63c1 user: msofer
00:15 • Pending ticket [1811706fff]. artifact: d78b140aee user: msofer
00:06 • Ticket [1811706fff]: 4 changes artifact: 57fd944bd3 user: nobody
2007-10-11
17:04 • New ticket [1811706fff]. artifact: f27935763b user: nobody

Memory Leak, caused in Tcl_DeleteInterp

Closed1811706fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 18 years ago
Descriptionplain2007-10-11 17:04:55
Hey,

could you please take a look at the implementation of TCP_DeleteInterp?

It causes a memory leak of 34 bytes here,
if you wish i could post the valgrind leakcheck full!


Kind Regards
Daniel
[email protected]plain2007-10-12 00:06:28
Logged In: NO 

sorry, i was talking about TCL_DeleteInterp of course, and the Version where the problem occurs is 8.5b1.

Thank you!
msoferplain2007-10-12 00:15:58
Logged In: YES 
user_id=148712
Originator: NO

We may need to interact on this one ... please open a new ticket after logging in (so that you get auto email when the ticket is updated, and so that you can attach files if needed).

Please specify what script was being run, whether any C extensions are loaded in the interp, whether those are "definite" leaks or "still reachable", and the stack trace (10-deep is plenty) where the mem was allocated. Thank you.
msoferplain2007-10-12 00:21:24
Logged In: YES 
user_id=148712
Originator: NO

Ahhh ... is it this?

==15810== 156 (36 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 1 of 4
==15810==    at 0x4021620: malloc (vg_replace_malloc.c:149)
==15810==    by 0x413D687: (within /lib/tls/i686/cmov/libc-2.5.so)
==15810==    by 0x413DED5: __nss_database_lookup (in /lib/tls/i686/cmov/libc-2.5.so)
==15810==    by 0x42E7EEB: ???
==15810==    by 0x42E905C: ???
==15810==    by 0x40EBE82: getpwuid_r (in /lib/tls/i686/cmov/libc-2.5.so)
==15810==    by 0x40EB867: getpwuid (in /lib/tls/i686/cmov/libc-2.5.so)
==15810==    by 0x81107AC: TclpGetPwUid (in /home/CVS/tcl_SF_clean/unix/tcltest)
==15810==    by 0x810FBBD: TclpSetVariables (in /home/CVS/tcl_SF_clean/unix/tcltest)
==15810==    by 0x8068DEA: Tcl_CreateInterp (in /home/CVS/tcl_SF_clean/unix/tcltest)
msofer Open ticket [1811706fff]. [History diff]2007-10-12 00:22:27
msofer Ticket [1811706fff]: 1 change [History diff]2007-10-12 00:23:28
[email protected]plain2007-10-12 00:34:54
Logged In: NO 

hey, i think so, that looks like it might be it.

Should I reopen a ticket with a signed up account?

If you want I can post my valgrind log as well!
nobodyplain2007-10-12 01:21:58
Logged In: NO 

I've tried with several tools to monitor for a leak, and looked at the code too.  I think this is probably either a bug in libc/glibc, or Valgrind.

I've tested this repeatedly and the process doesn't grow beyond a certain amount after a while.  I tested with single threaded, and --enable-threads builds of the Tcl HEAD from today.  I also can't duplicate the problem with the latest release of Valgrind.

/lib/libc.so.6 reports
GNU C Library stable release version 2.5

while 1 {
 interp create slave
 interp delete slave
}

-GPS
[email protected]plain2007-10-14 01:28:11
Logged In: NO 

Well I dont think that its a problem with GCC or Valgrind.

I have tried compiling the same thing on a windows machine, and checked for memory leaks with Boundschecker....Same result:

See this screenshot:
http://img99.imageshack.us/img99/3936/leaksw8.jpg
[email protected]plain2007-10-14 01:33:11
Logged In: NO 

...but for some reason the memory leak is 9KB+ on a windows machine, and not just 36 bytes :(
[email protected]plain2007-10-14 23:18:15
Logged In: NO 

i think I will have to fix them
im pulling the current HEAD and then I will close the leaks.

its very annoying and we really need to embed TCL in our application.


Daniel
msoferplain2008-01-12 20:25:59
Logged In: YES 
user_id=148712
Originator: NO

Daniel: any news on this? Did you find out where the problem is, and how to fix it?

The leak seems to be there at program exit, so it will be collected by the OS in the non-embedded case, as well as the case where the embedded interp dies at the end of the embedding program. It will be a problem if the embedding prog repeatedly initializes/terminates the embedded interp.
msofer Pending ticket [1811706fff]. [History diff]2008-06-28 20:48:01
sf-robotplain2008-07-13 09:20:22
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Log in (anonymous is fine) to add a comment.