RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 739029 - virt-v2v fails first time on some guests: "hivex: ... trailing garbage at end of file"
Summary: virt-v2v fails first time on some guests: "hivex: ... trailing garbage at end...
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-v2v
Version: 6.2
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: rc
: ---
Assignee: Matthew Booth
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 960054
TreeView+ depends on / blocked
 
Reported: 2011-09-16 11:06 UTC by tingting zheng
Modified: 2013-05-23 21:14 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-05-08 08:30:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log file of conversion (4.59 KB, text/plain)
2011-09-16 11:06 UTC, tingting zheng
no flags Details
file "software" produced by running virt-cat (9.00 MB, application/octet-stream)
2011-09-16 11:35 UTC, tingting zheng
no flags Details
debug info of virt-v2v (16.68 MB, text/plain)
2011-09-20 05:08 UTC, tingting zheng
no flags Details
test-fd-mmap.c (2.10 KB, text/x-csrc)
2011-09-20 08:12 UTC, Richard W.M. Jones
no flags Details
test-hivex.c (1.43 KB, text/x-csrc)
2011-09-22 12:34 UTC, Richard W.M. Jones
no flags Details

Description tingting zheng 2011-09-16 11:06:24 UTC
Created attachment 523541 [details]
log file of conversion

Description of problem:
kvm winxp guest with sparse disk type can not be converted successfully the first time with virt-v2v

Version-Release number of selected component (if applicable):
virt-v2v-0.8.3-4.el6.x86_64
libguestfs-1.7.17-26.el6.x86_64
libvirt-0.9.4-11.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.Install a kvm winxp guest with sparse disk type
2.Use virt-v2v convert a guest to libvirt
# LIBGUESTFS_TRACE=1 virt-v2v -ic qemu+ssh://10.66.72.122/system -os default -b rhevm kvm-winxp-i386-test 2>&1 |tee kvm-winxp-i386-test.log


Actual results:
The guest can not be converted successfully the first time

Expected results:
The guest can be converted successfully the first time.
 
Additional info:
1.The error in log:details see the attachment.
hivex: /tmp/libguestfsctCDvc: trailing garbage at end of file (at 0x8ab000, after 2150 pages)
inspect_os: hivex_open: Operation not supported at /usr/share/perl5/vendor_perl/Sys/VirtConvert/GuestfsHandle.pm line 187.
 at /usr/bin/virt-v2v line 602
virt-v2v: Transferring storage volume kvm-winxp-i386-test.img: 6442450944 bytes

2.The error may occur several times,then it can susscss.After convert the kvm winxp guest successfully,when convert again then the error will not occur.

3.The kvm winxp guest with preallocated disk type can be converted successfully the first time.

4.Xen winxp guest can be converted successfully the first time.

Comment 2 Richard W.M. Jones 2011-09-16 11:17:58 UTC
Note the failure:

libguestfs: trace: filesize "/WINDOWS/system32/config/software"
libguestfs: trace: filesize = 9175040
libguestfs: trace: download "/WINDOWS/system32/config/software" "/dev/fd/12"
libguestfs: trace: download = 0
hivex: /tmp/libguestfsctCDvc: trailing garbage at end of file (at 0x8ab000, after 2150 pages)

Here is the code which is failing:

http://git.annexia.org/?p=libguestfs.git;a=blob;f=src/inspect.c;h=ec1a2a0b3d753d25549ecb0f8197f077a6045605;hb=refs/heads/stable-1.8#l1120
"download_to_tmp" calls "guestfs_download".  After the download returns
success we try to open the file with "hivex_open" which notices
corruption and prints the error above.

http://git.annexia.org/?p=libguestfs.git;a=blob;f=src/proto.c;h=490dcfd7a6135d5b37d2593ec50dfac26f8e87ca;hb=refs/heads/stable-1.8#l1043
"guestfs_download" is generated, but eventually calls
"guestfs___recv_file" in order to download the file.

