Artifacts Associated With Ticket 1786481
Ticket change [0c110affce] (rid 114114) by msofer on 2007-09-02 00:23:29:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
As reported on clt (http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/32fa115f8aef9d1f/51fac01c35c3b340#51fac01c35c3b340) mig@uh:~$ /home/CVS/tcl_SF_clean/unix/tclsh % set foo {a {b {c {d {e 1}}}}} a {b {c {d {e 1}}}} % dict update foo a t { dict update t b t { dict update t c t { dict update t d t { dict incr t e } } } } e 2 % set foo Segmentation fault - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "9 Immediate"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: "15. Dict Object"
- title initialized to: "dict causes segfault"
- type initialized to: "Bug"
Ticket change [0d4e8db310] (rid 114339) by dkf on 2007-09-09 05:05:18:
- icomment:
Logged In: YES user_id=79902 Originator: NO Seems to build a recursive structure?!
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [20564f2271] (rid 91295) by dkf on 2007-09-09 05:38:02:
- closedate changed to: "2007-09-08T22:38:02"
- closer changed to: "dkf"
- foundin changed to: "obsolete: 8.5a7"
- icomment:
Logged In: YES user_id=79902 Originator: NO Fixed with a little more duplication in the evil case.
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"
Ticket change [5b9bb4f851] (rid 118361) by dgp on 2007-09-10 23:31:45:
- icomment:
Logged In: YES user_id=80530 Originator: NO In a --enable-symbols=all build: ---- dict-21.17 start Test file error: Bad stack top 6 at pc 201 in TclExecuteByteCode (min 0, max 5) executing dict update t c t { dict update t d t { dict incr t e } } TclExecuteByteCode execution failure: bad stack top - login: "dgp"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "dgp"
- icomment:
Ticket change [9a2abc1cf5] (rid 110908) by dgp on 2007-09-10 23:41:24:
- icomment:
Logged In: YES user_id=80530 Originator: NO kbk... but I observe that the definition of DICT_UPDATE_END (tclCompile.c:361) has the wrong value for numOperands... kbk... and suspect without proof that these instructions maya also have the wrong value for stackBalance or some such.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [7595f06b61] (rid 105415) by kennykb on 2007-09-10 23:43:17:
- icomment:
Logged In: YES user_id=99768 Originator: NO I tried to chase this a little bit further and observe that line 213 of tclCompile.c has: {"dictUpdateEnd", 9, -1, 2,{OPERAND_LVT4, OPERAND_AUX4}}, /* Reflect the state of local variables (described in the aux data * referred to by the second immediate argument) back to the state of * the dictionary in the variable referred to by the first immediate * argument. The list of keys (popped from the stack) must be the same * length as the list of variables. * Stack: ... keyList => ... */ This caused an immediate segfault when I tried the test case with tcl_traceCompile=2 because the numOperands is 1 and almost surely should be 2. How sure are we about stack balance? - login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
- icomment:
Ticket change [d5310ffa62] (rid 123574) by dkf on 2007-09-11 03:29:43:
- icomment:
Logged In: YES user_id=79902 Originator: NO That's wrong. The dictUpdateEnd entry definitely should have 2 args! It's also possible that there's a separate bug in the INST_DICT_UPDATE_END implementation. In particular, I suspect that the 'cleanup = 2;' in the last clause of it that can goto checkForCatch is wrong.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [df60144c85] (rid 115006) by msofer on 2007-09-11 04:48:04:
- icomment:
Logged In: YES user_id=148712 Originator: YES The numArgs is incorrect. The variable 'cleanup' only has to be set before jumping to procesExceptionReturn, so the 'cleanup=2' is wrong but harmless. HEAD now has these fixes, but still has the stack error.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Add attachment "1786481.patch" [1ee8879342] (rid 91056) by msofer on 2007-09-11 10:39:58.
Ticket change [caae774576] (rid 95398) by msofer on 2007-09-11 10:39:58:
- icomment:
File Added - 245085: 1786481.patch Logged In: YES user_id=148712 Originator: YES This patch fixes the issue, please review. Can dict-for use something similar? Changes in the dict-update compiler: INST_UPDATE_START now leaves the key list on the stack instead of creating a tmp var for it; INST_UPDATE_END expects to find at stacktop. The epilogue after the implicit catch for the body is reformulated, with a clearer code separation for different return codes from the body (caught vs not). The previous code left a duplicate result on the stack after TCL_OK completion? File Added: 1786481.patch
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Add attachment "1786481-2.patch" [36ac2999ae] (rid 107150) by msofer on 2007-09-11 21:19:47.
Ticket change [f3d17b70cc] (rid 129787) by msofer on 2007-09-11 21:19:47:
- icomment:
File Added - 245155: 1786481-2.patch Logged In: YES user_id=148712 Originator: YES New patch, same logic. Fixed panic message, reordered to allow peephole optimisation in the normal case. File Added: 1786481-2.patch
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [1c646bc1c5] (rid 90596) by dkf on 2007-09-11 21:46:49:
- icomment:
Logged In: YES user_id=79902 Originator: NO Can't argue with patch (other than with trifling stuff that's easier to fix after it is committed). Go for it.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Add attachment "test" [fd6d4412c8] (rid 108412) by msofer on 2007-09-11 21:55:12.
Ticket change [27e4b4fce2] (rid 88603) by msofer on 2007-09-11 21:55:15:
- closedate changed to: "2007-09-11T14:55:15"
- closer changed to: "msofer"
- icomment:
File Added - 245160: test Logged In: YES user_id=148712 Originator: YES Could not produce a test case that causes a crash. Manual verification of the original problem (wrong stack depth on TCL_OK returns from the body) can be done with the enclosed test in a --enable-symbols=all build. Fixed in HEAD, leaving open at reduced prio in case someone comes up with a workable test. File Added: test
- login: "msofer"
- mimetype: "text/plain"
- priority changed to: "4"
- status changed to: "Pending"
- username: "msofer"
Ticket change [47b1e20789] (rid 99744) by sf-robot on 2007-09-26 09:20:08:
- closedate changed to: "2007-09-26T02:20:08"
- closer changed to: "sf-robot"
- icomment:
Logged In: YES user_id=1312539 Originator: NO This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"