Artifacts Associated With Ticket 456892ffffffffff
Ticket change [db748d6506] (rid 107963) by nobody on 2001-08-30 15:37:45:
- assignee initialized to: "nijtmans"
- cmimetype initialized to: "text/plain"
- comment initialized to:
[belinda 6]--> tclsh8.4 % parray tcl_platform tcl_platform(byteOrder) = bigEndian tcl_platform(machine) = sun4u tcl_platform(os) = SunOS tcl_platform(osVersion) = 5.7 tcl_platform(platform) = unix tcl_platform(threaded) = 1 tcl_platform(user) = chall % puts $tcl_patchLevel 8.4a3 % proc mt_lslice {l s} { set r [list] foreach i $l { lappend r [lindex $l $i] } return $r } mt_lslice [list a b c d e f] [list 1 3 5] Tcl_AppendStringsToObj called with shared object Abort (core dumped) Of course, my proc is wrong and should say: proc mt_lslice {l s} { set r [list] foreach i $s { lappend r [lindex $l $i] } return $r } % mt_lslice [list a b c d e f] [list 1 3 5] b d f - foundin initialized to: "obsolete: 8.4a3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "14. List Object"
- title initialized to: "Tcl_AppendStringsToObj -> abort"
- type initialized to: "Bug"
Ticket change [b31b73a218] (rid 98464) by msofer on 2001-08-30 22:47:34:
- assignee changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 This is a bug in the new bytecompiled implementation of lappend; the crash does not occur in tcl8.3, nor when you eval lappend r [lindex $l $i]
- login: "msofer"
- mimetype: "text/plain"
- priority changed to: "8"
- subsystem changed to: "47. Bytecode Compiler"
- username: "msofer"
Ticket change [e23e932ad2] (rid 87587) by dgp on 2001-08-30 23:09:37:
- assignee changed to: "kennykb"
- icomment:
Logged In: YES user_id=80530 Assigning to Kevin Kenny. His TIP 22/33 changes should take care of this. Make sure to add this to the test suite!
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- subsystem changed to: "14. List Object"
- username: "dgp"
Ticket change [803324f99b] (rid 97694) by dgp on 2001-08-30 23:21:03:
- assignee changed to: "msofer"
- icomment:
Logged In: YES user_id=80530 &(@W#%&@Y SF not managing changes crossing in mid-stream *U#*Y$
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "8"
- subsystem changed to: "47. Bytecode Compiler"
- username: "dgp"
Ticket change [0e4523f433] (rid 94587) by msofer on 2001-08-31 03:00:27:
- icomment:
Logged In: YES user_id=148712 Weird ... [mig@mini generic]$ tclsh8.4 % info patch 8.4a3 % proc tst0 {} { set r [list] lindex a a } % proc tst1 {} { set r {} lindex a a } % tst1 bad index "a": must be integer or end?-integer? % tst0 Tcl_AppendStringsToObj called with shared object Aborted (core dumped) - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [7b6a0e7c1d] (rid 90509) by msofer on 2001-08-31 04:06:39:
- icomment:
Logged In: YES user_id=148712 The symptom goes away if you do Tcl_ResetResult(interp) in TclGetIntForIndex (generic/tclUtil.c, line 2185) before appending to the result. This does not yet leave me utterly satisfied that the disease is gone: (a) I'm not sure this is otherwise OK and doesn't introduce other bugs (b) I still do not understand *why* the interp's result was shared in one case and not in the other ... - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [296b6b11d4] (rid 88866) by hobbs on 2001-08-31 06:23:45:
- icomment:
Logged In: YES user_id=72656 This has something special to do with [list] in 8.4a4, but also in relation to TclGetIntForIndex, because trying with string index (now compiled in 8.4 as well), I also get the crash: lorax [~/cvs/tcl/tcl8.4/unix/linuxd] 772 > tclsh8.4 % proc tst0 {} { set r [list] ; string index a b } % tst0 Tcl_AppendStringsToObj called with shared object Abort lorax [~/cvs/tcl/tcl8.4/unix/linuxd] 773 > tclsh8.4 % proc tst0 {} { set r {} ; string index a b } % tst0 bad index "b": must be integer or end?-integer? I suspect as well that the Tcl_ResetResult is a good thing one way or the other, but I'm going to look for a possible alternative to what may be causing it (related to [list]). - login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [3d2e7a1866] (rid 121043) by hobbs on 2001-08-31 06:31:15:
- icomment:
Logged In: YES user_id=72656 Getting a little more specific, it looks like the failure really is in result handling in the bcc with respect to appending to the result. Note this error result: % proc t0 {} { linsert a 0 b ; lindex a b } % t0 b abad index "b": must be integer or end?-integer? If you do that in 8.3 (where lindex isn't compiled), you don't have the "b a" in the result. - login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [f2917dab5c] (rid 109570) by msofer on 2001-08-31 08:33:55:
- icomment:
Logged In: YES user_id=148712 This seems to be an unfortunate combination of two semi-bugs (aka optimisations?): 1 - TclCompileScript (tclCompile.c, ll. 838) just POPs the previous command result from the stack but does not reset the interp's result. This is OK as (in principle) bcc'ed commands communicate their results on the stack and do not set the interp's result. Compare this to clearing the result before each invocation of a command or evaluation of a script. 2 - Some error messages are *appended* to the interp's result. This is necessary for the buildup of the error call stack, but I think the interp's result should be reset by the error *originators* (in these examples, TclGetIntForIndex) before appending. I would say that #2 should be hunted down, #1 is valuable. As a general rule, commands and functions should not assume that they get an empty result when they are called; they should set the result, not append to it. ----- Additionally: "set r [list]" triggers a core dump because it leaves a shared object in the interp's result: the same object is the value of r. The following function behaves correctly proc tst2 {} { set r r[list] lindex a a } Note that if you *force* other commands to communicate via the interp's result, you reproduce the behaviour: the following dumps core too proc tst3 {} { set set set $set r 5 lindex a a } ---- IN CONCLUSION: (a) this particular bug is fixed by resetting the interp's result in TclGetIntForIndex. (b) there may be other similar bugs lurking in the background, waiting to trip the unwary; a hunt for functions abusingly appending to the result without first resetting it first should be done. - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [17df8963e2] (rid 122570) by hobbs on 2001-09-01 04:20:51:
- closedate changed to: "2001-08-31T21:20:51"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 More particularly, we have to watch utility functions that don't reset the result, because if it is simply a non-bcc command that would follow the 'set r [list]', then the invocation instruction does reset the result. After a look (not exhaustive, but not brief) through the sources, it seems like most other calls were preceded by the appropriate Tcl_ResetResult. Added TclGetIntForIndex fix and tests to 8.4a4cvs.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "hobbs"
Ticket change [09819af1f4] (rid 113668) by msofer on 2002-04-29 23:30:30:
- closedate changed to: "2002-04-29T16:30:30"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 I think this is a symptom of the same "disease" described in bugs #533364 and #550142.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"