RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1355780 - sort doesn't work with locales where thousands_sep is space in human readable mode
Summary: sort doesn't work with locales where thousands_sep is space in human readable...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: coreutils
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Kamil Dudka
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-12 14:10 UTC by Jakub Prokes
Modified: 2019-01-21 12:05 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-21 12:05:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jakub Prokes 2016-07-12 14:10:38 UTC
Description of problem:
Locales like unm_US.utf8 where is thousands_sep space caused sort -h working improperly. In these case sorting works only on last column because spaces in between columns are accepted as thousands separator.


Version-Release number of selected component (if applicable):
coreutils-8.22-18.el7.x86_64

How reproducible:
LC_ALL=sv_SE.utf8 sort -k1h data-comma.txt

Actual results:
1k      1,2G    1k
1,2k    1G      1,2k
1M      1,2M    1M
1,2M    1M      1,2M
1G      1,2k    1G
1,2G    1k      1,2G
1T      1T      1T
1,2T    1       1,2T
1       1,2T    1


Expected results:
1       1,2T    1
1k      1,2G    1k
1,2k    1G      1,2k
1M      1,2M    1M
1,2M    1M      1,2M
1G      1,2k    1G
1,2G    1k      1,2G
1T      1T      1T
1,2T    1       1,2T


Additional info:
$ cat data-comma.txt
1       1,2T    1
1k      1,2G    1k
1M      1,2M    1M
1G      1,2k    1G
1T      1T      1T
1,2k    1G      1,2k
1,2M    1M      1,2M
1,2G    1k      1,2G
1,2T    1       1,2T

$ LC_ALL=sv_SE.utf8 locale -k LC_NUMERIC
decimal_point=","
thousands_sep=" "
grouping=3;3
numeric-decimal-point-wc=44
numeric-thousands-sep-wc=32
numeric-codeset="UTF-8"

Comment 1 Kamil Dudka 2016-07-12 14:38:59 UTC
This bug is unrelated to our i18n patch.  The same happens with upstream sort.

Comment 2 Kamil Dudka 2016-07-17 16:06:40 UTC
I have proposed a fix upstream:

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24015

Comment 4 Kamil Dudka 2016-07-19 13:22:06 UTC
fixed in coreutils-8.25-14.fc25:

http://pkgs.fedoraproject.org/cgit/rpms/coreutils.git/commit/?id=8b01f237

Comment 5 Fedora Update System 2016-10-31 17:46:14 UTC
coreutils-8.25-7.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-75adc7da4f

Comment 6 Fedora Update System 2016-11-01 18:22:52 UTC
coreutils-8.25-7.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-75adc7da4f

Comment 7 Jakub Prokes 2016-11-14 10:01:30 UTC
I can confirm fix on fc24.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Checking for the presence of coreutils rpm 
:: [   LOG    ] :: Package versions:
:: [   LOG    ] ::   coreutils-8.25-7.fc24.x86_64
:: [   LOG    ] :: Duration: 0s
:: [   LOG    ] :: Assertions: 1 good, 0 bad
:: [   PASS   ] :: RESULT: Setup


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   LOG    ] :: Detected decimal mark ',' for locale sv_SE.utf8
:: [   PASS   ] :: Decimal point have to be known. (Expected 0, got 0)
:: [   PASS   ] :: LC_ALL=sv_SE.utf8 sort -k1h (Expected 0, got 0)
:: [   PASS   ] :: LC_ALL=sv_SE.utf8 sort -k2h (Expected 0, got 0)
:: [   PASS   ] :: LC_ALL=sv_SE.utf8 sort -k3h (Expected 0, got 0)

Comment 12 Kamil Dudka 2019-01-21 12:05:31 UTC
Fixing this in RHEL-7 is risky because it introduces a change in behavior.  There is no customer case behind this bug.  Closing NEXTRELEASE as it is fixed in RHEL-8.


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