Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jun 1999 13:29:56 -0600 (MDT)
From:      Jonathon Doran <doranj@Colorado.EDU>
To:        freebsd-questions@freebsd.org
Subject:   Bug in tar/FreeBSD
Message-ID:  <199906221929.NAA26989@ucsu.Colorado.EDU>

next in thread | raw e-mail | index | archive | help
To followup on this (in case its of general interest).  I've located
the problem in tar, and have a workaround.

There is a race condition in tar (not hard to believe).  Tar will stat
a file, obtaining info like file size, open it, and then save it into
internal buffers which are flushed later.

Files which are changing frequently (like the pseudo-files in /proc) will
cause the stat to return one file size, but tar will be unable to read all
the data (in the case where the process shrinks).  Tar will complain, and
attept to pad the rest of the file with zeroes.

OK so far, but tar allocates an extra buffer when this error occurs, and
thus writes an extra record of zeroes into the archive.  The default
behavior of tar is to stop when this record is seen (often signals end of
tape).  Thus, no read errors are reported, and the entire archive is not
read (or listed).

For existing tapes, you can list/extract the rest by ignoring these zero
blocks (add -i to the flags).  A better long-term solution is to remove
the extra buffer alloc from create.c.

Given that this is GNU code, I have no idea who to contact on this.  I'm
willing to cough up a patch if desired, otherwise use -i.

Jon Doran


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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