"hivex_open" just opens the file and mmap's it.

The file size is 9175040 bytes == 0x8c0000.

Hivex reports the trailing garbage at 0x8ab000 which is
86016 bytes before the reported end of the file.

Comment 3 Richard W.M. Jones 2011-09-16 11:24:27 UTC
Tingting could you please get a copy of the hive
which is failing.

You can use this command:

  virt-cat -a /var/lib/libvirt/images/kvm-winxp-i386-test.img \
    /WINDOWS/system32/config/software > software

and then send the file "software" to me.

Comment 4 tingting zheng 2011-09-16 11:35:55 UTC
Created attachment 523544 [details]
file "software" produced by running virt-cat

Hi,Richard
I have run the following command
#virt-cat -a /var/lib/libvirt/images/kvm-winxp-i386-test.img \
    /WINDOWS/system32/config/software > software

And the file "software" has been attached.

Comment 5 Richard W.M. Jones 2011-09-16 12:23:40 UTC
What we need here is a full log of virt-v2v failing,
with the following two environment variables set:

  export HIVEX_DEBUG=1
  export LIBGUESTFS_DEBUG=1

This will produce a large amount of debug output.  I'm worried
that the amount of debug output will disturb the results
of the test, possibly making it unreproducible, but it's worth
trying.

 - - -

FWIW I cannot reproduce this problem here using the basic tools
like virt-inspector2 or some custom Perl code I have written.
I have not tried a full-blown virt-v2v run yet, but I will do so
later.

Comment 6 Richard W.M. Jones 2011-09-16 13:19:31 UTC
Just FYI I cannot reproduce this using virt-v2v either.

