Bug 58233 - sort - sorting errors, corrupt algorithm, RedHat 7.1, 7.2
Summary: sort - sorting errors, corrupt algorithm, RedHat 7.1, 7.2
Status: CLOSED DUPLICATE of bug 21913
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: textutils   
(Show other bugs)
Version: 7.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2002-01-11 13:54 UTC by Radek Liboska
Modified: 2005-10-31 22:00 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-01-11 13:54:51 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Radek Liboska 2002-01-11 13:54:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.9-12 i586)

Description of problem:
A simple "sort" command produces erroneous output. While RedHat's 6.1 sorts this
five lines:

<LI>Baese John Good
<LI>B <A NAME="B">
<LI>Barnes Y.
<LI>Bunny K.
<LI>Babe Francis 

correctly as:

<LI>B <A NAME="B">
<LI>Babe Francis 
<LI>Baese John Good
<LI>Barnes Y.
<LI>Bunny K.

then the RedHat 7.1 (7.2) sort produces this :
<LI>Babe Francis 
<LI>Baese John Good
<LI>B <A NAME="B">
<LI>Barnes Y.
<LI>Bunny K.

IMHO this bug impacts each and every script, which use sort command

Version-Release number of selected component (if applicable):
textutils-2.0.11 - textutils-2.0.14 (textutils-2.0.10 was not tested, reported
as being bad too)

How reproducible:

Steps to Reproduce:
1.take a simple text file, named "blah", eg.containing this

aaa ttt
aba ttt
a d
ada ttt
aca ttt

2.sort blah


Actual Results:  
aaa ttt
aba ttt
aca ttt
a d
ada ttt

Expected Results:  
a d
aaa ttt
aba ttt
aca ttt
ada ttt

Additional info:

sort from RH < 7 produces Expected Results

This is extremely severe, because all programs depending on sort produce bad
Bug was found when the script for sorting author list produced wrong files 
(http://cccc.uochb.cas.cz/Vol/66/faidx01.html) - Download the page and try to
sort it
"sort faidx01.html".

used for examples: textutils-2.0.11-7,textutils-2.0.14-2.src.rpm  (bad)
   textutils-2.0a-2.src.rpm recompiled on RH7.1 (good)

Comment 1 Radek Liboska 2002-01-12 07:54:36 UTC
DUPLICATED - setenv LC_ALL solves the problem.
BUT! Non of the RH machine in our company has the LC_ALL assigned by default. So
the default behavior of sort command
is broken. If the creator of sort code already knows about the issue..., IMHO it
is sign of stupidity.
I don't think that "POSIX demands this default behavior." as bero@redhat.com

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

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