|
2007-09-26
| ||
| 09:20 | • Closed ticket [1786481fff]: dict causes segfault plus 6 other changes artifact: 47b1e20789 user: sf-robot | |
|
2007-09-11
| ||
| 21:55 | • Pending ticket [1786481fff]. artifact: 27e4b4fce2 user: msofer | |
| 21:55 | • Add attachment test to ticket [1786481fff] artifact: fd6d4412c8 user: msofer | |
| 21:46 | • Ticket [1786481fff] dict causes segfault status still Open with 4 other chan... artifact: 1c646bc1c5 user: dkf | |
| 21:19 | • Add attachment 1786481-2.patch to ticket [1786481fff] artifact: 36ac2999ae user: msofer | |
| 21:19 | • Ticket [1786481fff] dict causes segfault status still Open with 4 other chan... artifact: f3d17b70cc user: msofer | |
| 10:39 | • Add attachment 1786481.patch to ticket [1786481fff] artifact: 1ee8879342 user: msofer | |
| 10:39 | • Ticket [1786481fff] dict causes segfault status still Open with 4 other chan... artifact: caae774576 user: msofer | |
| 04:48 | • Ticket [1786481fff]: 4 changes artifact: df60144c85 user: msofer | |
| 03:29 | • Ticket [1786481fff]: 4 changes artifact: d5310ffa62 user: dkf | |
|
2007-09-10
| ||
| 23:43 | • Ticket [1786481fff]: 4 changes artifact: 7595f06b61 user: kennykb | |
| 23:41 | • Ticket [1786481fff]: 4 changes artifact: 9a2abc1cf5 user: dgp | |
| 23:31 | • Open ticket [1786481fff]. artifact: 5b9bb4f851 user: dgp | |
|
2007-09-09
| ||
| 05:38 | • Closed ticket [1786481fff]. artifact: 20564f2271 user: dkf | |
| 05:05 | • Ticket [1786481fff]: 4 changes artifact: 0d4e8db310 user: dkf | |
|
2007-09-02
| ||
| 00:23 | • New ticket [1786481fff]. artifact: 0c110affce user: msofer | |
dict causes segfault
Closed / Fixed1786481fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-09-02 00:23:29
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
dkfplain2007-09-09 05:05:18
Logged In: YES user_id=79902 Originator: NO Seems to build a recursive structure?!
dkfplain2007-09-09 05:38:02
Logged In: YES user_id=79902 Originator: NO Fixed with a little more duplication in the evil case.
dgpplain2007-09-10 23:31:45
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
dgpplain2007-09-10 23:41:24
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.
kennykbplain2007-09-10 23:43:17
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?
dkfplain2007-09-11 03:29:43
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.
msoferplain2007-09-11 04:48:04
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.
msoferplain2007-09-11 10:39:58
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
msoferplain2007-09-11 21:19:47
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
dkfplain2007-09-11 21:46:49
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.
msoferplain2007-09-11 21:55:15
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
sf-robotplain2007-09-26 09:20:08
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).
Log in (anonymous is fine) to add a comment.
Attachments:
- test [download] added by msofer on 2007-09-11 21:55:12. [details]
- 1786481-2.patch [download] added by msofer on 2007-09-11 21:19:47. [details]
- 1786481.patch [download] added by msofer on 2007-09-11 10:39:58. [details]