Bug 1003846

Summary: qemu-io core dump when read 2000PB vmdk disk
Product: Red Hat Enterprise Linux 7 Reporter: Xu Han <xuhan>
Component: qemu-kvmAssignee: Fam Zheng <famz>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: acathrow, hhuang, juzhang, michen, virt-maint, xfu, xwei
Target Milestone: rcKeywords: TestOnly
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:14:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 995866    
Bug Blocks:    

Description Xu Han 2013-09-03 11:05:19 UTC
Description of problem:
qemu-io core dump when read 2000PB vmdk disk

Version-Release number of selected component (if applicable):
qemu-kvm-1.5.3-2.el7.x86_64
qemu-img-1.5.3-2.el7.x86_64
kernel: 3.10.0-15.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.#qemu-img create -f vmdk test.vmdk 2048000T
2.#qemu-io -c "read 0 512" test.vmdk
3.

Actual results:
after step2
(process:32326): GLib-ERROR **: gmem.c:165: failed to allocate 18446744071562067968 bytes
Trace/breakpoint trap (core dumped)

Expected results:
command execute properly

Additional info:
(gdb) bt
#0  0x00007ffff76f4e0d in g_logv () from /lib64/libglib-2.0.so.0
#1  0x00007ffff76f4ff2 in g_log () from /lib64/libglib-2.0.so.0
#2  0x00007ffff76f38dc in g_malloc () from /lib64/libglib-2.0.so.0
#3  0x0000555555588a40 in vmdk_init_tables (extent=0x555555c03c00, bs=0x555555bfee90) at block/vmdk.c:429
#4  0x00005555555891ac in vmdk_open_vmdk4 (bs=bs@entry=0x555555bfee90, file=file@entry=0x555555c028d0, flags=<optimized out>) at block/vmdk.c:595
#5  0x00005555555893ed in vmdk_open_sparse (bs=bs@entry=0x555555bfee90, file=0x555555c028d0, flags=<optimized out>) at block/vmdk.c:647
#6  0x000055555558996b in vmdk_open (bs=0x555555bfee90, options=<optimized out>, flags=<optimized out>) at block/vmdk.c:775
#7  0x0000555555563d37 in bdrv_open_common (bs=bs@entry=0x555555bfee90, file=0x555555c028d0, options=options@entry=0x555555c00890, 
    flags=flags@entry=24578, drv=drv@entry=0x5555557f6f40 <bdrv_vmdk>) at block.c:747
#8  0x0000555555568f51 in bdrv_open (bs=0x555555bfee90, filename=filename@entry=0x7fffffffe708 "test.vmdk", options=0x555555c00890, options@entry=0x0, 
    flags=24578, flags@entry=16386, drv=<optimized out>, drv@entry=0x0) at block.c:1066
#9  0x00005555555b128d in openfile (name=0x7fffffffe708 "test.vmdk", flags=16386, growable=<optimized out>) at qemu-io.c:1776
#10 0x0000555555560786 in main (argc=<optimized out>, argv=0x7fffffffe488) at qemu-io.c:2023

# qemu-img info test.vmdk

(process:32430): GLib-ERROR **: gmem.c:165: failed to allocate 18446744071562067968 bytes
Trace/breakpoint trap (core dumped)

Comment 2 Xu Han 2013-09-04 02:25:20 UTC
Test on rhel6.5 as well,  rhel6.5 does not hit this issue.
qemu-io report:
L1 size too big
qemu-io: can't open device test.vmdk
no file open, try 'help open'

That is expected.

Comment 4 Ademar Reis 2013-10-16 01:27:25 UTC
The fixes for bug 995866 should have fixed this one as well. Marking TestOnly and ON_QA

Comment 5 Xu Han 2013-11-18 03:09:06 UTC
Verify this bug with component:
qemu-kvm-1.5.3-19.el7.x86_64

Steps:
1. Generate one 2000PB vmdk disk
# qemu-img create -f vmdk test.vmdk 2048000T
2. Read disk image via qemu-io
# qemu-io -c "read 0 512" test.vmdk

Result:
After step2:
# qemu-io -c "read 0 512" test.vmdk
qemu-io: can't open device test.vmdk: L1 size too big
no file open, try 'help open'

Base on comment 0 and this test result above, this bug has been fixed.

Comment 7 Ludek Smid 2014-06-13 11:14:16 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.