From unknown Sat Jun 21 10:39:26 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#23214 <23214@debbugs.gnu.org> To: bug#23214 <23214@debbugs.gnu.org> Subject: Status: Possible bug in sort -g Reply-To: bug#23214 <23214@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:39:26 +0000 retitle 23214 Possible bug in sort -g reassign 23214 coreutils submitter 23214 Matthijs Nescio severity 23214 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 04 09:17:53 2016 Received: (at submit) by debbugs.gnu.org; 4 Apr 2016 13:17:53 +0000 Received: from localhost ([127.0.0.1]:50687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1an4O8-0000Yo-W2 for submit@debbugs.gnu.org; Mon, 04 Apr 2016 09:17:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48139) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1an3Hf-0007Ni-QE for submit@debbugs.gnu.org; Mon, 04 Apr 2016 08:07:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1an3HV-0004dq-W1 for submit@debbugs.gnu.org; Mon, 04 Apr 2016 08:07:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.6 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RECEIVED_FROM_WINDOWS_HOST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an3HV-0004dm-Sb for submit@debbugs.gnu.org; Mon, 04 Apr 2016 08:06:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an3HR-0002sx-Gy for bug-coreutils@gnu.org; Mon, 04 Apr 2016 08:06:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1an3HO-0004cq-8R for bug-coreutils@gnu.org; Mon, 04 Apr 2016 08:06:53 -0400 Received: from dub004-omc3s18.hotmail.com ([157.55.2.27]:53088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an3HO-0004cb-0P for bug-coreutils@gnu.org; Mon, 04 Apr 2016 08:06:50 -0400 Received: from DUB115-W95 ([157.55.2.9]) by DUB004-OMC3S18.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 4 Apr 2016 04:46:46 -0700 X-TMN: [WRkKoz+OFoQ8PYWuINbEeIL8zVuYy0Ik] X-Originating-Email: [matthijs_1971@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_1b101e90-ab0f-4ee3-982d-d567f6f5092c_" From: Matthijs Nescio To: "bug-coreutils@gnu.org" Subject: Possible bug in sort -g Date: Mon, 4 Apr 2016 13:46:46 +0200 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 04 Apr 2016 11:46:46.0448 (UTC) FILETIME=[AA8B3300:01D18E67] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 04 Apr 2016 09:17:52 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (---) --_1b101e90-ab0f-4ee3-982d-d567f6f5092c_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi=2C I seem to have detected a bug in sort. Can you confirm? ~ $=20 ~ $ sort --version sort (GNU coreutils) 8.4 Copyright (C) 2010 Free Software Foundation=2C Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY=2C to the extent permitted by law. Written by Mike Haertel and Paul Eggert. ~ $ cat test.txt | sort -g 2e-1 2e-1 2e-1 2e-1 1.0e-1 1.0e-2 1.0e-2 1.0e-3 1.0e-4 2.0e-1 2.0e-2 2.0e-2 2.0e-2 2.0e-2 3.0e-2 3.0e-2 3.0e-2 3.0e-2 3.0e-2 3.0e-2 15 2e+1 2e+1 2e+1 2e+1 115 119 150 2e+2 2e+2 2e+2 2e+2 2e+3 2e+3 2e+3 2e+3 ~ $ cat test.txt 3.0e-2 1.0e-4 2.0e-2 3.0e-2 1.0e-1 2.0e-1 3.0e-2 1.0e-2 2.0e-2 3.0e-2 1.0e-2 2.0e-2 3.0e-2 1.0e-3 2.0e-2 3.0e-2 15 119 115 150 2e+1 2e-1 2e+3 2e+2 2e+1 2e-1 2e+3 2e+2 2e+1 2e-1 2e+3 2e+2 2e+1 2e-1 2e+3 2e+2 ~ $ =20 I think this result is never what anybody would expect=3B 2e-1 is larger th= an 1.0e-1 and 1.0e-4 is smaller than 1.0e-1. The above is running on Ubuntu 14.04. On a Cygwin installation the result i= s fine. Thank you=2C kind regards=2C Matthijs. = --_1b101e90-ab0f-4ee3-982d-d567f6f5092c_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi=2C

I seem to have dete= cted a bug in sort. Can you confirm?

