Bug 619168 - qemu should more clearly indicate internal detection of this host out-of-memory condition at startup..
qemu should more clearly indicate internal detection of this host out-of-memo...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.1
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: john cooper
Virtualization Bugs
abrt_hash:841543466c446020eb7a11ccd0e...
: RHELNAK
Depends On: 612453
Blocks: 580953
  Show dependency treegraph
 
Reported: 2010-07-28 14:39 EDT by john cooper
Modified: 2014-07-24 23:46 EDT (History)
10 users (show)

See Also:
Fixed In Version: qemu-kvm-0.12.1.2-2.114.el6
Doc Type: Bug Fix
Doc Text:
Cause In the case of certain memory allocation failures, qemu exits with only a self inflicted SIGABORT rather than clearly indicating this cause for failure to the user. Consequence Confusion and possible unhappiness on behalf of the qemu user. Change The condition of allocation failure is detected. Result A message is emitted clearly indication the failure cause.
Story Points: ---
Clone Of: 612453
Environment:
Last Closed: 2011-05-19 07:29:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
gdb stack trace of abort (3.24 KB, application/octet-stream)
2010-09-04 19:51 EDT, john cooper
no flags Details
posix_memalign failure patch (491 bytes, patch)
2010-09-04 19:54 EDT, john cooper
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0534 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2011-05-19 07:20:36 EDT

  None (edit)
Comment 2 RHEL Product and Program Management 2010-07-28 14:57:46 EDT
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 3 john cooper 2010-09-04 19:49:02 EDT
I just hit this myself consistently on a system with substantial
memory pressure: 4GB total and ~10% free.  Launching with -m 1024
the abort triggers faithfully and with -m 512 qemu launches
successfully.  From the user's perspective of stumbling into this
caveat myself it's rather ugly and isn't at a minor usage issue.
Providing a clue to the cause of failure is trivial.  Dump attached.
Patch attached.

Still not sure why the about() is in there unless as a debug
aid such that a core image exists to help puzzle out the
posix_memalign() failure.  Although in this case the cause is
clear.

Odd this apparently hasn't been more widely seen.  Likely
related not only to memory pressure but perhaps a host memory
fragmentation sensitivity as well.
Comment 4 john cooper 2010-09-04 19:51:04 EDT
Created attachment 443114 [details]
gdb stack trace of abort
Comment 5 john cooper 2010-09-04 19:54:00 EDT
Created attachment 443115 [details]
posix_memalign failure patch
Comment 6 john cooper 2010-09-04 19:57:51 EDT
Disregard above patch -- already upstream as
d2d5adcb58d32e8ac6c168c4c2e72cf0f90dcab0.
Comment 14 juzhang 2011-01-13 05:30:53 EST
Reproduced on qemu-kvm-0.12.1.2-2.113.el6.x86_64,when assign to guest memory higher than host free memory,guest aborted without notification.
/usr/libexec/qemu-kvm -m 4G -smp 2 -drive file=/root/zhangjunyi/win2008-64bit.img,if=none,id=test,boot=on,cache=none,format=raw,werror=stop,rerror=stop -device virtio-blk-pci,drive=test -cpu qemu64,+sse2,+x2apic -monitor stdio -boot c -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=22:11:22:45:66:94 -vnc :10 -qmp tcp:0:4445,server,nowait -chardev socket,path=/tmp/amit/test0,server,nowait,id=test0 -chardev socket,path=/tmp/amit/test1,server,nowait,id=test1 -chardev socket,path=/tmp/amit/test2,server,nowait,id=test2 -chardev socket,path=/tmp/amit/test3,server,nowait,id=test3 -chardev socket,path=/tmp/amit/test4,server,nowait,id=test4 -device virtio-serial -device virtconsole,chardev=test0,name=console.0 -device virtserialport,chardev=test1,name=test1 -device virtserialport,chardev=test2,name=test2 -device virtserialport,chardev=test3,name=test3 -device virtserialport,chardev=test4,name=test4 -serial file:/tmp/amit/test-serial.log
Aborted

Verified on qemu-kvm-0.12.1.2-2.129.el6.x86_64,when assign to guest memory higher than host free memory,guest aborted with message "Failed to allocate 4294967296 B: Cannot allocate memory".
#/usr/libexec/qemu-kvm -m 4G -smp 2 -drive file=/root/zhangjunyi/win2008-64bit.img,if=none,id=test,boot=on,cache=none,format=raw,werror=stop,rerror=stop -device virtio-blk-pci,drive=test -cpu qemu64,+sse2,+x2apic -monitor stdio -boot c -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=22:11:22:45:66:94 -vnc :10 -qmp tcp:0:4445,server,nowait -chardev socket,path=/tmp/amit/test0,server,nowait,id=test0 -chardev socket,path=/tmp/amit/test1,server,nowait,id=test1 -chardev socket,path=/tmp/amit/test2,server,nowait,id=test2 -chardev socket,path=/tmp/amit/test3,server,nowait,id=test3 -chardev socket,path=/tmp/amit/test4,server,nowait,id=test4 -device virtio-serial -device virtconsole,chardev=test0,name=console.0 -device virtserialport,chardev=test1,name=test1 -device virtserialport,chardev=test2,name=test2 -device virtserialport,chardev=test3,name=test3 -device virtserialport,chardev=test4,name=test4 -serial file:/tmp/amit/test-serial.log
Failed to allocate 4294967296 B: Cannot allocate memory

According to above description,this issue has been fixed.
Comment 16 john cooper 2011-05-05 10:33:17 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    In the case of certain memory allocation failures, qemu
exits with only a self inflicted SIGABORT rather than
clearly indicating this cause for failure to the user.

Consequence
    Confusion and possible unhappiness on behalf of the
qemu user.

Change
    The condition of allocation failure is detected.


Result
    A message is emitted clearly indication the failure cause.
Comment 17 john cooper 2011-05-05 10:33:55 EDT
Added CCFR
Comment 18 errata-xmlrpc 2011-05-19 07:29:07 EDT
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-0534.html
Comment 19 errata-xmlrpc 2011-05-19 08:46:44 EDT
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-0534.html

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