bugGNU Core Utilities - Bugs: bug #27373, sort -h performs incorrectly if in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #27373: sort -h performs incorrectly if in utf8 locale.

Submitter:  None
Submitted:  Wed 02 Sep 2009 07:12:06 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Sat 05 Sep 2009 02:57:51 PM UTC, comment #3: 

closed at reporter's request (was due to a bad distro patch)

Jim Meyering <meyering>
Group administrator
Sat 05 Sep 2009 10:24:20 AM UTC, comment #2: 

I've traced this to a dodgy distro patch. Feel free to close the ticket. Sorry to bother you.

B <bladud>
Wed 02 Sep 2009 09:43:57 PM UTC, comment #1: 

I can't reproduce this or see anything wrong with the code.

All 720 of my locales work fine:

$ for LANG in $(locale -a); do printf "K\nE\nM\nZ\n" | ./sort -h | tr -d '\n'; echo; done | uniq -c
    720 KMEZ

Can you give your libc version?
Could you add a printf() to the find_unit_order() function in sort.c to see if it's called?

thanks.

Pádraig Brady <pixelbeat>
Group administrator
Wed 02 Sep 2009 07:12:06 PM UTC, original submission:  

Sample shell session:
% echo $LC_ALL

% echo $LC_COLLATE
C
% echo $LANG                
en_GB.utf8
% printf "1Mi\n1M" | sort -h
1M
1Mi
% export LANG=en_GB
% printf "1Mi\n1M" | sort -h
sort: both SI and IEC prefixes present on units

The relevant lines in my locale.gen are:
en_GB.UTF-8 UTF-8 
en_GB ISO-8859-1 

However, this appears to occurs for any utf8 locale. Coreutils 7.5. Other tests fail in a similar manner, eg:

% export LANG=en_GB.utf8
% printf "K\nE\nM\nZ\n" | ./sort -h
E                                                       
K
M
Z
% export LANG="en_GB"
% printf "K\nE\nM\nZ\n" | ./sort -h
K
M
E
Z

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by meyering (Posted a comment)
  • -email is unavailable- added by bladud (Posted a comment)
  • -email is unavailable- added by pixelbeat (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-09-05 meyering StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code