Bug 1717321

Summary: qemu-kvm core dumped when repeat "system_reset" multiple times during guest boot
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Yanan Fu <yfu>
Component: qemu-kvmAssignee: Philippe Mathieu-Daudé <philmd>
Status: CLOSED ERRATA QA Contact: Yiqian Wei <yiwei>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: aliang, chayang, coli, jasowang, jinzhao, juzhang, knoel, mdeng, micai, ngu, philmd, qinwang, qzhang, rbalakri, virt-maint, xianwang, xuma, yfu, yihyu, yiwei, yuhuang, zhenyzha
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-4.1.0-10.module+el8.1.0+4234+33aa4f57 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1708459 Environment:
Last Closed: 2019-11-06 07:16:08 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:
Embargoed:
Bug Depends On: 1692658, 1708459    
Bug Blocks:    

Comment 1 Yumei Huang 2019-07-08 11:47:45 UTC
Hit same issue on x86 host.

guest: rhel6.10
host kernel: 4.18.0-109.el8.x86_64
qemu version: qemu-kvm-4.0.0-4.module+el8.1.0+3523+b348b848

06:20:17 INFO | Context: Reset guest system for 19 times
06:20:17 DEBUG| (monitor avocado-vt-vm1.qmpmonitor1) Sending command 'system_reset'
06:20:17 DEBUG| Send command: {'execute': 'system_reset', 'id': 'qFjieuvG'}
06:20:17 DEBUG| Reset the system by monitor cmd after 18.936secs
06:20:17 INFO | [qemu output] qemu-kvm: /builddir/build/BUILD/qemu-4.0.0/hw/virtio/virtio.c:225: vring_get_region_caches: Assertion `caches != NULL' failed.
06:20:22 WARNI| avocado-vt-vm1 is not alive. Can't query the register status
06:20:22 INFO | [qemu output] /tmp/aexpect_oRwFILHv/aexpect-j27jq8kg.sh: line 1: 23918 Aborted                 (core dumped) MALLOC_PERTURB_=1 /usr/libexec/qemu-kvm -S -name 'avocado-vt-vm1' -machine pc -nodefaults -device VGA,bus=pci.0,addr=0x2 -chardev socket,id=qmp_id_qmpmonitor1,path=/var/tmp/avocado_pu3b5eo1/monitor-qmpmonitor1-20190708-061434-c24L80Sb,server,nowait -mon chardev=qmp_id_qmpmonitor1,mode=control -chardev socket,id=qmp_id_catch_monitor,path=/var/tmp/avocado_pu3b5eo1/monitor-catch_monitor-20190708-061434-c24L80Sb,server,nowait -mon chardev=qmp_id_catch_monitor,mode=control -device pvpanic,ioport=0x505,id=idfwOBKS -chardev socket,id=serial_id_serial0,path=/var/tmp/avocado_pu3b5eo1/serial-serial0-20190708-061434-c24L80Sb,server,nowait -device isa-serial,chardev=serial_id_serial0 -chardev socket,id=seabioslog_id_20190708-061434-c24L80Sb,path=/var/tmp/avocado_pu3b5eo1/seabios-20190708-061434-c24L80Sb,server,nowait -device isa-debugcon,chardev=seabioslog_id_20190708-061434-c24L80Sb,iobase=0x402 -device qemu-xhci,id=usb1,bus=pci.0,addr=0x3 -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/home/kvm_autotest_root/images/rhel610-64-virtio.qcow2 -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=0x4 -device virtio-net-pci,mac=9a:b1:b2:b3:b4:b5,id=idSYsEbz,vectors=4,netdev=idsjcbUg,bus=pci.0,addr=0x5 -netdev tap,id=idsjcbUg,vhost=on,vhostfd=25,fd=23 -m 8192 -smp 16,maxcpus=16,cores=8,threads=1,sockets=2 -cpu 'EPYC',+kvm_pv_unhalt -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 -vnc :0 -rtc base=utc,clock=host,driftfix=slew -boot order=cdn,once=c,menu=off,strict=off -enable-kvm

Comment 3 qing.wang 2019-09-02 10:17:24 UTC
hit issue on {'kvm_version': '4.18.0-129.el8.x86_64', 'qemu_version': 'qemu-kvm-2.12.0-84.module+el8.1.0+3980+a02d9447.x86_64'}

(gdb) bt
#0  0x00007f5e46e388df in raise () at /lib64/libc.so.6
#1  0x00007f5e46e22cf5 in abort () at /lib64/libc.so.6
#2  0x00007f5e46e22bc9 in _nl_load_domain.cold.0 () at /lib64/libc.so.6
#3  0x00007f5e46e30e96 in .annobin_assert.c_end () at /lib64/libc.so.6
#4  0x0000562960cd7e0a in vring_get_region_caches (vq=<optimized out>)
    at /usr/src/debug/qemu-kvm-2.12.0-84.module+el8.1.0+3980+a02d9447.x86_64/hw/virtio/virtio.c:211
#5  0x0000562960cd7e0a in vring_get_region_caches (vq=<optimized out>)
    at /usr/src/debug/qemu-kvm-2.12.0-84.module+el8.1.0+3980+a02d9447.x86_64/hw/virtio/virtio.c:208
#6  0x0000562960cd83e0 in vring_avail_flags (vq=0x7f5e1c6b2010)
    at /usr/src/debug/qemu-kvm-2.12.0-84.module+el8.1.0+3980+a02d9447.x86_64/hw/virtio/virtio.c:1632
#7  0x0000562960cd83e0 in virtio_should_notify
    (vdev=vdev@entry=0x562962e21080, vq=vq@entry=0x7f5e1c6b2010)
    at /usr/src/debug/qemu-kvm-2.12.0-84.module+el8.1.0+3980+a02d9447.x86_64/hw/virtio/virtio.c:1632
#8  0x0000562960cd9a13 in virtio_notify_irqfd
    (vdev=0x562962e21080, vq=0x7f5e1c6b2010)
    at /usr/src/debug/qemu-kvm-2.12.0-84.module+el8.1.0+3980+a02d9447.x86_64/hw/virtio/virtio.c:1646
#9  0x0000562960cafd57 in notify_guest_bh (opaque=0x562962e2bd90)
    at /usr/src/debug/qemu-kvm-2.12.0-84.module+el8.1.0+3980+a02d9447.x86_64/hw/block/dataplane/virtio-blk.c:76
#10 0x0000562960f6c1e6 in aio_bh_call (bh=0x562962e2bde0) at util/async.c:118

Comment 4 Amnon Ilan 2019-09-03 10:43:45 UTC
*** Bug 1743145 has been marked as a duplicate of this bug. ***

Comment 10 Yiqian Wei 2019-09-17 10:01:36 UTC
reproduce version:
host version:
qemu-kvm-4.1.0-9.module+el8.1.0+4210+23b2046a.x86_64
kernel-4.18.0-144.el8.x86_64
seabios-1.12.0-4.module+el8.1.0+3876+ec1667b7.x86_64
guest:win2019

test steps:
1.boot a win2019 guest
2.Repeat "system_reset" multiple times
{'execute': 'system_reset'}

test results:
(qemu) qemu-kvm: /builddir/build/BUILD/qemu-4.1.0/hw/virtio/virtio.c:225: vring_get_region_caches: Assertion `caches != NULL' failed.
bz.sh: line 21: 12686 Aborted                 (core dumped) /usr/libexec/qemu-kvm -M pc -S -cpu EPYC-IBPB,enforce -nodefaults -rtc base=utc -m 4G -smp 4,sockets=2,cores=1,threads=2 -enable-kvm -uuid 990ea161-6b67-47b2-b803-19fb01d30d12 -k en-us -qmp tcp:0:6667,server,nowait -vga qxl -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/home/win2019.qcow2 -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0 -device virtio-net-pci,netdev=tap10,mac=9a:6a:6b:6c:6d:6e -netdev tap,id=tap10,vhost=on -monitor stdio -vnc :1 -monitor unix:/tmp/monitor2,server,nowait


Verified the bug with "qemu-kvm-4.1.0-10.module+el8.1.0+4234+33aa4f57.x86_64" version with the same test steps.

test results:
qemu should not encounter core dumps, guest work well after repeat "system_reset" multiple times.

Comment 13 errata-xmlrpc 2019-11-06 07:16:08 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/RHBA-2019:3723