~ $
~ $ sort --version
s= ort (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation=2C I= nc.
License GPLv3+: GNU GPL version 3 or later <=3Bhttp://gnu.org/lice= nses/gpl.html>=3B.
This is free software: you are free to change and r= edistribute it.
There is NO WARRANTY=2C to the extent permitted by law.<= br>
Written by Mike Haertel and Paul Eggert.
~ $ cat test.txt | sort = -g

2e-1
2e-1
2e-1
2e-1
1.0e-1
1.0e-2
1.0e-2
1.0= e-3
1.0e-4
2.0e-1
2.0e-2
2.0e-2
2.0e-2
2.0e-2
3.0e-23.0e-2
3.0e-2
3.0e-2
3.0e-2
3.0e-2
15
2e+1
2e+1
2= e+1
2e+1
115
119
150
2e+2
2e+2
2e+2
2e+2
2e+32e+3
2e+3
2e+3
~ $ cat test.txt
3.0e-2
1.0e-4
2.0e-2
= 3.0e-2
1.0e-1
2.0e-1
3.0e-2
1.0e-2
2.0e-2
3.0e-2
1.0e-= 2
2.0e-2
3.0e-2
1.0e-3
2.0e-2
3.0e-2
15
119
115
= 150
2e+1
2e-1
2e+3
2e+2
2e+1
2e-1
2e+3
2e+2
2e+1=
2e-1
2e+3
2e+2
2e+1
2e-1
2e+3
2e+2

~ $ =3B=


I think this result is never what anybody would expect=3B 2e-1= is larger than 1.0e-1 and =3B 1.0e-4 is smaller than 1.0e-1.

Th= e above is running on Ubuntu 14.04. On a Cygwin installation the result is = fine.

Thank you=2C kind regards=2C Matthijs.

= --_1b101e90-ab0f-4ee3-982d-d567f6f5092c_-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 04 10:55:05 2016 Received: (at 23214) by debbugs.gnu.org; 4 Apr 2016 14:55:05 +0000 Received: from localhost ([127.0.0.1]:51221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1an5uD-0003R3-3S for submit@debbugs.gnu.org; Mon, 04 Apr 2016 10:55:05 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:53171) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1an5uB-0003QV-CO for 23214@debbugs.gnu.org; Mon, 04 Apr 2016 10:55:03 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4BA1B160D97; Mon, 4 Apr 2016 07:54:57 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id IFwPcerNyCJd; Mon, 4 Apr 2016 07:54:51 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E35E616124F; Mon, 4 Apr 2016 07:54:51 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id QujoN4UNRzWZ; Mon, 4 Apr 2016 07:54:51 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id CB7A6160D97; Mon, 4 Apr 2016 07:54:51 -0700 (PDT) Subject: Re: bug#23214: Possible bug in sort -g To: Matthijs Nescio , 23214@debbugs.gnu.org References: From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <57028038.7060901@cs.ucla.edu> Date: Mon, 4 Apr 2016 07:54:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 (-) X-Debbugs-Envelope-To: 23214 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) On 04/04/2016 04:46 AM, Matthijs Nescio wrote: > I seem to have detected a bug in sort. Can you confirm? Certainly there is a problem in your 'sort' installation. Perhaps it depends on the locale? Try setting LC_ALL=C in your environment. I cannot reproduce the problem with coreutils 8.4 built on Fedora 23 x86-64, nor on Ubuntu 12.04.5 LTS x86 (this is the oldest Ubuntu release that is still supported). Please try building coreutils 8.4 on your platform, from source, and using that. ftp://ftp.gnu.org/gnu/coreutils/coreutils-8.4.tar.gz You may have to edit lib/stdio.h by hand, after it's built, to remove its declaration of 'gets'. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 04 11:54:11 2016 Received: (at 23214-done) by debbugs.gnu.org; 4 Apr 2016 15:54:11 +0000 Received: from localhost ([127.0.0.1]:51280 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1an6pP-0004pX-LV for submit@debbugs.gnu.org; Mon, 04 Apr 2016 11:54:11 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1an6pO-0004pJ-Im for 23214-done@debbugs.gnu.org; Mon, 04 Apr 2016 11:54:11 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B761F160D97; Mon, 4 Apr 2016 08:54:03 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ZUeK_qzUSmrV; Mon, 4 Apr 2016 08:54:03 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 18CCF161249; Mon, 4 Apr 2016 08:54:03 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id V_TbBq8LQXEz; Mon, 4 Apr 2016 08:54:03 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 017C5160D97; Mon, 4 Apr 2016 08:54:03 -0700 (PDT) Subject: Re: bug#23214: Possible bug in sort -g To: Matthijs Nescio References: <57028038.7060901@cs.ucla.edu> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <57028E1A.8020201@cs.ucla.edu> Date: Mon, 4 Apr 2016 08:54:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 (-) X-Debbugs-Envelope-To: 23214-done Cc: 23214-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) On 04/04/2016 08:31 AM, Matthijs Nescio wrote: > Hi, > > Indeed, setting the environment variable LC_ALL to C solves the > problem. Thank you. I am a satisfied long-time user of sort so I was > flabbergasted. Yes, the locale can affect 'sort' in funny ways. Thanks for following up. Closing the bug report. From unknown Sat Jun 21 10:39:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 03 May 2016 11:24:03 +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