Bug 736644 - mem lack cause qemu_memalign crash
Summary: mem lack cause qemu_memalign crash
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2011-09-08 10:49 UTC by Suqin Huang
Modified: 2013-01-10 00:17 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-09-12 07:14:36 UTC

Attachments (Terms of Use)

Description Suqin Huang 2011-09-08 10:49:47 UTC
Description of problem:
echo large mem to /proc/sys/vm/nr_hugepage, and then run guest.

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

How reproducible:

Steps to Reproduce:
1. echo large mem to /proc/sys/vm/nr_hugepage
2. run guest

usr/libexec/qemu-kvm -monitor stdio -drive file='/home/Auto/autotest-devel/client/tests/kvm/images/RHEL-Server-6.1-64-virtio.qcow2',index=0,if=none,id=drive-virtio-disk1,media=disk,cache=none,format=qcow2,aio=native -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,id=virtio-disk1 -device virtio-net-pci,netdev=idCnizDC,mac=00:e6:4a:94:f2:20,id=ndev00idCnizDC,bus=pci.0,addr=0x3 -netdev tap,id=idCnizDC,vhost=on,script='/home/Auto/autotest-devel/client/tests/kvm/scripts/qemu-ifup-switch',downscript='no' -m 4G -smp 2,cores=2,threads=1,sockets=1 -cpu cpu64-rhel6,+sse2,+x2apic -vnc :2 -rtc base=utc,clock=host,driftfix=none -M rhel6.2.0 -boot order=cdn,once=c,menu=off   -usbdevice tablet -no-kvm-pit-reinjection -enable-kvm

Actual results:
guest crash

Expected results:
quest quit with mem lack warning

Additional info:

#0  0x00000033f4432945 in raise () from /lib64/libc.so.6
#1  0x00000033f4434125 in abort () from /lib64/libc.so.6
#2  0x0000000000482b50 in qemu_memalign (alignment=2097152, size=8589934592) at osdep.c:112
#3  0x00000000004e9a32 in qemu_ram_alloc_from_ptr (dev=<value optimized out>, name=<value optimized out>, size=8589934592, host=<value optimized out>)
    at /usr/src/debug/qemu-kvm-
#4  0x0000000000451253 in pc_init1 (ram_size=3758096384, boot_device=0x7fff883a1b80 "d", 
    kernel_filename=0x7fff883a45e1 "/home/Auto/autotest-devel/client/tests/kvm/images/rhel61-64/vmlinuz", 
    kernel_cmdline=0x7fff883a4703 "ks=cdrom nicdelay=60 console=ttyS0,115200 console=tty0", 
    initrd_filename=0x7fff883a462d "/home/Auto/autotest-devel/client/tests/kvm/images/rhel61-64/initrd.img", cpu_model=0x7fff883a45bf "cpu64-rhel6,+sse2,+x2apic", 
    pci_enabled=1) at /usr/src/debug/qemu-kvm-
#5  0x000000000040d1ff in main (argc=<value optimized out>, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/qemu-kvm-

Comment 2 Dor Laor 2011-09-12 07:14:36 UTC
This is works as designed. If we're using static huge pages we expect to get enough of them. If you do not have enough (reserved before), just use THP instead.

Comment 3 Suqin Huang 2011-09-12 07:38:59 UTC
Hi Dor,
I think it should quit but not crash

Comment 4 Dor Laor 2011-09-14 21:24:54 UTC
(In reply to comment #3)
> Hi Dor,
> I think it should quit but not crash

You're right but we barely have the bandwidth to change it, raising an exception is not that awkward solution

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