Bug 116779 - tar --diff mishandles certain sparse files
tar --diff mishandles certain sparse files
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: tar (Show other bugs)
1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-24 21:25 EST by Robert Nichols
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-09 08:39:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Robert Nichols 2004-02-24 21:25:50 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.0.2)
Gecko/20021216

Description of problem:
When running "tar --diff" with a tar archive created with the
"--sparse" option and the comparison fails (legitimately) on a sparse
file containing certain data patterns, tar loses synchronization in
the archive file.  Correct processing of subsequent files in the
archive is uncertain due to the loss of synchronization.

The steps shown below reliably reproduce the problem on a file system
with a 4K block size.

Version-Release number of selected component (if applicable):
tar-1.13.25-12

How reproducible:
Always

Steps to Reproduce:
1. $ echo hello | dd of=testfile bs=1k seek=5  #create sparse file
2. $ tar -cSf test.tar testfile #create archive with -S (--sparse)
3. $ echo junk | dd of=testfile bs=1k seek=4  #corrupt the file
4. $ tar -df test.tar  #compare with archive
    

Actual Results:  Messages from tar:
testfile: Mod time differs
testfile: Could only read 5 of 512 bytes
tar: Skipping to next header
tar: Error exit delayed from previous errors


Expected Resuults:  These messages from tar:
testfile: Mod time differs
testfile: Size differs


Additional info:

Same bug present in tar-1.13.25-4.7.1 (Red Hat Linux 7.1).
Comment 1 Peter Vrabec 2004-11-03 06:59:28 EST
I've tryed newer version of tar from upstream.
What do u thing about this results, satisfactory?

$ echo hello | dd of=testfile bs=1k seek=5
0+1 records in
0+1 records out
$ tar -cSf test.tar testfile
$ echo junk | dd of=testfile bs=1k seek=4
0+1 records in
0+1 records out
$ tar -df test.tar
testfile: Mod time differs
testfile: File fragment at 4096 is not a hole
$ tar --version
tar (GNU tar) 1.14
Copyright (C) 2004 Free Software Foundation, Inc.

Comment 2 Robert Nichols 2004-11-03 09:43:37 EST
That appears quite promising.  In rechecking the bahavior of
tar-1.13.25-12, I just discovered that the details of the error
messages depend on whether the tar executable has been prelinked.
My original report was for a tar binary that was _not_ prelinked.
With a prelinked tar I do not see the "Skipping to next header" or
"Error exit delayed ..." messages.

If you get the same results with and without prelinking, then
I'd say it is very likely the bug has been fixed.

Note You need to log in before you can comment on or make changes to this bug.