From owner-freebsd-stable@FreeBSD.ORG Wed Feb 10 10:49:12 2010 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28B2710656BD for ; Wed, 10 Feb 2010 10:49:12 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id DA51C8FC08 for ; Wed, 10 Feb 2010 10:49:11 +0000 (UTC) Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NfA86-0006qT-A3 for stable@freebsd.org; Wed, 10 Feb 2010 13:49:10 +0300 Date: Wed, 10 Feb 2010 13:49:05 +0300 From: Ruslan Ermilov To: stable@freebsd.org Message-ID: <20100210104904.GA85373@edoofus.dev.vega.ru> 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> Cc: 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 10:49:12 -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 I bet you're using some non-C locale for LC_NUMERIC. What does "locale" output tell you? > % 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 > > at least -g does what is expected and I can work around this for the time being. Here's bsdsort > > % find a b c -ls|bsdsort -nk7,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 > > and this is on Solaris 8 > > % find a b c -ls|sort -nk7,7 > 546728 16 -rw-r--r-- 1 spoerul xxx 819200 Feb 10 09:49 c > 546727 16 -rw-r--r-- 1 spoerul xxx 5242880 Feb 10 09:48 b > 546724 16 -rw-r--r-- 1 spoerul xxx 10485760 Feb 10 09:48 a > > It even occured to me, that we don't have a sort regression suite under > tools/regression. Anyone know a place to find one with a suitable license? > > Regards, > Uli > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer