Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Aug 2002 09:15:55 -0400
From:      Bill Vermillion <bv@wjv.com>
To:        stable@FreeBSD.ORG, ports@FreeBSD.ORG
Subject:   Re: A but in Zoo
Message-ID:  <20020814131555.GA78822@wjv.com>
In-Reply-To: <20020814130031.GA58489@falcon.midgard.homeip.net>
References:  <bulk.34340.20020814013822@hub.freebsd.org> <20020814114442.GA77130@wjv.com> <20020814130031.GA58489@falcon.midgard.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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: <Danny.Carroll@mail.ing.nl>
> > > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020814131555.GA78822>