From owner-freebsd-hackers Fri Mar 24 15:56:37 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id A9D9537B796 for ; Fri, 24 Mar 2000 15:56:33 -0800 (PST) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 24 Mar 2000 23:56:33 +0000 (GMT) Date: Fri, 24 Mar 2000 23:56:32 +0000 From: David Malone To: Luke Hollins Cc: freebsd-hackers@freebsd.org Subject: Re: top sorting error Message-ID: <20000324235632.A5605@walton.maths.tcd.ie> References: <20000324200421.A59323@bell.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000324200421.A59323@bell.maths.tcd.ie>; from dwmalone@maths.tcd.ie on Fri, Mar 24, 2000 at 08:04:21PM +0000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Mar 24, 2000 at 08:04:21PM +0000, David Malone wrote: > It seems to be an overflow problem - top was reilying on things > fitting into a int, which were 64 bits long. It looks like someone > ran into the problem before for the %cpu field, and fixed it in a > different way. This patch below should fix it regardless of the > type of the variable. I notice this was fixed in version 1.28 by bde, though he only changed the check on the 64 bit field. The commit message says: Fixed sorting on time. On i386's, time differences of more than 2147 seconds caused overflow. Use a type-safe but slightly slower comparison. Comparisons for other fields are still fragile. Maybe this could be MFC'ed into RELENG_3? My patch would make all the comparisons in the robust, but slightly slower way. David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message