Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 622352

Summary: core dumped when convert qcow2 image from default cluster size to 512
Product: Red Hat Enterprise Linux 6 Reporter: Shirley Zhou <szhou>
Component: qemu-kvmAssignee: Kevin Wolf <kwolf>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: areis, juzhang, llim, mkenneth, mshao, sluo, tburke, virt-maint
Target Milestone: betaKeywords: RHELNAK
Target Release: 6.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-08 09:00:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 580953    

Description Shirley Zhou 2010-08-09 03:30:23 UTC
Description of problem:
core dumped when convert qcow2 image from default cluster size to 512

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


How reproducible:
always

Steps to Reproduce:
Get a previous install qcow2 image, do qcow2 convert to qcow2 as following:

qemu-img convert -f qcow2 RHEL-Server-5.5-64-virtio.qcow2 -O qcow2 rhel5.5-base1.qcow2 -o cluster_size=512

  
Actual results:
core dumped
*** glibc detected *** qemu-img: double free or corruption (!prev): 0x000000000085ed50 ***
(gdb) bt
#0  0x00000032a8e329b5 in raise () from /lib64/libc.so.6
#1  0x00000032a8e34195 in abort () from /lib64/libc.so.6
#2  0x00000032a8e6fe1b in __libc_message () from /lib64/libc.so.6
#3  0x00000032a8e75736 in malloc_printerr () from /lib64/libc.so.6
#4  0x000000000041fd23 in alloc_refcount_block (bs=0x856ba0, offset=3967799296, length=<value optimized out>, 
    addend=1) at block/qcow2-refcount.c:364
#5  update_refcount (bs=0x856ba0, offset=3967799296, length=<value optimized out>, addend=1)
    at block/qcow2-refcount.c:503
#6  0x0000000000420890 in qcow2_alloc_clusters (bs=0x856ba0, size=32768) at block/qcow2-refcount.c:623
#7  0x0000000000421667 in qcow2_alloc_cluster_offset (bs=0x856ba0, offset=11331436544, n_start=0, n_end=3072, 
    num=0x85ea2c, m=0x85ea78) at block/qcow2-cluster.c:853
#8  0x000000000041d210 in qcow_aio_write_cb (opaque=0x85e9e0, ret=<value optimized out>) at block/qcow2.c:598
#9  0x000000000040ed88 in posix_aio_process_queue (opaque=0x8268f0) at posix-aio-compat.c:460
#10 0x000000000040ee88 in posix_aio_read (opaque=0x8268f0) at posix-aio-compat.c:501
#11 0x000000000040c3ec in qemu_aio_wait () at aio.c:208
#12 0x000000000040b6c5 in bdrv_write_em (bs=0x856ba0, sector_num=22130688, 
    buf=0x7fb770862010 "\356p\024\\f\214\262&dZœ1\\\367\f\027\211\277\201gз\025\065?\361\301\323\377\304\366u\367\306Ǥ/*\242U\232\257\306f\355\256\313'\273ȋ5ה\341\363\331T>\262\262\344J\002\070\t\211\b\326kl;fP2\036\071\261\314+<\337\065AAI\177\025\a\213\062\356\343ձ\235d\274\330\357\361\265\027n$4\004\366x\237\236B\372ĂiS\"\227\375\237\242\266!ޏ\201\260\310\336L\v\345|A]\350\277\066E\242\353r\257\024`Ɇ-X`v\325e\356\341\v\360\346\062L\356\254\360\370\060\301\065Ӈ\343ق۠\036\347[f\031h\225i\342\177\242֑\002\032\003\217]t\256.x\327", <incomplete sequence \316>..., nb_sectors=4096) at block.c:2288
#13 0x0000000000404a0b in img_convert (argc=<value optimized out>, argv=<value optimized out>) at qemu-img.c:859
#14 0x00000032a8e1ec5d in __libc_start_main () from /lib64/libc.so.6
---Type <return> to continue, or q <return> to quit---
#15 0x0000000000402d09 in _start ()


Expected results:
convert should complete.

Additional info:
Original qcow2 image info:

#qemu-img info RHEL-Server-5.5-64-virtio.qcow2 
image: RHEL-Server-5.5-64-virtio.qcow2
file format: qcow2
virtual size: 15G (16106127360 bytes)
disk size: 5.0G
cluster_size: 65536

