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 1224675 - ppc64le: virt-sparsify fails to make a disk image sparse, the output log indicates it gets the wrong parameter in the disk create step
Summary: ppc64le: virt-sparsify fails to make a disk image sparse, the output log indi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: ppc64le
OS: Unspecified
medium
high
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1225995
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-25 10:05 UTC by Hu Zhang
Modified: 2015-11-19 07:01 UTC (History)
4 users (show)

Fixed In Version: libguestfs-1.28.1-1.37.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 07:01:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2183 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-11-19 08:18:42 UTC

Description Hu Zhang 2015-05-25 10:05:37 UTC
Description of problem:
"virt-sparsify" fails to make a disk image sparse, the output log indicates it gets the wrong parameter in the disk create step. It works well on ppc64be machine.

Version-Release number of selected component (if applicable):
libguestfs-1.28.1-1.35.ael7b.ppc64le
libguestfs-tools-c-1.28.1-1.35.ael7b.ppc64le
kernel-3.10.0-244.ael7b.ppc64le

How reproducible:
Always

Steps to Reproduce:
1. On a ppc64le machine.
# virt-sparsify RHEL-Server-6.7-64-hvm.raw test.img -v -x
Examining RHEL-Server-6.7-64-hvm.raw ...
Segmentation fault (core dumped)
[root@ibm-p8-kvm-02-qe libguestfs]# virt-resize RHEL-Server-6.7-64-hvm.raw test1.img -v -x
command line: virt-resize RHEL-Server-6.7-64-hvm.raw test1.img -v -x
Examining RHEL-Server-6.7-64-hvm.raw ...
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
Segmentation fault (core dumped)
[root@ibm-p8-kvm-02-qe libguestfs]# virt-sparsify RHEL-Server-6.7-64-hvm.raw test.img -v -x
Input disk virtual size = 8589934592 bytes (8.0G)
Create overlay file in /tmp to protect source disk ...
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: trace: disk_create "/tmp/sparsifyd538a0.qcow2" "qcow2" 282578783305728 "backingfile:/home/huzhan/libguestfs.autotest.latest/client/tests/libguestfs/RHEL-Server-6.7-64-hvm.raw" "compat:1.1"
libguestfs: trace: disk_create = -1 (error)
virt-sparsify: error: libguestfs error: if using a backing file, size must
be passed as -1

If reporting bugs, run virt-sparsify with debugging enabled and include the
complete output:

  virt-sparsify -v -x [...]
libguestfs: trace: close
libguestfs: closing guestfs handle 0x100006aa6a0 (state 0)                                                              

2. On a ppc64le machine.
Input disk virtual size = 104857600 bytes (100.0M)
Create overlay file in /tmp to protect source disk ...
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: trace: disk_create "/tmp/sparsifyb5f474.qcow2" "qcow2" -1 "backingfile:/home/huzhan/test1.img" "compat:1.1"
libguestfs: command: run: qemu-img
libguestfs: command: run: \ create
libguestfs: command: run: \ -f qcow2
libguestfs: command: run: \ -o backing_file=/home/huzhan/test1.img,compat=1.1
....

Actual results:
Described as step1.

Expected results:
virt-sparsify can make a disk image sparse successfully with no error return.                  


Additional info:

Comment 2 Richard W.M. Jones 2015-05-28 13:59:59 UTC
Yes, I can reproduce this.  The trace shows:

libguestfs: trace: disk_create "/tmp/sparsify437efa.qcow2" "qcow2" 282574488338432 "backingfile:/mnt/scratch/rhel-7.1-ppc64le.img" "compat:1.1"
libguestfs: trace: disk_create = -1 (error)
virt-sparsify: error: libguestfs error: if using a backing file, size must 
be passed as -1

As you can see, 282574488338432 is being passed instead of -1.
282574488338432 == 0x1_0100_0000_0000 which is a rather strange
number.

Comment 3 Richard W.M. Jones 2015-05-28 16:35:36 UTC
Stack trace:

#0  0x00000000100ab8d8 in ocaml_guestfs_disk_create (gv=70367494005936, 
    backingfilev=70367495353480, backingformatv=1, preallocationv=1, 
    compatv=270154852, clustersizev=1, filenamev=70367495353624, 
    formatv=270154884, sizev=270772368) at guestfs-c-actions.c:4138
#1  0x0000000010105e88 in caml_c_call ()
#2  0x0000000010039974 in camlGuestfs__fun_25930 ()
#3  0x000000001001d490 in caml_curry8_7 ()
#4  0x000000001001ea80 in caml_send8 ()
#5  0x0000000010020a7c in camlCopying__create_1083 ()
#6  0x00000000100221f4 in camlCopying__run_1047 ()
#7  0x000000001001f43c in camlSparsify__main_1042 ()
#8  0x0000000010028b4c in camlCommon_utils__run_main_and_handle_errors_1227 ()
#9  0x000000001001f528 in camlSparsify__entry ()
#10 0x0000000010011900 in caml_program ()
#11 0x000000001010600c in caml_start_program ()
#12 0x00000000100e82d8 in caml_main ()
#13 0x0000000010010f2c in main ()

The sizev value (an Int64.t) evaluates to
(gdb) print/x size
$3 = 0x1010000000000

The sizev value contains:
(gdb) x/4g (270772368-8)
0x1023a888:	0x00000000000001c1	0x000000001023a0c0
0x1023a898:	0x0001010000000000	0x0000000100000001

The header looks quite bogus.

My suspicion falls on the assembler harness used to jump from
OCaml into C (caml_curry8 etc).

Comment 4 Richard W.M. Jones 2015-05-28 17:09:22 UTC
This is an OCaml compiler bug on ppc64le.  See bug 1225995.

Comment 6 Hu Zhang 2015-09-14 06:44:54 UTC
Verified with the packages:
libguestfs-1.28.1-1.54.el7.ppc64le
libguestfs-tools-c-1.28.1-1.54.el7.ppc64le

Verify step:
1. On a ppc64le machine.
# virt-sparsify RHEL-Server-6.7-64-hvm.raw test.img -v -x
...
Sparsify operation completed with no errors.  Before deleting the old disk, 
carefully check that the target disk boots and works correctly.
libguestfs: trace: close
libguestfs: closing guestfs handle 0x1001872a7e0 (state 0)

virt-sparsify works as expected. So verified.

Comment 8 errata-xmlrpc 2015-11-19 07:01:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2183.html


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