Comment 7 tingting zheng 2011-09-19 08:51:01 UTC
(In reply to comment #5)
> What we need here is a full log of virt-v2v failing,
> with the following two environment variables set:
> 
>   export HIVEX_DEBUG=1
>   export LIBGUESTFS_DEBUG=1
> 
> This will produce a large amount of debug output.  I'm worried
> that the amount of debug output will disturb the results
> of the test, possibly making it unreproducible, but it's worth
> trying.
> 
>  - - -
> 
> FWIW I cannot reproduce this problem here using the basic tools
> like virt-inspector2 or some custom Perl code I have written.
> I have not tried a full-blown virt-v2v run yet, but I will do so
> later.

Hi,Richard,
As you expected,I have tried to use virt-v2v with  HIVEX_DEBUG=1 LIBGUESTFS_DEBUG=1,but the error can not be reproduced any more.
Before to file this bug,I have tried to use virt-v2v to convert kvm-winxp-i386 guest on two hosts.
On one host,the error occured 3 times,and the fourth time it is converted successfully,when convert again the error did not occur.
On the other host,the error occured 2 times,and the third time it is converted successfully,when convert again the error did not occur.
I also meet this error when I convert esx4.1-winxp-i386 guest,but when I convert again it can convert successfully.

Comment 8 Richard W.M. Jones 2011-09-19 11:29:36 UTC
Does the error still occur even without the debug
environment variables?

Even if it doesn't occur any more, I would like to leave
this bug open for now in case it happens again for another
user.

Comment 9 tingting zheng 2011-09-20 01:57:32 UTC
(In reply to comment #8)
> Does the error still occur even without the debug
> environment variables?
> 
> Even if it doesn't occur any more, I would like to leave
> this bug open for now in case it happens again for another
> user.

This time the error didn't occur even without the debug environment variables.

Comment 10 tingting zheng 2011-09-20 05:04:07 UTC
Hi,Richard
The error occured when I use virt-v2v to convert esx3.5-win2003-x86_64,the debug info is attached:

export HIVEX_DEBUG=1
export LIBGUESTFS_DEBUG=1
[root@tzheng-linux images]#HIVEX_DEBUG=1 LIBGUESTFS_DEBUG=1 virt-v2v -ic esx://10.66.73.244/?no_verify=1  -o rhev  -n rhevm -os 10.66.90.115:/vol/v2v_manual/nfs_export esx3.5-win2003-x86_64 2>&1 | tee esx3.5-win2003-x86_64.log

Comment 11 tingting zheng 2011-09-20 05:08:43 UTC
Created attachment 523952 [details]
debug info of virt-v2v

The debug info of using virt-v2v to convert esx3.5-win2003-x86_64.

Comment 12 Richard W.M. Jones 2011-09-20 08:12:37 UTC
Created attachment 523970 [details]
test-fd-mmap.c

tzheng: please try the attached program.  Follow the instructions
at the top of the program.

Comment 13 tingting zheng 2011-09-20 09:49:12 UTC
(In reply to comment #12)
> Created attachment 523970 [details]
> test-fd-mmap.c
> 
> tzheng: please try the attached program.  Follow the instructions
> at the top of the program.

Tried the test program,there is no error in my machine.

Comment 14 Richard W.M. Jones 2011-09-20 09:50:47 UTC
Here is a special scratch build of libguestfs which
will capture the software hive from the guest:

  http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3650309

When run, this will print something like:

  SOFTWARE HIVE SAVED AS: /tmp/libguestfs123456

What you need to do is to run the debug test again
(see comment 5), capture the debug output, AND capture
the software hive.

I'm particularly interested in the failure case still.

Comment 15 Richard W.M. Jones 2011-09-20 09:56:59 UTC
Try this one instead:
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3650339

Comment 16 Denise Dumas 2011-09-20 16:42:47 UTC
Setting flags for 6.2 exception, although this should possibly be a blocker.

Comment 19 tingting zheng 2011-09-21 05:12:35 UTC
(In reply to comment #14)
> Here is a special scratch build of libguestfs which
> will capture the software hive from the guest:
> 
>   http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3650309
> 
> When run, this will print something like:
> 
>   SOFTWARE HIVE SAVED AS: /tmp/libguestfs123456
> 
> What you need to do is to run the debug test again
> (see comment 5), capture the debug output, AND capture
> the software hive.
> 
> I'm particularly interested in the failure case still.



Tried the new libguestfs build,howerver the bug can not be reproduced,I will try it when I meet the error again.

Comment 21 Richard W.M. Jones 2011-09-22 12:34:59 UTC
Created attachment 524400 [details]
test-hivex.c

I still can't reproduce this.

Here is another test program which you could try.  Read
the instructions at the top of the file first, and you
will probably need to change the first #define there too.

Comment 22 tingting zheng 2011-09-23 08:41:53 UTC
(In reply to comment #21)
> Created attachment 524400 [details]
> test-hivex.c
> 
> I still can't reproduce this.
> 
> Here is another test program which you could try.  Read
> the instructions at the top of the file first, and you
> will probably need to change the first #define there too.

Tried the test program with some xen,kvm windows guests,also vmware guests by copying the *-flat.vmdk file from esx servers,there is nothing goes wrong,just printing ok.

Comment 23 tingting zheng 2011-10-09 09:10:12 UTC
I tried about 30 times to reproduce the bug by converting different kinds of windows guests,however I can't reproduce the bug any more.

Comment 24 tingting zheng 2011-10-09 10:20:02 UTC
As comment 23,I can't reproduce the bug any more
How do we deal with this bug?
Thanks.

Comment 27 RHEL Program Management 2012-07-10 07:54:22 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 28 RHEL Program Management 2012-07-11 01:59:35 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 29 RHEL Program Management 2012-12-14 07:54:50 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 30 Mike Orazi 2013-05-07 14:38:43 UTC
This seems to be no longer reproducible.

Comment 31 tingting zheng 2013-05-08 02:27:37 UTC
(In reply to comment #30)
> This seems to be no longer reproducible.

Yes,I can not reproduce this issue any more after tried many times,so you can close it now.

Comment 32 Richard W.M. Jones 2013-05-08 08:30:33 UTC
Closing as per comment 31.


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