Artifacts Associated With Ticket 2431847
Ticket change [c14292e5ae] (rid 111290) by andygoth on 2008-12-15 21:57:07:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The script: proc oops {} { dict set array(index) poisonous garbage! catch { dict get $array(index) nonexistent } puts $::errorInfo } oops prints the following: poisonous garbage!key "nonexistent" not known in dictionary while executing "dict get $array(index) nonexistent" The dictionary value is somehow prepended to $errorInfo when [dict get] fails to find the key it's looking for. This problem does not occur when running at top level (i.e. not inside a proc). It also does not occur when not using an array (e.g. remove "(index)" from the script). If [dict get] fails for another reason, such as "missing value to go with key", the dictionary value is not prepended (replace "nonexistent" with "poisonous garbage!" to test). - foundin initialized to: "obsolete: 8.6a3"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "andygoth"
- subsystem initialized to: "16. Commands A-H"
- title initialized to:
Junk at start of errorInfo when using [dict get] on arrays
- type initialized to: "Bug"
Ticket change [3ecc649d8f] (rid 121330) by dkf on 2008-12-16 06:09:24:
- icomment:
Caused by fix for issue 1522803, though why the interpreter result isn't clean at that point is odd. Possibly some other fault (related to INST_INVOKE_STK1?) too. Fixed on HEAD
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [2720823720] (rid 88467) by dkf on 2008-12-16 06:30:01:
- assignee changed to: "msofer"
- icomment:
Fixed on 8.5 branch as well. Leaving open and assigned to bytecode engine maintainer for the issue of why the result was not cleared earlier. (Maintainers' note: the [dict set array(index) poisonous garbage!] spills to INST_INVOKE_STK1.)
- login: "dkf"
- mimetype: "text/plain"
- subsystem changed to: "47. Bytecode Compiler"
- username: "dkf"
Ticket change [82b5e19389] (rid 117272) by ferrieux on 2008-12-16 07:27:06:
- icomment:
Simplified repro: no [catch], no array element, no [dict set] ! proc foo {} {return yo} proc oops3 {} { foo dict get {} nonex } oops3 => yokey "nonex" not known in dictionary I think there is a hole in the ResetResultReform. The [dict get] code does an AppendResult assuming an invariant. So either fix that invariant or use ResetResult again... - login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [7038d20e73] (rid 100440) by ferrieux on 2008-12-16 22:10:57:
- icomment:
OK after a bit of cvs history diving, I have the impression that the ResetResult reform by miguel on [revision 1.239, Fri Jul 21 10:47:18 2006 UTC] of tclExecute.c did include one unwanted commenting out of Tcl_ResetResult(). Indeed that reform was a positive move turning a random scattering of ResetResults into a few well-selected ones. But I fear the "removal" part was made in a rather automatic way (miguel correct me if I'm wrong), and (quite forgivably) overlooked the special case id [dict get] which is still required because it is coupled with a Tcl_AppendResult preparing an error message. So I think this Tcl_ResetResult should have stayed here. However Donal, you fixed it by emulating it at a lower level: TclNewObj+Tcl_SetObjResult. Can you explain why ?
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [7d60faedc9] (rid 97229) by dkf on 2008-12-16 22:19:58:
- icomment:
Expected a lower actual overhead that way.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [39ae943bf0] (rid 112433) by ferrieux on 2008-12-16 22:25:46:
- icomment:
Ouch... Why only there ? Can you specify in what situations this optimization is valid ? In that case why not define a Tcl_FastResetResult ? (I'm a bit weary about peephole optimizations in arbitrary places, not driven by mesaurements, and decreasing readability...)
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [b29e8e6d6f] (rid 98364) by dgp on 2008-12-16 22:28:16:
- icomment:
I think Alex is correct, and a full Tcl_ResetResult() needs to be restored. See this demo script: % proc demo {} { return -level 0 -code ok -noisy stuff dict get {} noex } % catch demo m o 1 % set o -noisy stuff -code 1 -level 0 -errorcode NONE -errorinfo {key "noex" not known in dictionary while executing "dict get {} noex" (procedure "demo" line 3) invoked from within "demo"} -errorline 1 See how the "-noisy stuff" is leaking into the unrelated error in [dict get]. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [87ab1ada4d] (rid 131740) by ferrieux on 2008-12-16 22:51:47:
- closedate changed to: "2008-12-16T15:51:47"
- closer changed to: "ferrieux"
- icomment:
Thanks Don. Committed.
- login: "ferrieux"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "ferrieux"
Ticket change [10064d485a] (rid 94891) by dgp on 2008-12-16 23:12:57:
- icomment:
So the commit doesn't change the leaky return options. I think that's another bug.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [684c35cb16] (rid 103043) by ferrieux on 2008-12-16 23:15:53:
- icomment:
Right. Expecting your submission any time soon :)
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [4b1aea4bfa] (rid 126640) by dgp on 2008-12-16 23:24:29:
- assignee changed to: "ferrieux"
- icomment:
Sorry. Gotta take care testing with shared libraries. There *is* another bug with leaky options, but not any longer with the demo scripts here.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [eb6201b71e] (rid 103537) by dgp on 2008-12-16 23:27:44:
- icomment:
Don't forget to backport the fix for 8.5.6 too.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [dfd3dea0f3] (rid 115084) by ferrieux on 2008-12-17 05:25:15:
- icomment:
Done :)
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment: