Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-23
03:12 • Ticket [218837ffff] Memory leaks in Tcl8.1.1 status still Closed with 3 othe... artifact: 0656e6fed1 user: dgp
2000-10-26
08:30 • Closed ticket [218837ffff]. artifact: c322ca20ec user: welch
01:06 • New ticket [218837ffff]. artifact: dbc5588bde user: nobody

Memory leaks in Tcl8.1.1

Closed / Fixed218837ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:06:23
OriginalBugID: 2324 Bug
Version: 8.1.1
SubmitDate: '1999-07-06'
LastModified: '1999-10-21'
Severity: SER
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Solaris
OSVersion: 5.6 with Sun Workshop Compiler C 4.2
Machine: Other
FixedDate: '1999-10-21'
FixedInVersion: 8.2.2
ClosedDate: '2000-10-25'


Name:
Prasad A. Chodavarapu

Extensions:
none

CustomShell:
none

ReproducibleScript:
We have run purify on our multi-thread application that contains
    embedded Tcl Interpreters. I am attaching relevant poryions of purify
    log that talk about memory leaks in Tcl.

ObservedBehavior:
MLK: 800 bytes leaked at 0x2dfc78
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            Tcl_DeleteFileHandler [tclLoadDl.c]
            Tcl_ReadChars  [tclLoadDl.c]
            Tcl_EvalFile   [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
    
    MLK: 364 bytes leaked at 0x2b3360
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            CompileRegexp  [tclRegexp.c]
            Tcl_GetRegExpFromObj [tclLoadDl.c]
            Tcl_RegexpObjCmd [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
    
    MLK: 240 bytes leaked in 2 blocks
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_CreateChannel [tclLoadDl.c]
            Tcl_MakeFileChannel [tclLoadDl.c]
            TclpGetDefaultStdChannel [tclLoadDl.c]
            Tcl_GetStdChannel [tclLoadDl.c]
            Tcl_GetChannel [tclLoadDl.c]
      * Block of 120 bytes (2 times); last block at 0x4cb528
    
    MLK: 120 bytes leaked at 0x2b1298
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_CreateChannel [tclLoadDl.c]
            Tcl_MakeFileChannel [tclLoadDl.c]
            TclpGetDefaultStdChannel [tclLoadDl.c]
            Tcl_GetStdChannel [tclLoadDl.c]
            GetChannelTable [tclIO.c]
    
    MLK: 4 bytes leaked at 0x2e10f8
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
            Tcl_EvalObjEx  [tclLoadDl.c]
            TclObjInterpProc [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
    
    MLK: 4 bytes leaked at 0xc2a98
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            TclpOpenFileChannel [tclLoadDl.c]
            Tcl_OpenFileChannel [tclLoadDl.c]
            OpenEncodingFile [tclEncoding.c]
            LoadEncodingFile [tclEncoding.c]
    
    PLK: 4704 bytes potentially leaked in 2 blocks
      * This memory was allocated from:
            malloc         [rtlib.o]
            TclReComp      [tclLoadDl.c]
            CompileRegexp  [tclRegexp.c]
            Tcl_GetRegExpFromObj [tclLoadDl.c]
            Tcl_RegexpObjCmd [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
      * Block of 2352 bytes (2 times); last block at 0x2c1d98
    
    MLK: 88 bytes leaked in 2 blocks
      * This memory was allocated from:
            malloc         [rtlib.o]
            CompileRegexp  [tclRegexp.c]
            Tcl_GetRegExpFromObj [tclLoadDl.c]
            Tcl_RegexpObjCmd [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
            Tcl_EvalObjEx  [tclLoadDl.c]
      * Block of 44 bytes (2 times); last block at 0x2b35b0
    
    MLK: 84 bytes leaked in 3 blocks
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            InitTimer      [tclTimer.c]
            Tcl_DeleteTimerHandler [tclLoadDl.c]
            CloseChannel   [tclIO.c]
            FlushChannel   [tclIO.c]
      * Block of 28 bytes (3 times); last block at 0x2c9a48
    
    MLK: 64 bytes leaked in 2 blocks
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            Tcl_CreateChannel [tclLoadDl.c]
            TclpOpenFileChannel [tclLoadDl.c]
            Tcl_OpenFileChannel [tclLoadDl.c]
            Tcl_EvalFile   [tclLoadDl.c]
      * Block of 32 bytes (2 times); last block at 0x2c8ce0
    
    MLK: 36 bytes leaked in 3 blocks
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_CreateThreadExitHandler [tclLoadDl.c]
            InitTimer      [tclTimer.c]
            Tcl_DeleteTimerHandler [tclLoadDl.c]
            CloseChannel   [tclIO.c]
            FlushChannel   [tclIO.c]
      * Block of 12 bytes (3 times); last block at 0x2b0458
    
    MLK: 32 bytes leaked at 0x60b8c0
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            Tcl_GetStdChannel [tclLoadDl.c]
            Tcl_GetChannel [tclLoadDl.c]
            Tcl_PutsObjCmd [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
    
    MLK: 32 bytes leaked in 2 blocks
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_MakeFileChannel [tclLoadDl.c]
            TclpGetDefaultStdChannel [tclLoadDl.c]
            Tcl_GetStdChannel [tclLoadDl.c]
            Tcl_GetChannel [tclLoadDl.c]
            Tcl_PutsObjCmd [tclLoadDl.c]
      * Block of 16 bytes (2 times); last block at 0x53d2d8
    
    MLK: 32 bytes leaked at 0xc14d0
      * This memory was allocated from:
            malloc         [rtlib.o]
            _alloc_attr    [libthread.so.1]
            pthread_attr_init [libthread.so.1]
            TclpThreadCreate [tclLoadDl.c]
            Tcl_InitNotifier [tclLoadDl.c]
            TclInitNotifier [tclLoadDl.c]
    
    MLK: 32 bytes leaked at 0xc0838
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            TclInitSubsystems [tclLoadDl.c]
            Tcl_FindExecutable [tclLoadDl.c]
    
    MLK: 16 bytes leaked at 0x2b10f8
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_MakeFileChannel [tclLoadDl.c]
            TclpGetDefaultStdChannel [tclLoadDl.c]
            Tcl_GetStdChannel [tclLoadDl.c]
            GetChannelTable [tclIO.c]
            Tcl_RegisterChannel [tclLoadDl.c]
    
    MLK: 12 bytes leaked at 0x230120
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_CreateThreadExitHandler [tclLoadDl.c]
            CompileRegexp  [tclRegexp.c]
            Tcl_GetRegExpFromObj [tclLoadDl.c]
            Tcl_RegexpObjCmd [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
    
    MLK: 8 bytes leaked at 0x261c98
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            TclInitSubsystems [tclLoadDl.c]
            Tcl_CreateInterp [tclLoadDl.c]
    
    MLK: 8 bytes leaked at 0x2c8c70
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            TclInExit      [tclLoadDl.c]
            FileCloseProc  [tclUnixChan.c]
            CloseChannel   [tclIO.c]
            FlushChannel   [tclIO.c]
    
    MLK: 8 bytes leaked in 2 blocks
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            TclpOpenFileChannel [tclLoadDl.c]
            Tcl_OpenFileChannel [tclLoadDl.c]
            Tcl_EvalFile   [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
      * Block of 4 bytes (2 times); last block at 0x2ad238
    
    PLK: 4144 bytes potentially leaked at 0x2e1430
      * This memory was allocated from:
            malloc         [rtlib.o]
            AllocChannelBuffer [tclIO.c]
            WriteChars     [tclIO.c]
            Tcl_WriteObj   [tclLoadDl.c]
            Tcl_PutsObjCmd [tclLoadDl.c]
            TclExecuteByteCode [tclLoadDl.c]
    
    PLK: 52 bytes potentially leaked at 0x2dfff0
      * This memory was allocated from:
            malloc         [rtlib.o]
            Tcl_GetThreadData [tclLoadDl.c]
            Tcl_CreateEventSource [tclLoadDl.c]
            InitTimer      [tclTimer.c]
            Tcl_DeleteTimerHandler [tclLoadDl.c]
            CloseChannel   [tclIO.c]

DesiredBehavior:
Some of these leaks might be OK, in that they might be one time things.
    Others might not be so. Also, since Tcl manages its own memory pool, if
    any tricks ar ebeing used, purify might be flustered with those. still,
    these are worth looking into.



I have just finished purifying Tcl on Solaris, and it can now
run through the test suite, threaded or non-threaded, without
a single leak. 
-- 10/21/1999 hobbs
welch Closed ticket [218837ffff]. [History diff]2000-10-26 08:30:13
dgp Ticket [218837ffff]: 3 changes [History diff]2001-04-23 03:12:51
Log in (anonymous is fine) to add a comment.