Artifacts Associated With Ticket 402501ffffffffff
Ticket change [c43257defd] (rid 111800) by dgp on 2000-11-24 16:43:28:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to: " "
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: ""
- title initialized to: "Fix for Bug 119393"
- type initialized to: "Patch"
Ticket change [94fc093c7b] (rid 106090) by dgp on 2000-11-25 00:58:31:
- icomment:
This patch has a memory leak, exhibited by the following script: proc Hare {old args} { trace vdelete ::bunny w [list Hare $old] trace variable ::bunny w [list Hare $::bunny] error "FOO" } set bunny Bugs trace variable bunny w [list Hare $bunny] while {1} {catch { set bunny Easter}} - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [5108688449] (rid 126068) by dgp on 2000-11-28 03:51:53:
- icomment:
Looks like the whole TraceVarInfo() routine needs a rewrite. By the requirements of Tcl_TraceVar(), TraceVarInfo() is supposed to return NULL on success, or a pointer to a *static* character string containing an error message on failure. When the trace script returns an error, though, TraceVarInfo is returning the pointer tvarPtr->errMsg, which is dynamically allocated and which assumes the structure *tvarPtr still exists. This means TraceVarInfo() is incapable of properly handling a trace script that both returns an error and deletes the trace, because then there's nowhere for the error message to live.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [1afc952f1a] (rid 123072) by dgp on 2001-02-22 06:50:21:
- subsystem changed to: "18. Commands M-Z"
Ticket change [c4a8951654] (rid 111878) by dkf on 2001-02-27 18:49:43:
- assignee changed to: "dkf"
- title changed to: "Fix for Bug 119393 ([trace remove] & Tcl_Preserve)"
Ticket change [7279c649f3] (rid 100866) by dgp on 2001-02-28 06:05:18:
- icomment:
Logged In: YES user_id=80530 The fix I had in mind for this has two steps. 1. Modify CallTraces() (in generic/tclVar.c) so that it can recognize a special value #define TCL_TRACE_ERROR_MESSAGE_IN_INTERP_RESULT 0x1 returned from a trace procedure as a signal that the error message should be retrieved from Tcl_GetStringResult(interp). That change would require a TIP. 2. Make use of the new interface by having TraceVarInfo() stick error messages in the interp result and return TCL_TRACE_ERROR_MESSAGE_IN_INTERP_RESULT when there is an error in the evaluation of the trace script. Then get rid of the errMsg field in the TraceVarInfo struct. This seems to me to be the safe way to get an error message that is not a static string back to Tcl_TraceVar(). Similar changes/fixes may also be needed in CallCommandTraces(), etc. This approach may go against the RESTRICTIONS section of Tcl_TraceVar(3), though. That section instructs all trace procedures to save and restore interp->result before returning. But why impose that burden on every trace procedure? Why isn't CallTraces() itself saving and restoring the interpreter result?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "trace.patch" [de5adf40b3] (rid 114829) by dgp on 2001-08-23 22:53:10.
Ticket change [80d39b4b38] (rid 116939) by dgp on 2001-08-23 22:53:10:
- icomment:
File Deleted - 2326: File Added - 9898: trace.patch Logged In: YES user_id=80530 Updated patch for current HEAD. It's still the wrong patch for fixing 219393, but it can be useful for testing some things.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [b46d26487e] (rid 125031) by dkf on 2001-11-19 22:27:03:
- icomment:
Logged In: YES user_id=79902 219393 is now fixed, and was fixed by a new API (TIP#68)
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "dkf"
- icomment:
Ticket change [1ad78bdf03] (rid 123046) by dkf on 2001-11-19 22:27:04:
- closedate changed to: "2001-11-19T15:27:04"
- closer changed to: "dkf"