another memory leak in lsort
Closed / Fixed219398ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 05:12:25
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
dkf Ticket [219398ffff]: 2 changes
[History diff]2000-11-15 22:09:45
dkfplain2000-11-23 22:51:26
Confirmed in 8.4a2. (Wow! This grows *fast*...)
dkf Closed ticket [219398ffff].
[History diff]2000-11-23 22:53:36
dgp Ticket [219398ffff]: 3 changes
[History diff]2001-04-05 08:04:51
Log in (anonymous is fine) to add a comment.