From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 29 18:21:03 2014 Received: (at submit) by debbugs.gnu.org; 29 Oct 2014 22:21:03 +0000 Received: from localhost ([127.0.0.1]:39422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xjbby-0007eT-Bx for submit@debbugs.gnu.org; Wed, 29 Oct 2014 18:21:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43643) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjbH2-00073s-9S for submit@debbugs.gnu.org; Wed, 29 Oct 2014 17:59:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjbGw-0004v1-Hg for submit@debbugs.gnu.org; Wed, 29 Oct 2014 17:59:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjbGw-0004uv-F0 for submit@debbugs.gnu.org; Wed, 29 Oct 2014 17:59:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjbGv-0003K8-Jg for bug-coreutils@gnu.org; Wed, 29 Oct 2014 17:59:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjbGu-0004ud-QD for bug-coreutils@gnu.org; Wed, 29 Oct 2014 17:59:17 -0400 Received: from mail-ie0-x22d.google.com ([2607:f8b0:4001:c03::22d]:56169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjbGp-0004kc-Jd for bug-coreutils@gnu.org; Wed, 29 Oct 2014 17:59:16 -0400 Received: by mail-ie0-f173.google.com with SMTP id tr6so3975780ieb.4 for ; Wed, 29 Oct 2014 14:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=qP+nPvADGt8NDO9rcpnvaT2aoUBSrJhpDXf31qiG5JE=; b=abO5GfwC3weTlJddnfth95Yr+HLm4NZyOh3MpAqsIpFXBkwGgkHYNa7PM6wS4wuRmU 8l+NHEpaJ+VI0+VMgdf2ll6syDXdI+aSlEocdN+no5qmjdRolHkPmwNxsJb60pVAxViE T4yq3RqDUN9N/TBmhKoXd8znOV63Q0nw6iNpln52RsSAlMSmlA5kZXimkH76bdSmTRpq MgDbco0Mgrm6dGfJR7lWIwGaLOyQZGU8tte7j1AwAIGKO7srq0FjabuGFwpzeDpkzSxD Pfcxy8TRgMiV1zQBCNzcR/5c+LpLxDUqaMEJ7CErwiiZVjW5DkcUSumqbEpGz2O5Z5wm y6mw== MIME-Version: 1.0 X-Received: by 10.107.38.136 with SMTP id m130mr6143160iom.72.1414619903151; Wed, 29 Oct 2014 14:58:23 -0700 (PDT) Received: by 10.107.7.160 with HTTP; Wed, 29 Oct 2014 14:58:23 -0700 (PDT) Date: Wed, 29 Oct 2014 17:58:23 -0400 Message-ID: Subject: Bug with Gnu sort program in coreutils 8.4 From: Michael Yang To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=001a1140de66d1f6c1050696dc5e X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 29 Oct 2014 18:21:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) --001a1140de66d1f6c1050696dc5e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, There might be a bug in the =E2=80=9Csort=E2=80=9D program in GNU coreutils= 8.4, present at least in CentOS 6 x86_64. It=E2=80=99s not immediately obvious to me wheth= er or not this bug has been reported before. Given the following: CC =3D gcc CC =3D aCC CCFLAGS =3D CC =3D cc sort (GNU coreutils) 8.4 yields: CC =3D aCC CC =3D cc CCFLAGS =3D CC =3D gcc =E2=80=A6 the 3rd line is out-of-order. In comparison, sort (GNU coreutils= ) 8.14 in cygwin yields: CC =3D aCC CC =3D cc CC =3D gcc CCFLAGS =3D =E2=80=A6 which is correct. --001a1140de66d1f6c1050696dc5e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi,

=C2=A0

There might be a bug in the =E2=80=9Csort=E2=80=9D p= rogram in GNU coreutils 8.4, present at least in CentOS 6 x86_64.=C2=A0 It=E2=80=99s not immediately obvious to me whether or not this bug has been= reported before.

=C2=A0

Given the following:

=C2=A0

CC =3D gcc

CC =3D aCC

CCFLAGS =3D

CC =3D cc

=C2=A0

sort (GNU coreutils) 8.4 yields:

=C2=A0

CC =3D aCC

CC =3D cc

