Bug 115620 - /bin/sort -g has memory leak
Summary: /bin/sort -g has memory leak
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: coreutils   
(Show other bugs)
Version: 3.0
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
Depends On:
Blocks: 156320 209300
TreeView+ depends on / blocked
Reported: 2004-02-13 22:51 UTC by Jeff Janes
Modified: 2007-11-30 22:07 UTC (History)
0 users

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

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:544 qe-ready SHIPPED_LIVE coreutils bug fix update 2005-09-28 04:00:00 UTC

Internal Trackers: 168994

Description Jeff Janes 2004-02-13 22:51:41 UTC
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

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

How reproducible:

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

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 13:01:42 UTC
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 17:00:59 UTC
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.


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