Artifacts Associated With Ticket 1189274
Ticket change [0b26497517] (rid 113937) by jenglish on 2005-04-25 06:41:42:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
CVS HEAD (24 Apr 2005), getting a SIGSEGV in TclExecuteByteCode line 4755: Tcl_IncrRefCount(valuePtr); Haven't isolated the Tcl code that's causing this, but examining in GDB: valuePtr is NULL; it looks like it was set earlier at line 4736 valuePtr = elements[valIndex]; elements and listLen were set earlier at line 4727: TclListObjGetElements(listPtr, listLen, elements); but listPtr->typePtr is 0, (contrary to the documented precondition of the TclListObjGetElements macro "do NOT forget to verify that it of list type before using!"). listPtr->bytes is the empty string ""; internal rep is apparently random garbage. - foundin initialized to: "None"
- priority initialized to: "8"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "jenglish"
- subsystem initialized to: "None"
- title initialized to: "Crash in TclExecuteByteCode"
- type initialized to: "Bug"
Ticket change [7190f27bac] (rid 100703) by dkf on 2005-04-25 17:03:44:
- icomment:
Logged In: YES user_id=79902 This is in INST_FOREACH_STEP4, and experience with intrep shimmering nightmares indicates that in the case of being unable to *guarantee* the type, you have to take the safe approach instead. In this case, I suspect (from looking at the code) the problem is that the assumption that Tcl_ListObjLength used to be assumed to convert the object type to list, but no longer does. I've not figured out how to induce the fault.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [8ed4eba88e] (rid 120181) by msofer on 2005-04-25 17:08:06:
- icomment:
Logged In: YES user_id=148712 As noted in the comment in line 4755 "We already checked above that each list temp holds a valid list object". Specifically, the call to Tcl_ListObjLength at line 4700 shimmers the obj to listType (or leaves it unchanged if its string rep is {}). Hence, whenever the obj has an empty string rep, TclListObjGetElements sets the variable listLen to garbage. This is indeed a bad bug, which will show its face whenever the junky listLen is less than valIndex. TclListObjGetElements should *not* be have been used here anyway (ie, even if no list is empty): it is possible that one of the lists gets shimmered out of listType as a side effect of setting a previous var, there is no guarantee that the check at line 4700 remains valid when we get to line 4727 in the case i>0. - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [78b3684ebf] (rid 90006) by msofer on 2005-04-25 17:10:42:
- closedate changed to: "2005-04-25T10:10:42"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Fixed by replacing TclListObjGetElements by Tcl_ListObjGetElements (which knows how to handle empty lists which are not of listType, pending the reversion of the special case for empty lists in [Patch 1158008], see also [Bug 1178805]
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "msofer"
Ticket change [e134ee57f2] (rid 87409) by msofer on 2005-04-25 17:11:48:
- icomment:
Logged In: YES user_id=148712 Oops: reopening. It *is* fixed, but this deserves consideration in the testsuite.
- login: "msofer"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- status changed to: "Open"
- username: "msofer"
- icomment:
Ticket change [2bdb4d6ead] (rid 118818) by jenglish on 2005-04-25 21:14:29:
- icomment:
Logged In: YES user_id=68433 This reproduces the crash for me: proc crash {} { set a "x y z" set b "" foreach aa $a bb $b { puts "aa = $aa bb = $bb" } } - login: "jenglish"
- mimetype: "text/plain"
- username: "jenglish"
- icomment:
Ticket change [f2ad5494d4] (rid 109594) by msofer on 2005-10-22 10:37:51:
- closedate changed to: "2005-10-22T03:37:51"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 test foreach-8.1 added
- login: "msofer"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "msofer"