Skip to content
Tcl Source Code View Ticket
Login

View Ticket

C multithreaded program using TCL_interp leaks memory

Closed / Fixed1075378fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-11-29 16:55:33
The attached  C program worked fine with tcl8.4.6.
Testing against tcl8.4.7, tcl8.4.8 and cvs trunk it
leaks a lot of memory. I've tested it with the same
results on Linux (Debian Woody) and sparc Solaris 2.8.
The configure invocation was:
./configure --enable-threads --enable-shared


The test program tries to source a script called
test.tcl and evaluates a procedure on that script. It's
enough an script like this:

cat test.tcl

proc test {
  set varA 1
  set varB 2
}

Once compiled, the program can be executed :
./tclleak 5 1000 (for example)
With tcl8.4.6 it only takes 4Mb of maximum memory, with
tcl8.4.7 and higher versions, it takes more than 150Mb.
mteiraplain2004-11-29 23:55:33
File Added - 110561: tclleak.c
mteira Ticket [1075378fff]: 1 change [History diff]2004-11-29 23:56:17
davygrvyplain2004-11-30 01:10:07
Logged In: YES 
user_id=7549

lacking Tcl_FinalizeThread in thFunction().
lacking Tcl_FindExecutable() and Tcl_Finalize() in main().
davygrvyplain2004-11-30 01:14:17
Logged In: YES 
user_id=7549

whoop.. n/m..  missed seeing Tcl_FinalizeThread
msoferplain2005-05-18 21:48:02
Logged In: YES 
user_id=148712

Dave: should this ticket be closed as invalid?
hobbsplain2005-05-31 09:24:59
Logged In: YES 
user_id=72656

Zoran - is this related to your recent fix?
vasiljevicplain2005-05-31 14:03:51
Logged In: YES 
user_id=95086

It is. You can safely close this one.
vasiljevic Closed ticket [1075378fff]. [History diff]2005-05-31 14:06:56
Log in (anonymous is fine) to add a comment.

Attachments: