Bug 1585155 - QEMU core dumped when hotplug memory exceeding host hugepages and with discard-data=yes
Summary: QEMU core dumped when hotplug memory exceeding host hugepages and with discar...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Igor Mammedov
QA Contact: Yumei Huang
URL:
Whiteboard:
Depends On:
Blocks: 1649160 1600365 1651787
TreeView+ depends on / blocked
 
Reported: 2018-06-01 11:32 UTC by Yumei Huang
Modified: 2019-08-22 09:19 UTC (History)
6 users (show)

Fixed In Version: qemu-kvm-rhev-2.12.0-20.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1600365 (view as bug list)
Environment:
Last Closed: 2019-08-22 09:18:46 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:2553 None None None 2019-08-22 09:19:41 UTC

Description Yumei Huang 2018-06-01 11:32:53 UTC
Description of problem:
Boot a guest, add a memory file backend object with option discard-data=yes, when backend size > host available hugepages, QEMU core dumped.

qemu-kvm: /builddir/build/BUILD/qemu-2.12.0/memory.c:2053: memory_region_get_ram_ptr: Assertion `mr->ram_block' failed.
Aborted (core dumped)


Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.12.0-2.el7
kernel-3.10.0-891.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. set hugepages on host

# mount
none on /mnt/kvm_hugepage type hugetlbfs (rw,relatime)

# cat /proc/meminfo  | grep -i huge
AnonHugePages:      8192 kB
HugePages_Total:     512
HugePages_Free:      512
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB


2. Boot a guest

# /usr/libexec/qemu-kvm -m 1024,slots=4,maxmem=32G -smp 16,cores=8,threads=1,sockets=2 -numa node -vnc :0 -monitor stdio

 
3. Hotplug memory, add a memory file backend object with discard-data=yes and size=2G

(qemu) object_add memory-backend-file,id=mem1,size=2G,mem-path=/mnt/kvm_hugepage,discard-data=yes


Actual results:
QEMU core dumped:
(qemu) object_add memory-backend-file,id=mem1,size=2G,mem-path=/mnt/kvm_hugepage,discard-data=yes
qemu-kvm: /builddir/build/BUILD/qemu-2.12.0/memory.c:2053: memory_region_get_ram_ptr: Assertion `mr->ram_block' failed.
Aborted (core dumped)


Expected results:
Instead of core dump, qemu prompt error message.


Additional info:
When set discard-data=no, qemu keep running and prompt error message:

(qemu) object_add memory-backend-file,id=mem1,size=2G,mem-path=/mnt/kvm_hugepage,discard-data=no
unable to map backing store for guest RAM: Cannot allocate memory
(qemu) info status
VM status: running

Comment 3 Miroslav Rezanina 2018-12-06 12:39:17 UTC
Fix included in qemu-kvm-rhev-2.12.0-20.el7

Comment 5 Yumei Huang 2018-12-18 06:51:58 UTC
Verify:
qemu-kvm-rhev-2.12.0-20.el7

Same steps with comment0, after step 3, qemu prompts error message instead of core dump.

(qemu) object_add memory-backend-file,id=mem1,size=2G,mem-path=/mnt/kvm_hugepage,discard-data=yes
unable to map backing store for guest RAM: Cannot allocate memory

Comment 7 errata-xmlrpc 2019-08-22 09:18:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:2553


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