From owner-freebsd-ports Tue Aug 22 2:22:11 2000 Delivered-To: freebsd-ports@freebsd.org Received: from trinity.skynet.be (trinity.skynet.be [195.238.2.38]) by hub.freebsd.org (Postfix) with ESMTP id 60A9937B43C for ; Tue, 22 Aug 2000 02:22:05 -0700 (PDT) Received: from [195.238.1.121] (brad.techos.skynet.be [195.238.1.121]) by trinity.skynet.be (Postfix) with ESMTP id 908E5181D7 for ; Tue, 22 Aug 2000 11:20:35 +0200 (MET DST) Mime-Version: 1.0 X-Sender: blk@pop.skynet.be Message-Id: Date: Tue, 22 Aug 2000 11:18:48 +0200 To: freebsd-ports@freebsd.org From: Brad Knowles Subject: spegla on systems with more than 2GB free and minfree > 0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Folks, I just ran into an interesting bug with this. It seems that line 731 of spegla.c (from spegla-1.1p4) does some math mixing longs & ints: if (f.f_bsize * f.f_bavail) < minfree) However, if the filesystem has more than 2GB free, this causes the multiplication to exceed the limits of a signed int, and wrap around to become negative. By default, minfree is zero (which is checked for earlier), so most people probably don't run into this (although they could get nasty surprises with filesystems filling up and potentially crashing their machines). Anyway, casting this to "long" didn't seem to do the job on my machine. Casting to "long long" seems to work fine. I've reported this to the author, but you might also want to consider a FreeBSD-specific patch for this problem. -- These are my opinions -- not to be taken as official Skynet policy ====================================================================== Brad Knowles, || Belgacom Skynet SA/NV Systems Architect, Mail/News/FTP/Proxy Admin || Rue Colonel Bourg, 124 Phone/Fax: +32-2-706.13.11/12.49 || B-1140 Brussels http://www.skynet.be || Belgium "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, Historical Review of Pennsylvania. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message