From owner-freebsd-ports Wed Aug 14 6:16: 5 2002 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7DF8D37B400; Wed, 14 Aug 2002 06:15:58 -0700 (PDT) Received: from bilver.wjv.com (user38.net339.fl.sprint-hsd.net [65.40.24.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6DF043E42; Wed, 14 Aug 2002 06:15:57 -0700 (PDT) (envelope-from bv@bilver.wjv.com) Received: from bilver.wjv.com (localhost [127.0.0.1]) by bilver.wjv.com (8.12.5/8.12.5) with ESMTP id g7EDFtOo078851; Wed, 14 Aug 2002 09:15:55 -0400 (EDT) (envelope-from bv@bilver.wjv.com) Received: (from bv@localhost) by bilver.wjv.com (8.12.5/8.12.5/Submit) id g7EDFtx5078850; Wed, 14 Aug 2002 09:15:55 -0400 (EDT) Date: Wed, 14 Aug 2002 09:15:55 -0400 From: Bill Vermillion To: stable@FreeBSD.ORG, ports@FreeBSD.ORG Subject: Re: A but in Zoo Message-ID: <20020814131555.GA78822@wjv.com> References: <20020814114442.GA77130@wjv.com> <20020814130031.GA58489@falcon.midgard.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020814130031.GA58489@falcon.midgard.homeip.net> User-Agent: Mutt/1.3.25i Organization: W.J.Vermillion / Orlando - Winter Park Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org While humming that old rock song Yackety Yacc - Dont Awk Back Erik Trulsson sang or SED something like this: > On Wed, Aug 14, 2002 at 07:44:42AM -0400, Bill Vermillion wrote: > > > Date: Tue, 13 Aug 2002 16:02:26 +0200 > > > From: > > > Subject: RE: Bug in Zoo? Or is it in ls or ffs? > > > Is this not a bug in ls or ffs as well then? > > > Regardless of what Zoo does, should not the OS remain sane? [lucretia deletia snips away] > > > Although I've never used zoo, it's probably a bug there. > > Hm. I've been using zoo since about 1989 - the old 1.x days. > > I've always had it on a system here as I had many old files > > I'd pull apart. I've used it dating back to Sys V.2's and I use > > it for working under MS things too. It works for easily > > transporting files from a multitude of OSes. > > I just checked on about 6 systems I have access to, 4.6, 4.5, 4.2 > > and a 4.0, and they all exhibit the same behaviour. I don't know > > when it changed, but the sources to zoo have not changed since > > the early 1990s, and the sources when extracted all show > > a day of May 1, 1993. > > > > So I'm suspecting that something changed in the 4.x series. > > I don't have anything prior to 4.x to check on. > > > > I've not created any zoo archives in the past couple of years but > > it used to work, and I've used it on many platforms. > > Since the code is the same and has not changed since Rahul Dhesi > > wrote the last version in 1991 - would it not stand to reason then > > that something has changed in FreeBSD since the 4.x came out. > > Could someone who has a pre 4.x system check this? > A quick investigation indicates that this is a bug in zoo. > It presumably was not exposed on earlier versions of FreeBSD. > To be more precise the function zootrunc() which can be found at the > end of the file bsd.c contains a line > seekpos = lseek(fd, 0L, SEEK_CUR); > This should be changed to > > seekpos = lseek(fd, (off_t) 0L, SEEK_CUR); > The second argument to lseek should be a 64-bit value on > FreeBSD, but here it is called with a long which is a 32-bit > value on the i386. This means that the upper 32 bits of the > argument that lseek sees will contain garbage. In this case > they always seem to have the value 0x00000001 which leads to > the observed behaviour of a sparse file with size ~4GB. That explains that. The sources date back to the era when no one was using 64-bits. I had a nagging idea that may be it - but I'm not a c-coder. Thanks. Bill -- Bill Vermillion - bv @ wjv . com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message