Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-08-15
23:05 • Closed ticket [3390272fff]: safe-3.* leaks plus 7 other changes artifact: 7fa4357f71 user: dgp
22:01 • Ticket [3390272fff]: 6 changes artifact: 08ec2a8e1c user: dgp
21:38 • Ticket [3390272fff]: 4 changes artifact: f1ec2376a7 user: dgp
2011-08-12
06:34 • Ticket [3390272fff]: 5 changes artifact: 79532cfa52 user: ferrieux
05:10 • Ticket [3390272fff]: 4 changes artifact: 7c7835c550 user: dgp
2011-08-11
22:06 • New ticket [3390272fff]. artifact: 2c70ca956a user: dgp

safe-3.* leaks

Closed / Fixed3390272fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2011-08-11 22:06:40
Each of the four tests matching safe-3.* leaks
a Tcl_Obj.
dgpplain2011-08-12 05:10:22
Reduced leaking script:

interp create a -safe
safe::interpInit a
safe::interpDelete a
ferrieuxplain2011-08-12 06:34:24
The stack below shows the leaked obj is the interp's objresult, which is juggled/cached with a local named "objResultPtr". Maybe Miguel, having all of TEBCresume's invariants in mind, will be quick to find the code path where that local is improperly overwritten (or not updated when coming out of a recursive call) ?

'==13739== 24 bytes in 1 blocks are definitely lost in loss record 13 of 15
==13739==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==13739==    by 0x402EFB8: TclpAlloc (tclAlloc.c:705)
==13739==    by 0x403F140: Tcl_Alloc (tclCkalloc.c:1046)
==13739==    by 0x40A4BAF: TEBCresume (tclExecute.c:2144)
==13739==    by 0x40343A2: TclNRRunCallbacks (tclBasic.c:4311)
==13739==    by 0x4036635: TclEvalObjEx (tclBasic.c:5882)
==13739==    by 0x40C2D46: SlaveEval (tclInterp.c:2777)
==13739==    by 0x40BFCC3: Tcl_InterpObjCmd (tclInterp.c:826)
==13739==    by 0x4034299: TclNREvalObjv (tclBasic.c:4269)
==13739==    by 0x40A6A41: TEBCresume (tclExecute.c:2793)
==13739==    by 0x40343A2: TclNRRunCallbacks (tclBasic.c:4311)
==13739==    by 0x4033E98: Tcl_EvalObjv (tclBasic.c:4103)
dgpplain2011-08-15 21:38:05
Here's the leak:

interp create a -safe
interp eval a {info script xxx}
dgpplain2011-08-15 22:01:23
interp create slave
slave eval {info script foo}
interp delete slave

"Safe" has nothing to do with it.
dgpplain2011-08-15 23:05:05
allow_comments - 1
Log in (anonymous is fine) to add a comment.