Artifacts Associated With Ticket 3075155fffffffff
Ticket change [b22fb677f4] (rid 98287) by msofer on 2010-09-24 22:03:10:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
When I disable the command compiler (juts add '0&&' at the start of the condition in tclCompile.c line 1639), there is a nasty-looking error: ==== oo-27.6 variables declaration - non-interference of levels FAILED ==== Contents of test case: oo::class create foo { superclass master variable x! constructor {} {set x! 1} method y {} {incr x!} } foo create bar oo::objdefine bar { variable y! method y {} {list [next] [incr y!] [info var] [info local]} export eval } bar y list [bar y] [lsort [info object vars bar]] [bar eval {info vars *!}] ---- Result was: {3 2 {} {}} {x! y!} {x! y!} ---- Result should have been (exact matching): {3 2 y! {}} {x! y!} {x! y!} ==== oo-27.6 FAILED There is also a segfault in itcl's typeoption.test, which may well be related. The build is configured as CFLAGS=-DPURIFY ./configure --disable-shared --enable-symbols - foundin initialized to: "obsolete: 8.6b1.1"
- is_private initialized to: "0"
- priority initialized to: "8"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: "35. TclOO Package"
- title initialized to: "oo depends on bytecoding?"
- type initialized to: "Bug"
Ticket change [43871c015c] (rid 116567) by dkf on 2010-09-26 00:53:48:
- icomment:
Variable resolver involved! Argh!
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [8a5be61dcd] (rid 127383) by msofer on 2010-09-26 19:03:16:
- icomment:
From the chat: [14:56]dkfmiguel: It looks like it's something to do with variable resolvers. I don't pretend to understand those (and have probably got it wrong, I accept) and write code for them by doing the equivalent of throwing rocks at stuff until it seems to work. [14:57]dkfI suspect that the highly restricted resolver used by TclOO is too restricted, but since proc^Wmethod bodies are always compiled I don't care
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [f4b53565ee] (rid 129967) by msofer on 2010-09-26 19:04:51:
- icomment:
After quick look at TclInfoVarsCmd(), it seems that [info vars] is not resolver-aware at all
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [0c74dec6dc] (rid 114177) by msofer on 2010-09-26 19:54:51:
- icomment:
This led to discovery of (related, not the same) Bug #3075907. If that one is resolved as an implementation bug, this test is wrong. If it is instead a doc bug, this test is correct.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [f602081b7a] (rid 130216) by msofer on 2010-09-27 16:24:05:
- icomment:
The problem seems to be: 1. On a normal build, the presence of y! is detected at compile time by the [incr] compiler. This causes y! to live in the LVT and the resolver to be called at proc loading time. Due to #3075907 y! is reported by [info vars] 2. With command compilers disabled (in this particular case, it is enough to not compile incr), y! is not in the LVT: it will only exist when it is given a value This is all as should be, assuming [info vars] behaved as doc'ed in the man page. Given #3075907 the behaviour depends on the set of commands that are bytecompiled.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [09cec41220] (rid 113720) by msofer on 2010-09-27 17:07:44:
- icomment:
Just replacing [incr] by an equivalent [myIncr] or forcing a non-bc'ed [incr] displays the difference: running the attached script outputs {3 2 y! {}} {x! y!} {x! y!} {3 2 {} {}} {x! y!} {x! y!} {3 2 {} {}} {x! y!} {x! y!} - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [0f540e1336] (rid 94772) by msofer on 2010-09-27 17:08:08:
- icomment:
File Added - 387998: show.tcl
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Add attachment "show.tcl" [1421a4ab3f] (rid 124337) by msofer on 2010-09-27 17:08:08.
Ticket change [7e11b72900] (rid 97344) by msofer on 2010-09-27 22:43:12:
- icomment:
In order for this to work properly if we maintain the current behaviour (ie, if #3075907 is declared a doc bug), we should extend Tcl_ResolverInfo to contain a listProc to be used by [info vars]. This new function would list all variable names that are able to be resolved in the current context. The alternative would probably be unnecessarily expensive: that all OO methods be initialised to contain locals linked to every defined variable, initially undefined.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [47250e52dc] (rid 99642) by dkf on 2010-10-20 06:36:04:
- assignee changed to: "msofer"
- icomment:
Your analysis looks correct. I'll assign it to you (for now) since I'm not going to do any hacking in the guts of resolvers if I can possibly help it.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [64c538f86f] (rid 92829) by dkf on 2010-10-20 06:36:25:
- subsystem changed to: "07. Variables"
Ticket change [633e210957] (rid 92544) by dkf on 2011-03-11 18:47:07:
- icomment:
I'm not very excited about this after all. Turns out quite a bit of the rest of Tcl also breaks if we disable command compilation.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [a83b87227b] (rid 98941) by dkf on 2011-03-11 18:47:08:
- priority changed to: "7 High"
Ticket change [d864046948] (rid 107427) by dkf on 2011-03-11 18:56:06:
- icomment:
It's the interaction of [info variables] with variable resolvers (a feature not used in the rest of the core, hence the bug showing up in TclOO). Having a LVT smooths all that out in this case, but that's hardly ideal.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [71835cb9ec] (rid 259706) by serhiy.storchaka on 2026-10-21 10:03:36:
- icomment:
Since 8.6.0 ([0b5e337729], bug [2712377]), [info vars] in a method lists the declared object variables itself, so the result no longer depends on bytecompilation. The show.tcl cases give the same result on 8.6 and 9.x.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- icomment:
Ticket change [c540e25f95] (rid 260001) by serhiy.storchaka on 2026-10-22 17:19:30:
- closedate changed to: "2461334.919174757"
- closer changed to: "serhiy.storchaka"
- login: "serhiy.storchaka"