Artifacts Associated With Ticket 4402cfa58c
Ticket change [f5d7c006cf] (rid 146098) by dgp on 2016-04-01 03:06:07:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Demo script: proc bar {ev} {} proc bingo {xx} {} namespace ensemble create -command launch -map {foo bar event bingo} catch {bar} m1; puts $m1 catch {launch ev} m2; puts $m2 catch {launch foo} m3; puts $m3 Output: wrong # args: should be "bar ev" wrong # args: should be "launch event xx" wrong # args: should be "launch foo event" The final line of output should be: wrong # args: should be "launch foo ev" - foundin initialized to: "trunk"
- is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "21. [namespace]"
- title initialized to: "Improper ensemble intrep usage"
- type initialized to: "Bug"
Ticket change [c42f011af0] (rid 146099) by dgp on 2016-04-01 03:37:40:
- comment changed to:
Demo script: proc bar {ev} {} proc bingo {xx} {} namespace ensemble create -command launch -map {foo bar event bingo} catch {launch foo} m; puts $m catch {launch ev} m; puts $m catch {launch foo} m; puts $m Output: wrong # args: should be "launch foo ev" wrong # args: should be "launch event xx" wrong # args: should be "launch foo event" The final line of output should be: wrong # args: should be "launch foo ev" - icomment:
Revised original comment for greater clarity
- login: "dgp"
- mimetype: "text/plain"
- comment changed to:
Ticket change [8d9ab49650] (rid 146100) by dgp on 2016-04-01 03:42:58:
- icomment:
The first {launch foo} is handled correctly. The {launch ev} is also handled correctly, but has the side effect of storing an intrep in the "ev" value which keeps a record of both the target command prefix in the ensemble ("bingo") and the expanded full name of the subcommand when it was triggered by an abbreviation ("event"). The full name of the subcommand is used in the error message, even though the script used only the abbreviated form. The final {launch foo} gets things wrong. When an error message is crafted this time and it's time to append the string "ev" as part of the usage, that value still has the magic intrep, and the expanded string is pulled into the error message even though that's not correct in this context. All of this is in Tcl_WrongNumArgs(). - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [7c1aab3812] (rid 146742) by dgp on 2016-05-18 17:19:28:
- icomment:
This bug centers about an ObjType that caches a lookup. When it needs to use that lookup, though, the data needed to verify that the lookup remains valid are out of scope.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [045cc77054] (rid 146743) by dgp on 2016-05-18 17:19:54:
- assignee changed to: "dkf"
- login: "dgp"
- mimetype: "text/plain"
Ticket change [ea30d43453] (rid 146744) by dgp on 2016-05-18 17:25:52:
- icomment:
The "interp" argument to Tcl_WrongNumArgs() is the only one that even possibly might contain a path to finding out whether we're in the midst of invoking the ensemble/subcommand that's cached in the value, so that the substitution is proper.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [d836b3ab79] (rid 146759) by dgp on 2016-05-20 15:23:33:
- icomment:
Related failure: % proc target {one two} {} % namespace ensemble create -command e2 -map {s2 target} ::e2 % namespace ensemble create -command e1 -map {s1 e2} -parameters foo ::e1 % e1 s2 s1 arg wrong # args: should be "e1 s2 s1 one two" % e1 [string tolower S] [string tolower S] arg wrong # args: should be "e1 s2 s1 one two" BUT ... % e1 s s arg wrong # args: should be "e1 s2 s2 one two" Literal sharing plus failure to confirm context produces wrong error message. - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [af71c113b3] (rid 146760) by dgp on 2016-05-20 15:36:43:
- icomment:
Try to follow that bad advice: % e1 s2 s2 1 2 unknown or ambiguous subcommand "s2": must be s1
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [9becc0b538] (rid 146761) by dgp on 2016-05-20 15:41:10:
- icomment:
Even with proper context checking, with literal sharing it appears that the best we could hope for would be: wrong # args: should be "e1 s2 s one two" Then at least a second pass would get there: % e1 s2 s arg wrong # args: should be "e1 s2 s1 one two" Seems that the approach just isn't right in the first place, though. If we want spell-check corrections to the expansions of unambiguous prefixes, wouldn't it be simpler and more reliable to overwrite elements of the sourceObjs array directly?
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [c602a8fa47] (rid 146762) by dgp on 2016-05-20 16:32:26:
- icomment:
Problem with that idea is that the objv (thus sourceObjs) array is const. Given that, and the potential for value sharing, appears we're stuck. What a mess.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [8b2dc8d008] (rid 147408) by dgp on 2016-07-01 20:14:39:
- assignee changed to: "dgp"
- closedate changed to: "2457571.34351775"
- closer changed to: "dgp"
- icomment:
Fixed for Tcl 8.6.6+
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [1513c6cc2e] (rid 167803) by dgp on 2018-11-27 20:55:42:
- assignee changed to: "dkf"
- closedate changed to: "2458450.37202421"
- icomment:
I'm told by dkf that a Coverity scan is unhappy with the bug fix for this ticket. That is not too surprising. Upon review, the code is a horror of type abuse in order to improvise a scheme to store the information needed to fix the bug in a struct that has no space for it. If there's an alternative set of casts to make Coverity accept the code, I have no objection to changing to them. It's not as if there's any way to make this code type-correct. It's intentionally an abuse in order to stuff more things into the interp->ensembleRewrite without any changes that would resize the Interp struct in the middle.
- login: "dgp"
- mimetype: "text/plain"
Ticket change [0974249610] (rid 167804) by dgp on 2018-11-27 20:58:16:
- closedate changed to: "2458450.37379733"
- icomment:
Be sure to note the tests namespace-50.[67] that demonstrate the bug fixed by these code changes.
- login: "dgp"
- mimetype: "text/plain"
Ticket change [b6d1865532] (rid 167813) by dkf on 2018-11-28 11:17:19:
- closedate changed to: "2458450.97036162"
- closer changed to: "dkf"
- icomment:
Seeing this bug report and its tests is very useful. I'll have a think about a better way to do the code (and yes, I can see why it is a horror anyway).
- login: "dkf"
- mimetype: "text/html"
- username: "dkf"
Ticket change [8b92c0fd96] (rid 167817) by dkf on 2018-11-28 15:14:05:
- closedate changed to: "2458451.13478669"
- icomment:
<a href="/tcl/info/d8a8738329be111b">That</a> should improve it, making it clearer that we are just stuffing things into <code>tmp</code> for transport, not that those are the real types involved.
- login: "dkf"
- mimetype: "text/html"