Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 64222 - coreutils: sort ignores memory limit with general numeric sort
Summary: coreutils: sort ignores memory limit with general numeric sort
Status: RESOLVED DUPLICATE of bug 39515
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Seemant Kulleen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-16 01:14 UTC by Jens Teubner
Modified: 2005-07-17 13:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Teubner 2004-09-16 01:14:57 UTC
The `sort' utility is capable of doing external sorting, backed by temporary files, if memory is exhausted. A memory limit may be given on the command line (switch -S). If general numeric sorting is chosen (switch -g), however, sort ignores all memory limits and will run out of memory if input files become too large. If other comparison methods (e.g., numeric sort, -n), sort behaves as expected.

Reproducible: Always
Steps to Reproduce:
1. Grab a large file with a numeric field. Should exceed your main memory.
2. enter `sort -g -S 100M <your_large_file> > /dev/null'
3. If you run `top' in parallel, you will see how `sort' eats up all your memory. (It finally gets killed by the oom-killer.)

Actual Results:  
`sort' gets killed by the oom-killer if main-memory is exhausted.

Expected Results:  
It should have used at most as memory as given as a limit on the command line, 
and it should have used temporary files to do external sorting. (Test with 
numeric sort, switch -n.)

Using sys-apps/coreutils 5.2.1 (stable) here.
Comment 1 Jens Teubner 2004-12-22 00:43:46 UTC
Seems like this bug had already been filed as #39515. (I really did search in advance. Now I saw its fixed with the new stable coreutils package.)

Anyway, thanks for the fix.

*** This bug has been marked as a duplicate of 39515 ***