Comment 1 Shirley Zhou 2010-08-09 03:32:25 UTC
Version-Release number of selected component (if applicable):
qemu-img-0.12.1.2-2.108.el6.x86_64
qemu-kvm-tools-0.12.1.2-2.108.el6.x86_64
qemu-kvm-0.12.1.2-2.108.el6.x86_64
gpxe-roms-qemu-0.9.7-6.3.el6.noarch
kernel-2.6.32-59.el6.x86_64

Comment 3 RHEL Program Management 2010-08-09 03:47:50 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 4 Shirley Zhou 2010-08-10 02:02:22 UTC
This bug can reproduce when installing windows 2008 r2 on qcow2 image with 512 cluster size.
1.(gdb) bt
#0  0x00000033af8329b5 in raise () from /lib64/libc.so.6
#1  0x00000033af834195 in abort () from /lib64/libc.so.6
#2  0x00000033af86fe1b in __libc_message () from /lib64/libc.so.6
#3  0x00000033af875736 in malloc_printerr () from /lib64/libc.so.6
#4  0x000000000048f9d3 in alloc_refcount_block (bs=0x2d7f010, offset=3967808000, length=<value optimized out>, addend=1)
    at block/qcow2-refcount.c:364
#5  update_refcount (bs=0x2d7f010, offset=3967808000, length=<value optimized out>, addend=1) at block/qcow2-refcount.c:503
#6  0x0000000000490540 in qcow2_alloc_clusters (bs=0x2d7f010, size=4096) at block/qcow2-refcount.c:623
#7  0x0000000000491317 in qcow2_alloc_cluster_offset (bs=0x2d7f010, offset=4725080064, n_start=0, n_end=8, num=0x7fd7040610fc, 
    m=0x7fd704061148) at block/qcow2-cluster.c:853
#8  0x000000000048cec0 in qcow_aio_write_cb (opaque=0x7fd7040610b0, ret=<value optimized out>) at block/qcow2.c:598
#9  0x000000000047ea38 in posix_aio_process_queue (opaque=0x2d80230) at posix-aio-compat.c:460
#10 0x000000000047eb38 in posix_aio_read (opaque=0x2d80230) at posix-aio-compat.c:501
#11 0x000000000040b45f in main_loop_wait (timeout=1000) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4234
#12 0x0000000000428b0a in kvm_main_loop () at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:2133
#13 0x000000000040e57b in main_loop (argc=<value optimized out>, argv=<value optimized out>, envp=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4444
#14 main (argc=<value optimized out>, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:6601
2.image info after core dump happens.
#qemu-img info win08r2_512_off.qcow2 
image: win08r2_512_off.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 3.7G
cluster_size: 512

Comment 5 Dor Laor 2010-08-10 03:27:36 UTC
Promoting to blocker + 6.0 since if it happens regardless of conversion it means that we won't be able to boot older images and this is a clear blocker