CCFLAGS =3D

CC =3D gcc

=C2=A0

=E2=80=A6 the 3rd line is out-of-order.= =C2=A0 In comparison, sort (GNU coreutils) 8.14 in cygwin yields:

=C2=A0

CC =3D aCC

CC =3D cc

CC =3D gcc

CCFLAGS =3D

=C2=A0

=E2=80=A6 which is correct.

--001a1140de66d1f6c1050696dc5e-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 29 18:36:31 2014 Received: (at control) by debbugs.gnu.org; 29 Oct 2014 22:36:31 +0000 Received: from localhost ([127.0.0.1]:39445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xjbqw-00086d-HS for submit@debbugs.gnu.org; Wed, 29 Oct 2014 18:36:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52168) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xjbqt-00086P-1F; Wed, 29 Oct 2014 18:36:28 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9TMaOUT007358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 29 Oct 2014 18:36:24 -0400 Received: from [10.3.113.180] (ovpn-113-180.phx2.redhat.com [10.3.113.180]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9TMaOge014462; Wed, 29 Oct 2014 18:36:24 -0400 Message-ID: <54516BE7.2060905@redhat.com> Date: Wed, 29 Oct 2014 16:36:23 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Michael Yang , 18893-done@debbugs.gnu.org Subject: Re: bug#18893: Bug with Gnu sort program in coreutils 8.4 References: In-Reply-To: OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I6SxePOslhIloMRRFMDnjMOhkAPfl3Llx" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.6 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --I6SxePOslhIloMRRFMDnjMOhkAPfl3Llx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 18893 notabug thanks On 10/29/2014 03:58 PM, Michael Yang wrote: > There might be a bug in the =E2=80=9Csort=E2=80=9D program in GNU coreu= tils 8.4, present at > least in CentOS 6 x86_64. It=E2=80=99s not immediately obvious to me w= hether or > not this bug has been reported before. Thanks for the report. However, it has been frequently reported, to the point that it has a FAQ entry: https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-n= ot-sort-in-normal-order_0021 > sort (GNU coreutils) 8.4 yields: >=20 >=20 >=20 > CC =3D aCC >=20 > CC =3D cc >=20 > CCFLAGS =3D >=20 > CC =3D gcc You can use the --debug flag to see what is going on (well, you can when using new enough sort; 8.4 is rather old these days, and while there HAVE been sort bug fixes in the meantime, they are for rather obscure corner cases and not for your issue). $ printf 'CC =3D aCC\nCC =3D cc\nCCFLAGS =3D\nCC =3D gcc\n' | sort --debu= g sort: using =E2=80=98en_US.UTF-8=E2=80=99 sorting rules CC =3D aCC ________ CC =3D cc _______ CCFLAGS =3D _________ CC =3D gcc ________ I'm guessing that on your CentOS box, your locale is set to en_US.UTF-8, or some similar locale which collates case-insensitively and ignores punctuation. In such a collation sequence, you are comparing 'ccflags' vs. 'ccgcc', and the final output order is correct. > =E2=80=A6 the 3rd line is out-of-order. In comparison, sort (GNU coreu= tils) 8.14 > in cygwin yields: The version of sort makes no difference; rather, it is entirely up to the locale (and by the way, cygwin now ships with 8.23, so you may want to upgrade); on your cygwin box, I'm guessing that you are using the C locale. And even if you are using the en_US locale there, you must remember that the cygwin locale definitions come from Windows, not glibc, and therefore may differ in what the two locale writers thought would make sense (that is, while the glibc en_US locale ignores punctuation, maybe the Windows en_US locale does not). At any rate, on your CentOS box, you can force the C locale to get the same behavior as cygwin seemed to give by default: $ printf 'CC =3D aCC\nCC =3D cc\nCCFLAGS =3D\nCC =3D gcc\n' | LC_ALL=3DC = sort --debug sort: using simple byte comparison CC =3D aCC ________ CC =3D cc _______ CC =3D gcc ________ CCFLAGS =3D _________ Therefore, I'm closing this as not a bug, but feel free to respond if you have further comments or questions. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --I6SxePOslhIloMRRFMDnjMOhkAPfl3Llx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUUWvnAAoJEKeha0olJ0Nq/7sIALAcc3MhjmAhUaRYTPu2aYAe 4UuKZYzH0RRtp/M9BtlR3W26HG1LXZRyFZ9lJOYugIRUxpP4wA+HISOMfTzwG72Z cv+7ySy3itQI40Z6xiXwbHAgaf0Xkf94zB/tydKlkknur8mh/qJ6hvBqjEG3UP15 /ZiV8uwuCMqFVsGzW9SMDvjhVAIgSEPc31BSj9mQPIsXGFMdu2ZXhl92l1Az+4PU aMB6ayS9kPsQbHoqREHq8ySQ9Sx7/5YRr/+P2jkuW8RgOP8kdkOD5djWtu6H79Q3 UCMXnW6jOdiVz8J+3OYigtqJ8syFafyG0sjtnFPVYfI28bu9MMAeGCF7rH1S/Ks= =0tiW -----END PGP SIGNATURE----- --I6SxePOslhIloMRRFMDnjMOhkAPfl3Llx-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 29 18:41:29 2014 Received: (at 18893) by debbugs.gnu.org; 29 Oct 2014 22:41:29 +0000 Received: from localhost ([127.0.0.1]:39456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xjbvl-0008HV-ER for submit@debbugs.gnu.org; Wed, 29 Oct 2014 18:41:29 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:63912) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xjbvh-0008H9-As for 18893@debbugs.gnu.org; Wed, 29 Oct 2014 18:41:25 -0400 Received: from [192.168.1.10] (pD956529F.dip0.t-ipconnect.de [217.86.82.159]) by mrelayeu.kundenserver.de (node=mreue103) with ESMTP (Nemesis) id 0McPxo-1XRwYI0r1k-00HhFC; Wed, 29 Oct 2014 23:41:18 +0100 Message-ID: <54516D0D.4060100@bernhard-voelker.de> Date: Wed, 29 Oct 2014 23:41:17 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Michael Yang , 18893@debbugs.gnu.org Subject: Re: bug#18893: Bug with Gnu sort program in coreutils 8.4 References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:YlnoETfWt75r8+LTPIxqBl7YeXYr2t7rBRU2GacZaeL oH74JVmShILXsGNEUAPj1GbiJTRwWUWgxC5QUSq/cjn6KPbxnd RugcSv3dGkmOl+LQqbEg+mijhiJshrcZYlJXLA3Wj+BkFM854X Ps8jfJTU6byzv7hsgwNUSdmjk+Cc/nYERMIlhdq+W5EBw0zRsi AixTuI7chFB1exLYT6Oh8gYdwEKJER0dT2OZxRwGUbbdwUkf5n scZFO6AG1AX4qQVonjJQn/WgJ1KkwFZSvOqnajnDK/nITAm3O0 ZHuEuVNKBWln2pQdIhPwUHNAvg9RNAFOqESMOBIg5SoFbxDxkJ pMDQg3H4J2dhu7T2wyxkE3Zs32TILgCG+Pc2m8DGZ X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18893 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tag 18893 notabug thanks On 10/29/2014 10:58 PM, Michael Yang wrote: > sort (GNU coreutils) 8.4 yields: > > CC = aCC > CC = cc > CCFLAGS = > CC = gcc Newer builds of sort include a --debug flag that show you what is going on: $ printf "CC = gcc\nCC = aCC\nCCFLAGS =\nCC = cc\n" | src/sort --debug src/sort: using ‘en_US.UTF-8’ sorting rules CC = aCC ________ CC = cc _______ CCFLAGS = _________ CC = gcc ________ versus $ printf "CC = gcc\nCC = aCC\nCCFLAGS =\nCC = cc\n" | LC_ALL=C src/sort --debug src/sort: using simple byte comparison CC = aCC ________ CC = cc _______ CC = gcc ________ CCFLAGS = _________ You have hit an FAQ: https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-not-sort-in-normal-order_0021 Your current locale has chosen a collation sequence that ignores blanks and the equal sign, so sort is sorting correctly. Set LC_ALL in the environment of sort to a different locale if you want bytewise sorting. Have a nice day, Berny From unknown Mon Jun 23 11:26:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 27 Nov 2014 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator