From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 23 08:32:27 2012 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A4C627C0 for ; Sun, 23 Dec 2012 08:32:27 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) by mx1.freebsd.org (Postfix) with ESMTP id 7CB578FC0C for ; Sun, 23 Dec 2012 08:32:27 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id qBN8WLW4034068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 23 Dec 2012 00:32:21 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id qBN8WLBs034067 for hackers@FreeBSD.org; Sun, 23 Dec 2012 00:32:21 -0800 (PST) (envelope-from jmg) Date: Sun, 23 Dec 2012 00:32:20 -0800 From: John-Mark Gurney To: hackers@FreeBSD.org Subject: looking for someone to fix humanize_number (test cases included) Message-ID: <20121223083220.GL1563@funkthat.com> Mail-Followup-To: hackers@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sun, 23 Dec 2012 00:32:21 -0800 (PST) X-Mailman-Approved-At: Sun, 23 Dec 2012 12:37:07 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2012 08:32:27 -0000 I'm looking for a person who is interested in fixing up humanize_number. The other day I copied some data from a 7.2-R box to a 9.1-stable box and did a du -shc and a du-skc to check the results... I noticed the -h run dropped from 11M to 10M, which I thought was weird... Then I looked at the results from the -k run, but the new machine had a larger result (I copied from UFS to ZFS)... It turns out that humanize_number was broken when doing rounding... No longer does humanize_number round up at .5 or more of the prefix.. So I decided to write a test program to test the output, and now I'm even more surprised by the output... Neither 7.2-R nor 10-current give what I expect are the correct results... Feel free to take a look at the test program posted to: http://people.freebsd.org/~jmg/humanize_numbers/ The .c contains what I think the output should be. So far the bugs I know of: 1) rounding is incorrect (started this whole search) 2) buffer calculation is incorrect in some cases, index 11 should fit but doesn't 3) some cases zero is returned though it isn't zero, more like 0T for 512 G (indexes 16, 17, 22, 23) 4) man page is missing required sys/types.h include I'll work to get the code into the tree once we get it in a good state. Please cc me as I'm not subscribed to -hackers. Thanks. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."