Skip to content
Tcl Source Code History Of Ticket 1675116fffffffff
Login

History Of Ticket 1675116fffffffff

Artifacts Associated With Ticket 1675116fffffffff

  1. Ticket change [749c362286] (rid 105232) by dgp on 2007-03-06 17:23:35:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      Following script crashes:
      
      set l {1 2 3}
      proc compare args {
        string length $::l
      }
      lsort -command compare $l
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "dgp"
    10. subsystem initialized to: "17. Commands I-L"
    11. title initialized to: "lsort crash"
    12. type initialized to: "Bug"
  2. Ticket change [81b470b86e] (rid 117086) by afredd on 2007-03-08 00:54:44:

    1. icomment:
      Logged In: YES 
      user_id=1386588
      Originator: NO
      
      
      Here's a fix. It simply does a Tcl_DuplicateObj
      of the input list and sorts that (but only for
      calls using -command since this is the only way to
      hit the problem).
      [PS try doing the given example using -indices.
      No crash, but some odd looking indexes!]
      
      
      --- tclCmdIL.c-orig2007-03-07 17:42:32.856819800 +0000
      +++ tclCmdIL.c2007-03-07 17:47:05.580806000 +0000
      @@ -4143,7 +4143,7 @@
           int i, index, unique, indices;
           Tcl_Obj *resultPtr;
           int length;
      -    Tcl_Obj *cmdPtr, **listObjPtrs;
      +    Tcl_Obj *cmdPtr, *listPtr, **listObjPtrs;
           SortElement *elementArray;
           SortElement *elementPtr;
           SortInfo sortInfo;/* Information about this sort that needs to
      @@ -4302,9 +4302,14 @@
       }
       Tcl_ListObjAppendElement(interp, newCommandPtr, Tcl_NewObj());
       sortInfo.compareCmdPtr = newCommandPtr;
      +/* Fixes [SW#1675116] */
      +listPtr = Tcl_DuplicateObj(objv[objc-1]);
      +Tcl_IncrRefCount(listPtr);
      +    } else {
      +listPtr = objv[objc-1];
           }
       
      -    sortInfo.resultCode = Tcl_ListObjGetElements(interp, objv[objc-1],
      +    sortInfo.resultCode = Tcl_ListObjGetElements(interp, listPtr,
           &length, &listObjPtrs);
           if (sortInfo.resultCode != TCL_OK || length <= 0) {
       goto done;
      @@ -4353,6 +4358,7 @@
         done:
           if (sortInfo.sortMode == SORTMODE_COMMAND) {
       Tcl_DecrRefCount(sortInfo.compareCmdPtr);
      +Tcl_DecrRefCount(listPtr);
       sortInfo.compareCmdPtr = NULL;
           }
           if (sortInfo.indexc > 1) {
      
      
      
    2. login: "afredd"
    3. mimetype: "text/plain"
    4. username: "afredd"
  3. Ticket change [501311b99f] (rid 125915) by dkf on 2007-03-08 06:04:10:

    1. priority changed to: "9 Immediate"
  4. Ticket change [e31305e5ab] (rid 87726) by dkf on 2007-03-09 23:41:06:

    1. foundin changed to: "obsolete: 8.4.14"
    2. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      Fixed in HEAD. Needs backport.
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  5. Ticket change [ea71868ed3] (rid 103383) by dkf on 2007-03-10 21:58:20:

    1. closedate changed to: "2007-03-10T14:58:20"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      Fixed in 8.4 branch.
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dkf"