Bug 115620 - /bin/sort -g has memory leak
/bin/sort -g has memory leak
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: coreutils (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks: 156320 209300
  Show dependency treegraph
 
Reported: 2004-02-13 17:51 EST by Jeff Janes
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version: RHBA-2005-544
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-28 13:00:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeff Janes 2004-02-13 17:51:41 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Description of problem:
When sorting large amounts of data using the general numeric
sort flag (-g), it takes huge amounts of memory, and may eventually
crash.



Version-Release number of selected component (if applicable):
4.5.3

How reproducible:
Always

Steps to Reproduce:
1.perl -le'print rand() foreach 1..5_000_000'|/bin/sort -g > /dev/null
2.
3.
    

Actual Results:  Depending on the size of the input, either uses much 
more memory than it should, or it dies with a memory error 
(either "Killed" or "Sort: memory exhausted").

Expected Results:  I expect it use about 33M of main memory (plus 
whatever tmp file space is necessary) to finish the sort.

Additional info:

The binary reports itself as gnu's sort 4.5.3:

$ /bin/sort --version
sort (coreutils) 4.5.3
Written by Mike Haertel and Paul Eggert.

However, if I download and build the 4.5.3 coreutils source
from gnu, that executable does not exhibit this problem.  (It 
performs the sort using about 33M of main memory)
Comment 1 Tim Waugh 2004-02-18 08:01:42 EST
Indeed.  This comes from the i18n patch.  I've fixed this in CVS, and
the fix will be part of any future coreutils update for RHEL3.

A fixed package will also appear in Fedora development tree shortly, FWIW.
Comment 9 Red Hat Bugzilla 2005-09-28 13:00:59 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-544.html

Note You need to log in before you can comment on or make changes to this bug.