Skip to content
Tcl Source Code History Of Ticket 1189274
Login

History Of Ticket 1189274

Artifacts Associated With Ticket 1189274

  1. Ticket change [0b26497517] (rid 113937) by jenglish on 2005-04-25 06:41:42:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "8"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "jenglish"
    9. subsystem initialized to: "None"
    10. title initialized to: "Crash in TclExecuteByteCode"
    11. type initialized to: "Bug"
  2. Ticket change [7190f27bac] (rid 100703) by dkf on 2005-04-25 17:03:44:

    1. 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.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [8ed4eba88e] (rid 120181) by msofer on 2005-04-25 17:08:06:

    1. 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.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Ticket change [78b3684ebf] (rid 90006) by msofer on 2005-04-25 17:10:42:

    1. closedate changed to: "2005-04-25T10:10:42"
    2. closer changed to: "msofer"
    3. 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]
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "msofer"
  5. Ticket change [e134ee57f2] (rid 87409) by msofer on 2005-04-25 17:11:48:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Oops: reopening. It *is* fixed, but this deserves
      consideration in the testsuite.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. priority changed to: "5 Medium"
    5. status changed to: "Open"
    6. username: "msofer"
  6. Ticket change [2bdb4d6ead] (rid 118818) by jenglish on 2005-04-25 21:14:29:

    1. 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" }
      }
      
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  7. Ticket change [f2ad5494d4] (rid 109594) by msofer on 2005-10-22 10:37:51:

    1. closedate changed to: "2005-10-22T03:37:51"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      test foreach-8.1 added
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "msofer"