Bug 581045 - 'download' command corrupts very large files
Summary: 'download' command corrupts very large files
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-09 21:38 UTC by Richard W.M. Jones
Modified: 2010-05-15 16:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-05-15 16:30:11 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2010-04-09 21:38:41 UTC
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 15:35:07 UTC
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 12:48:33 UTC
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 16:30:11 UTC
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.