[prev in list] [next in list] [prev in thread] [next in thread]
List: coreutils-bug
Subject: bug#18540: Sorting bug?
From: Eric Blake <eblake () redhat ! com>
Date: 2014-09-23 21:36:53
Message-ID: 5421E7F5.8010103 () redhat ! com
[Download RAW message or body]
tag 18540 notabug
thanks
On 09/23/2014 02:58 PM, Eric Blake wrote:
> Let's look further:
>
> $ printf 'a b!x\na-b-c!x\n' | LANG=en_US.utf8 ltrace -e strcoll sort -s
> --debug -k1,1 -t!
> sort: using ‘en_US.utf8' sorting rules
> sort->strcoll("a b!x", "a-b-c!x") = 21
> a-b-c!x
> _____
> a b!x
> ___
> +++ exited (status 0) +++
Hmm, I just noticed something.
>
>
> Huh? Why are we passing the ENTIRE line to strcoll? Shouldn't we only
> be passing the key?
That was my distro's build of sort (in my case, Fedora 20, with sort
from GNU coreutils 8.21). But looking at coreutils.git (v8.23-39-g1ff4d08),
$ printf 'a b!x\na-b-c!x\n' | LANG=en_US.utf8 ltrace -e strcoll
./src/sort -s --debug -k1,1 -t!
./src/sort: using ‘en_US.utf8' sorting rules
sort->strcoll("a b", "a-b-c") = -1
a b!x
___
a-b-c!x
_____
+++ exited (status 0) +++
Yay - strcoll now uses the correct bounds. Next step - determining if
this is an upstream problem that was fixed in the interim, or if this is
a bug in the downstream additions on top of stock upstream. None of the
9 commits in 'git shortlog v8.21.. src/sort.c' seem to describe the
situation.
And looking at my distro's patches, there is definitely some gorp added
to sort.c in coreutils-i18n.patch, which I highly suspect to be the root
cause.
So please re-raise this as a downstream bug in your distro's i18n patch,
as upstream coreutils is immune.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic