Bug 606434 - [kvm] segmentation fault when running qemu-img check on faulty image
Summary: [kvm] segmentation fault when running qemu-img check on faulty image
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kvm
Version: 5.5.z
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 610342
TreeView+ depends on / blocked
 
Reported: 2010-06-21 15:38 UTC by Haim
Modified: 2014-01-13 00:46 UTC (History)
14 users (show)

Fixed In Version: kvm-83-192.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-13 23:36:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
faulty vm image file - use xunzip to uncompress it (2.33 MB, application/x-xz)
2010-06-21 15:41 UTC, Haim
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0028 0 normal SHIPPED_LIVE Low: kvm security and bug fix update 2011-01-13 11:03:39 UTC

Description Haim 2010-06-21 15:38:44 UTC
Description of problem:

running qemu-img check on faulty vm (possible corruption) ends with segmentation fault printed on screen (iscsi - block device).
attached also is the corrupted image (qcow2) - please use xunzip and run qemu-img check -f qcow2 on it.  

repro steps: 

1) run qemu-img check -f qcow2 <attached image>  

example: 
[root@red-vdsb ~]# qemu-img check -f qcow2 /rhev/data-center/a7edd3bc-d9cb-4e52-b319-2768775f7067/634b44af-0d7c-4d8b-8d35-6b295418f78b/images/6b618e7c-ab34-4ff9-a2a3-095422219dd4/e80849ae-e78c-415d-a4f4-45142795ae24
ERROR: invalid cluster offset=0x1100010000000000
Segmentation fault


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

kvm-qemu-img-83-164.el5_5.12
kvm-83-164.el5_5.12
vdsm22-4.5-62.el5rhev

How reproducible: always. 


Steps to Reproduce (using rhev-m)(storage=iscsi): 

1) make sure to have 2 running hosts 
2) make sure that vm is running on non-spm machine 
3) make sure vm disk size is 30G virtIO thinly provisioned and it's bigger then 
   storage domain size (it seems that when space on storage is consumed during 
   lvextend retires are some corrupts qemu image). 
4) run vm (live cd) and start dd from the guest machine )dd if=/dev/zero of=/dev/vda bs=1M 

once vm is paused due to unknown storage error (EIO) and all it's space is consumed, check image legality. 

  
Actual results:

segfault running qemu-image check

Comment 1 Haim 2010-06-21 15:41:00 UTC
Created attachment 425675 [details]
faulty vm image file - use xunzip to uncompress it

faulty vm image file - use xunzip to uncompress it and see the seg fault

Comment 2 lihuang 2010-06-22 08:34:42 UTC
FYI : a similar bug in RHEL6. bug 604210. ( including backtrace)

Comment 8 Keqin Hong 2010-11-04 10:27:00 UTC
Verified on kvm-83-192.el5, PASS. (no segfault will appear, instead, more accurate prompts are provided.)
# qemu-img check 16g
ERROR refcount block 8191 is outside image
Leaked cluster 16380 refcount=1 reference=0
Leaked cluster 16381 refcount=1 reference=0
Leaked cluster 16382 refcount=1 reference=0
Leaked cluster 16383 refcount=1 reference=0
Leaked cluster 16384 refcount=1 reference=0
Leaked cluster 16385 refcount=1 reference=0
Leaked cluster 16386 refcount=1 reference=0
Leaked cluster 16387 refcount=1 reference=0
Leaked cluster 180222 refcount=1 reference=0
Leaked cluster 180223 refcount=1 reference=0
Leaked cluster 180224 refcount=1 reference=0
Leaked cluster 180225 refcount=1 reference=0
Leaked cluster 180226 refcount=1 reference=0
Leaked cluster 180227 refcount=1 reference=0
Leaked cluster 180228 refcount=1 reference=0
Leaked cluster 180229 refcount=1 reference=0
Leaked cluster 245754 refcount=1 reference=0
Leaked cluster 245755 refcount=1 reference=0
Leaked cluster 245756 refcount=1 reference=0
Leaked cluster 245757 refcount=1 reference=0
Leaked cluster 245758 refcount=1 reference=0
Leaked cluster 245759 refcount=1 reference=0

1 errors were found on the image.
Data may be corrupted, or further writes to the image may corrupt it.

22 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.

Comment 11 errata-xmlrpc 2011-01-13 23:36:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0028.html


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