Bug 606434

Summary: [kvm] segmentation fault when running qemu-img check on faulty image
Product: Red Hat Enterprise Linux 5 Reporter: Haim <hateya>
Component: kvmAssignee: Kevin Wolf <kwolf>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 5.5.zCC: bazulay, cpelland, danken, hateya, iheim, khong, lihuang, llim, mgoldboi, mkenneth, tburke, virt-maint, yeylon, ykaul
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kvm-83-192.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 23:36:17 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: 610342    
Attachments:
Description Flags
faulty vm image file - use xunzip to uncompress it none

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