Artifacts Associated With Ticket 589863ffffffffff
Ticket change [3425326c87] (rid 106707) by msofer on 2002-08-01 23:05:41:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
(make test, -DTCL_MEM_DEBUG): ==== trace-24.5 delete trace during all exec traces except enter FAILED ==== Contents of test case: set info {} trace add execution foo {leave enterstep leavestep} [list traceDelete foo] foo 1 list $info [trace info execution foo] ---- Result was: {{set b 1} entersdep} {} ---- Result should have been (exact matching): {{set b 1} enterstep} {} ==== trace-24.5 FAILED Note the corrupted "entersdep" ... - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "corruption in execution traces?"
- type initialized to: "Bug"
Add attachment "traceErrors" [7233a130b2] (rid 100814) by msofer on 2002-08-06 03:56:25.
Ticket change [8cc8f881ed] (rid 127794) by msofer on 2002-08-06 03:56:25:
- icomment:
File Added - 28470: traceErrors Logged In: YES user_id=148712 There is definitely a memory problem with delete traces; I enclose a summary of the relevant errors detected by valgrind running with -DPURIFY. In particular, it reports a read/write of freed memory in test 24.5
- login: "msofer"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- subsystem changed to: "41. Memory Allocation"
- username: "msofer"
- icomment:
Ticket change [cecc5d1a5a] (rid 96113) by msofer on 2002-08-06 23:45:28:
- assignee changed to: "hobbs"
- icomment:
File Added - 28537: DIFF.UMR Logged In: YES user_id=148712 Attached a patch that seems to solve the UMR issue - Jeff, could you confirm this is OK? Wrt the invalid read/write in TclCheckInterpTraces (tclCmdMZ.c:4157): this seems to be the cause of the above corruption, the error is triggered by 24.5 and also by 25.10: after calling the trace procedure, we update the trace flags and set a pointer to the struct. Trouble is, the trace procedure freed the struct's memory. Maybe we should Tcl_Preserve the Trace structure?
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
Add attachment "DIFF.UMR" [dbd1442281] (rid 108024) by msofer on 2002-08-06 23:45:28.
Ticket change [ae7a5aae11] (rid 101645) by dkf on 2002-08-07 19:40:18:
- assignee changed to: "msofer"
- icomment:
Logged In: YES user_id=79902 Looks good to me (or at least definitely not bad!)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [c9ef42e50a] (rid 122374) by msofer on 2002-08-07 22:39:26:
- assignee changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=148712 Vince, can you please take a look at this? Maybe you and/orHemang can help sort it out.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
Ticket change [d6c1637cc8] (rid 123857) by msofer on 2002-08-08 03:45:50:
- icomment:
Logged In: YES user_id=148712 Bug 547534 probably refers to this same problem. dkf's original report is: Yuck. With a recent build of Tcl (not quite the HEAD) I found this: % proc bar {ctx from to op} { puts [incr ::i]:[info level 0] rename $from {} } % proc foo args {} % trace add command foo delete "bar 1" % trace add command foo delete "bar 2" % trace add command foo delete "bar 3" % rename foo {} 1:bar 3 foo {} delete 2:bar 2 foo {} delete 3:bar 1 elete {} delete Looks like there's some memory corruption in there! - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [3ddae7205c] (rid 121167) by msofer on 2002-08-12 19:25:30:
- icomment:
Logged In: YES user_id=148712 Committed the UMR fix to HEAD: "better intitialize to possibly wrong values than using unitialised memory". The read/write of freed memory is still there.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [6468b1b25a] (rid 92764) by hemanglavana on 2002-08-22 21:53:17:
- icomment:
Logged In: YES user_id=81875 The upload button doesn't show up on my browser, so I am attaching the patch here. Please verify whether it resolves the memory problem or not. Index: tclBasic.c =================================================================== RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v retrieving revision 1.68 diff -r1.68 tclBasic.c 5026c5026 < ckfree( (char*) tracePtr ); --- > Tcl_EventuallyFree( (char*) tracePtr, TCL_DYNAMIC); Index: tclCmdMZ.c =================================================================== RCS file: /cvsroot/tcl/tcl/generic/tclCmdMZ.c,v retrieving revision 1.75 diff -r1.75 tclCmdMZ.c 4137a4138,4145 > /* > * The proc invoked might delete the traced command which > * which might try to free tracePtr. We want to use tracePtr > * until the end of this if section, so we use > * Tcl_Preserve() and Tcl_Release() to be sure it is not > * freed while we still need it. > */ > Tcl_Preserve((ClientData) tracePtr); 4159a4168 > Tcl_Release((ClientData) tracePtr);
- login: "hemanglavana"
- mimetype: "text/plain"
- username: "hemanglavana"
- icomment:
Ticket change [d23d4368f1] (rid 113499) by msofer on 2002-08-22 22:59:29:
- assignee changed to: "msofer"
- closedate changed to: "2002-08-22T15:59:29"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Yes, the patch fixes the issue. Already committed, thanks Hemang!
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "msofer"
Ticket change [c99d5d19cf] (rid 122318) by hemanglavana on 2002-08-28 00:40:05:
- icomment:
Logged In: YES user_id=81875 The upload button doesn't show up on my browser, so I am attaching the patch here. Please verify whether it resolves the memory problem or not. Index: tclBasic.c =================================================================== RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v retrieving revision 1.68 diff -r1.68 tclBasic.c 5026c5026 < ckfree( (char*) tracePtr ); --- > Tcl_EventuallyFree( (char*) tracePtr, TCL_DYNAMIC); Index: tclCmdMZ.c =================================================================== RCS file: /cvsroot/tcl/tcl/generic/tclCmdMZ.c,v retrieving revision 1.75 diff -r1.75 tclCmdMZ.c 4137a4138,4145 > /* > * The proc invoked might delete the traced command which > * which might try to free tracePtr. We want to use tracePtr > * until the end of this if section, so we use > * Tcl_Preserve() and Tcl_Release() to be sure it is not > * freed while we still need it. > */ > Tcl_Preserve((ClientData) tracePtr); 4159a4168 > Tcl_Release((ClientData) tracePtr);
- login: "hemanglavana"
- mimetype: "text/plain"
- username: "hemanglavana"
- icomment: