Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-05-16
01:44 • Closed ticket [1716782fff]: valgrind detected memleaks plus 7 other changes artifact: d7dd6ac1d0 user: dgp
00:15 • Ticket [1716782fff]: 4 changes artifact: dd24945cc9 user: dgp
2007-05-10
20:58 • New ticket [1716782fff]. artifact: b9f7e71499 user: dgp

valgrind detected memleaks

Closed / Fixed1716782fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2007-05-10 20:58:26
taking the same valgrind
scripts recently run on the
HEAD, and running them on
core-8-4-branch I see two
leaks reported:

Leak #1
  0:  malloc (vg_replace_malloc.c:149)
  1:  TclpAlloc (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  2:  Tcl_Alloc (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  3:  AllocStringEntry (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  4:  Tcl_CreateHashEntry (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  5:  TclLookupSimpleVar (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  6:  TclLookupVar (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  7:  Tcl_SetVar2Ex (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  8:  TclTeardownNamespace (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  9:  DeleteInterpProc (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
-- autoMkindex.test: ==17708== 3,536 (1,706 direct, 1,830 indirect) bytes in 8 blocks are definitely lost in loss record 3 of 4

Leak #2
  0:  malloc (vg_replace_malloc.c:149)
  1:  TclpAlloc (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  2:  Tcl_Alloc (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  3:  Tcl_CreateNamespace (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  4:  Tcl_CreateInterp (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  5:  SlaveCreate (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  6:  Tcl_InterpObjCmd (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  7:  TclEvalObjvInternal (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  8:  Tcl_EvalEx (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
  9:  Tcl_EvalObjEx (in /home/dgp/cvs/tcl8.4/unix/libtcl8.4.so)
-- basic.test: ==17709== 550 (240 direct, 310 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 4
-- namespace.test: ==18182== 1,867 (960 direct, 907 indirect) bytes in 4 blocks are definitely lost in loss record 3 of 4
dgpplain2007-05-16 00:15:57
Logged In: YES 
user_id=80530
Originator: YES


Leak #2 is a leak of the global
namespace of an interp when
the interp is deleted after
a [namspace delete ::].  These
scripts demo:

interp create slave
slave eval namespace delete ::
interp delete slave
proc exit args {}

and

namespace delete ::
proc exit args {}
dgpplain2007-05-16 01:44:49
Logged In: YES 
user_id=80530
Originator: YES


fix for leak # 2 committed for 8.4.15

Re-testing after that change show no
more leaks.
Log in (anonymous is fine) to add a comment.