Comment 8 Kevin Wolf 2010-08-11 03:41:17 UTC
(In reply to comment #0)
> How reproducible:
> always
> 
> Steps to Reproduce:
> Get a previous install qcow2 image, do qcow2 convert to qcow2 as following:
> 
> qemu-img convert -f qcow2 RHEL-Server-5.5-64-virtio.qcow2 -O qcow2
> rhel5.5-base1.qcow2 -o cluster_size=512

I can't seem to reproduce this with images that I had around. Does it happen with any image or just with a specific one? If the latter, can you provide me access to this image?

Comment 9 Shirley Zhou 2010-08-11 05:30:14 UTC
(In reply to comment #8)
> (In reply to comment #0)
> > How reproducible:
> > always
> > 
> > Steps to Reproduce:
> > Get a previous install qcow2 image, do qcow2 convert to qcow2 as following:
> > 
> > qemu-img convert -f qcow2 RHEL-Server-5.5-64-virtio.qcow2 -O qcow2
> > rhel5.5-base1.qcow2 -o cluster_size=512
> 
> I can't seem to reproduce this with images that I had around. Does it happen
> with any image or just with a specific one? If the latter, can you provide me
> access to this image?    

For convert :
I reproduce this bug on one image, you may get this image file from my nfs:

10.66.91.127:/nfs/RHEL-Server-5.5-64-virtio.qcow2, this bug happens after converting last about 10 mins.

For installation:

This bug happens when installing windows 2008 r2 on a fresh created image file.

Comment 19 juzhang 2012-04-26 04:02:05 UTC
Hi,Kevin

According to https://bugzilla.redhat.com/show_bug.cgi?id=812833#8 , can close this issue as duplicate bz812833 or current realse?

Comment 20 Kevin Wolf 2012-04-26 07:49:12 UTC
No, this looks different. We have an abort() here, whereas bug 812833 didn't crash but showed an error message.

Comment 23 Kevin Wolf 2013-04-04 12:48:21 UTC
Is this still reproducible on latest RHEL 6? I suspect it might be a duplicate of bug 870917.

Comment 24 Sibiao Luo 2013-04-07 03:44:15 UTC
(In reply to comment #23)
> Is this still reproducible on latest RHEL 6? I suspect it might be a
> duplicate of bug 870917.
I am testing the converting and installing on qcow2 image with 512 cluster size and will update the result here after i got the testing results.

Comment 25 Sibiao Luo 2013-04-08 02:03:45 UTC
Host info:
kernel-2.6.32-369.el6.x86_64
qemu-kvm-0.12.1.2-2.356.el6.x86_64
virtio-win-1.6.3-3.el6.noarch
Guest info:
win2008r2-64

Test steps and results:
- convert qcow2 image from default cluster size to 512.
It can convert qcow2 image from default cluster size to 512 successfully without any problem, and check the image that no errors were found on the image.
# qemu-img info win2008r2-64.qcow2
image: win2008r2-64.qcow2
file format: qcow2
virtual size: 30G (32212254720 bytes)
disk size: 6.8G
cluster_size: 65536
# qemu-img convert -f qcow2 win2008r2-64.qcow2 -O qcow2 win2008r2-64-convert.qcow2 -o cluster_size=512
# qemu-img info win2008r2-64-convert.qcow2
image: win2008r2-64-convert.qcow2
file format: qcow2
virtual size: 30G (32212254720 bytes)
disk size: 6.9G
cluster_size: 512
# qemu-img check win2008r2-64-convert.qcow2
No errors were found on the image.

- install windows_server_2008_r2 on qcow2 image with 512 cluster size.
It need a long time to install windows_server_2008_r2 on qcow2 image with 512 cluster size but successfully, and reboot/shutdown successfully without any problem, then check the image that no errors were found on the image.
# qemu-img create -f qcow2 -o cluster_size=512 windows_server_2008_r2.qcow2 30G
Formatting 'windows_server_2008_r2.qcow2', fmt=qcow2 size=32212254720 encryption=off cluster_size=512 
# qemu-img info windows_server_2008_r2.qcow2
image: windows_server_2008_r2.qcow2
file format: qcow2
virtual size: 30G (32212254720 bytes)
disk size: 7.5M
cluster_size: 512
# /usr/libexec/qemu-kvm -S -M rhel6.4.0 -cpu SandyBridge -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -name sluo-test -uuid ed09fa10-6ffe-4811-a42f-0294afcb5a42 -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port2 -drive file=/home/windows_server_2008_r2.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial=QEMU-DISK1 -device virtio-scsi-pci,bus=pci.0,addr=0x4,id=scsi0 -device scsi-hd,bus=scsi0.0,drive=drive-system-disk,id=system-disk,bootindex=1 -netdev tap,id=hostnet0,vhost=off,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=08:2e:5f:0a:0d:b1,bus=pci.0,addr=0x5,bootindex=2 -device virtio-balloon-pci,id=ballooning,bus=pci.0,addr=0x6 -fda /usr/share/virtio-win/virtio-win-1.6.3_amd64.vfd -drive file=/home/en_windows_server_2008_r2_standard_enterprise_datacenter_and_web_with_sp1_x64_dvd_617601.iso,if=none,id=drive-cdrom,format=raw,cache=none,aio=native,werror=stop,rerror=stop,media=cdrom,readonly=on -device ide-drive,drive=drive-cdrom,unit=0,id=cdrom,bootindex=0 -qmp tcp:0:4444,server,nowait -k en-us -boot menu=on -vnc :1 -spice disable-ticketing,port=5931 -monitor stdio
# qemu-img info /home/windows_server_2008_r2.qcow2
image: /home/windows_server_2008_r2.qcow2
file format: qcow2
virtual size: 30G (32212254720 bytes)
disk size: 7.0G
cluster_size: 512
# qemu-img check /home/windows_server_2008_r2.qcow2
No errors were found on the image.

Best Regards.
sluo

Comment 26 Kevin Wolf 2013-04-08 09:00:09 UTC
Thanks for testing this. I'm marking it as a duplicate now. If the problem
occurs again later, feel free to reopen this or file a new bug report.

*** This bug has been marked as a duplicate of bug 870917 ***