Bug 581045 - 'download' command corrupts very large files
'download' command corrupts very large files
Status: CLOSED NOTABUG
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-09 17:38 EDT by Richard W.M. Jones
Modified: 2010-05-15 12:30 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-15 12:30:11 EDT
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 Richard W.M. Jones 2010-04-09 17:38:41 EDT
Description of problem:

Not entirely sure about this one, but I thought I observed a download
of a very large device producing a corrupt local file.

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

1.3.1

How reproducible:

?

Steps to Reproduce:

Get md5 of some large (> 4 GB) device within an image :-

  guestfish --ro -a disk.img run : mkmountpoint /foo : checksum md5 /../dev/vda1

Download same device and checksum it :-

  guestfish --ro -a disk.img run : download /dev/vda1 local.img
  md5sum local.img

Actual results:

Difference found in a 10 GB image near to the 4 GB point.

Expected results:

Obviously there should be no difference.

Additional info:
Comment 1 Richard W.M. Jones 2010-05-12 11:35:07 EDT
Since we fixed another bug you can no longer use /.. to escape
from the appliance, so the reproducer from comment 0 no longer
works.

Instead do this with guestfish >= 1.3:

$ virt-list-partitions -hl /path/to/disk.img
/dev/sda1 ntfs 100.0M
/dev/sda2 ntfs 15.9G

Choose a large (> 4 GB) partition or LV, and then do:

$ guestfish --ro -a /path/to/disk.img run : checksum-device md5 /dev/sda2
7585d6e5fd2f7608ded54106dac0cc59

Then repeatedly download and checksum:

$ guestfish --ro -a /path/to/disk,img run : download /dev/sda2 local.img
$ md5sum local.img

repeating these last two commands until the checksum does not
match the first checksum.
Comment 2 Richard W.M. Jones 2010-05-15 08:48:33 EDT
I ran some very long tests on my machine, comparing the known
good disk image with subsequent downloads that were failing.

Comparative results are below (output from 'cmp -l' command -
the first number is the offset and the second and third numbers
are the good and bad bytes at this offset, in octal):

[image 1]
 4484845765 215 205
11416690693 234 334

[image 2]
16850120709 207 307
16850120773  47 147

[image 3]
16142352581 230 220

Based on this, I believe this is more likely to be a bit error
in the memory of my test machine.

I am continuing to perform the tests on other machines.
Comment 3 Richard W.M. Jones 2010-05-15 12:30:11 EDT
I cannot reproduce this on any other machine apart
from my first test machine.  Damn, memory error :-(
For now I am closing this as NOTABUG, please feel
free to reopen if it is ever reproduced.

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