Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a7fa36ab3a90e1e7ee2fb639c5e1f86704af4543
Ticket: 219398ffffffffffffffffffffffffffffffffff
another memory leak in lsort
User & Date: nobody on 2000-10-26 05:12:25
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 6239 Bug
    Version: 8.3.2
    SubmitDate: '2000-09-11'
    LastModified: '2000-10-25'
    Severity: MED
    Status: UnAssn
    Submitter: techsupp
    OS: Solaris
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    Name:
    
    Rob Mayoff
    
    
    ReproducibleScript:
    
    Run this command in tclsh:
    
    
    while 1 { lsort -command irrelevant {} }
    
    
    In another window, you can use ps or top to watch tclsh's memory grow without bound.
    
    
    ObservedBehavior:
    
    lsort leaks memory when given a -command argument and an empty list.
    
    
    DesiredBehavior:
    
    Bounded memory consumption.
    
    
    Patch:
    
    *** tclCmdIL.c  2000/08/15 01:11:02     1.1
    
    --- tclCmdIL.c  2000/09/08 01:44:55     1.2
    
    ***************
    
    *** 2616,2626 ****
    
    
          sortInfo.resultCode = Tcl_ListObjGetElements(interp, objv[objc-1],
    
                &length, &listObjPtrs);
    
    !     if (sortInfo.resultCode != TCL_OK) {
    
            goto done;
    
    -     }
    
    -     if (length <= 0) {
    
    -         return TCL_OK;
    
          }
    
          elementArray = (SortElement *) ckalloc(length * sizeof(SortElement));
    
          for (i=0; i < length; i++){
    
    --- 2616,2623 ----
    
    
          sortInfo.resultCode = Tcl_ListObjGetElements(interp, objv[objc-1],
    
                &length, &listObjPtrs);
    
    !     if (sortInfo.resultCode != TCL_OK || length <= 0) {
    
            goto done;
    
          }
    
          elementArray = (SortElement *) ckalloc(length * sizeof(SortElement));
    
          for (i=0; i < length; i++){
    
    
    PatchFiles:
    
    tclCmdIL.c
    
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.3.2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "another memory leak in lsort"
  11. type changed to: "Bug"