From owner-freebsd-stable@FreeBSD.ORG Wed Feb 10 09:18:56 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5A3A1065676 for ; Wed, 10 Feb 2010 09:18:56 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta06.emeryville.ca.mail.comcast.net (qmta06.emeryville.ca.mail.comcast.net [76.96.30.56]) by mx1.freebsd.org (Postfix) with ESMTP id 79C6D8FC1D for ; Wed, 10 Feb 2010 09:18:56 +0000 (UTC) Received: from omta20.emeryville.ca.mail.comcast.net ([76.96.30.87]) by qmta06.emeryville.ca.mail.comcast.net with comcast id g9Jw1d0031smiN4A69Jwkd; Wed, 10 Feb 2010 09:18:56 +0000 Received: from koitsu.dyndns.org ([98.248.46.159]) by omta20.emeryville.ca.mail.comcast.net with comcast id g9Jw1d0023S48mS8g9Jw7Y; Wed, 10 Feb 2010 09:18:56 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 0B2701E3033; Wed, 10 Feb 2010 01:18:55 -0800 (PST) Date: Wed, 10 Feb 2010 01:18:55 -0800 From: Jeremy Chadwick To: freebsd-stable@freebsd.org Message-ID: <20100210091854.GA62983@icarus.home.lan> References: <20100210085814.GE9748@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100210085814.GE9748@acme.spoerlein.net> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: numeric sort(1) is broken on -STABLE X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 09:18:56 -0000 On Wed, Feb 10, 2010 at 09:58:14AM +0100, Ulrich Spörlein wrote: > Hi guys, > > not sure if this is a pilot error, but it seems to me that gnu sort -n > is broken on at least -STABLE (couldn't test -CURRENT yet). > > It somehow does not manifest when using a simple list and sorting on a > specific column, but it always happens to me when using it in > combination with find(1). > > % truncate -s10m a; truncate -s5m b; truncate -s800k c > % find a b c -ls|sort -nk7,7 > 8 64 -rw-r--r-- 1 uqs wheel 10485760 Feb 10 09:13 a > 10 64 -rw-r--r-- 1 uqs wheel 5242880 Feb 10 09:13 b > 12 64 -rw-r--r-- 1 uqs wheel 819200 Feb 10 09:13 c > % find a b c -ls|sort -gk7,7 > 12 64 -rw-r--r-- 1 uqs wheel 819200 Feb 10 09:13 c > 10 64 -rw-r--r-- 1 uqs wheel 5242880 Feb 10 09:13 b > 8 64 -rw-r--r-- 1 uqs wheel 10485760 Feb 10 09:13 a I can't repro this on 8.0-STABLE or 7.2-STABLE. /usr/bin/sort on these machines is what comes with the base system (which is GNU coreutils sort). Maybe your issue is related to locale(1) variables? $ uname -a FreeBSD icarus.home.lan 8.0-STABLE FreeBSD 8.0-STABLE #0: Sat Jan 16 17:48:04 PST 2010 root@icarus.home.lan:/usr/obj/usr/src/sys/X7SBA_RELENG_8_amd64 amd64 $ truncate -s10m a; truncate -s5m b; truncate -s800k c $ find a b c -ls | /usr/bin/sort -nk7,7 3078 1 -rw------- 1 jdc users 819200 10 Feb 01:11 c 3077 1 -rw------- 1 jdc users 5242880 10 Feb 01:11 b 3076 1 -rw------- 1 jdc users 10485760 10 Feb 01:11 a $ find a b c -ls | /usr/bin/sort -gk7,7 3078 1 -rw------- 1 jdc users 819200 10 Feb 01:11 c 3077 1 -rw------- 1 jdc users 5242880 10 Feb 01:11 b 3076 1 -rw------- 1 jdc users 10485760 10 Feb 01:11 a $ /usr/bin/sort --version sort (GNU coreutils) 5.3.0-20040812-FreeBSD Written by Mike Haertel and Paul Eggert. Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ locale LANG=en_GB.ISO8859-1 LC_CTYPE="en_GB.ISO8859-1" LC_COLLATE=C LC_TIME="en_GB.ISO8859-1" LC_NUMERIC="en_GB.ISO8859-1" LC_MONETARY="en_GB.ISO8859-1" LC_MESSAGES="en_GB.ISO8859-1" LC_ALL= $ uname -a FreeBSD horus.parodius.com 7.2-STABLE FreeBSD 7.2-STABLE #0: Sat Jan 9 07:52:27 PST 2010 root@horus.sc1.parodius.com:/usr/obj/usr/src/sys/PDSMI_PLUS_RELENG_7_amd64 amd64 $ truncate -s10m a; truncate -s5m b; truncate -s800k c $ find a b c -ls | /usr/bin/sort -nk7,7 406132 1 -rw------- 1 jdc users 819200 10 Feb 01:13 c 406131 1 -rw------- 1 jdc users 5242880 10 Feb 01:13 b 406130 1 -rw------- 1 jdc users 10485760 10 Feb 01:13 a $ find a b c -ls | /usr/bin/sort -gk7,7 406132 1 -rw------- 1 jdc users 819200 10 Feb 01:13 c 406131 1 -rw------- 1 jdc users 5242880 10 Feb 01:13 b 406130 1 -rw------- 1 jdc users 10485760 10 Feb 01:13 a $ /usr/bin/sort --version sort (GNU coreutils) 5.3.0-20040812-FreeBSD Written by Mike Haertel and Paul Eggert. Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ locale LANG=en_GB.ISO8859-1 LC_CTYPE="en_GB.ISO8859-1" LC_COLLATE=C LC_TIME="en_GB.ISO8859-1" LC_NUMERIC="en_GB.ISO8859-1" LC_MONETARY="en_GB.ISO8859-1" LC_MESSAGES="en_GB.ISO8859-1" LC_ALL= -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |