open-power-host-os / qemu

OpenPOWER Host OS qemu repository
Other
2 stars 3 forks source link

qemu crashes with qemu_event_set: Assertion `ev->initialized' failed error #20

Closed nasastry closed 6 years ago

nasastry commented 7 years ago
Mirrored with LTC bug https://bugzilla.linux.ibm.com/show_bug.cgi?id=160016 1. Get tests/qemu-iotests from the source tree of qemu configure, compile then 2. Point to the system supplied qemu binary export QEMU_PROG=/usr/bin/qemu-system-ppc64 3. Run test scenario from 068 \# cd qemu/tests/qemu-iotests \# ./check -qcow2 068 ``` 068 6s ... - output mismatch (see 068.out.bad) --- /home/nasastry/qemu/tests/qemu-iotests/068.out 2017-10-09 14:09:04.262726912 +0530 +++ /home/nasastry/qemu/tests/qemu-iotests/068.out.bad 2017-10-12 13:53:19.392927194 +0530 @@ -6,10 +6,13 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) savevm 0 (qemu) quit +qemu-system-ppc64: util/qemu-thread-posix.c:397: qemu_event_set: Assertion `ev->initialized' failed. +./common.rc: line 51: 42786 Aborted ( if [ -n "${QEMU_NEED_PID}" ]; then + echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid"; +fi; exec "$QEMU_PROG" $QEMU_OPTIONS "$@" ) QEMU X.Y.Z monitor - type 'help' for more information (qemu) loadvm 0 (qemu) loadvm 0 -(qemu) quit === Saving and reloading a VM state to/from a qcow2 image (-object iothread,id=iothread0 -set device.hba0.iothread=iothread0) === @@ -17,8 +20,11 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) savevm 0 (qemu) quit +qemu-system-ppc64: util/qemu-thread-posix.c:397: qemu_event_set: Assertion `ev->initialized' failed. +./common.rc: line 51: 42825 Aborted ( if [ -n "${QEMU_NEED_PID}" ]; then + echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid"; +fi; exec "$QEMU_PROG" $QEMU_OPTIONS "$@" ) QEMU X.Y.Z monitor - type 'help' for more information (qemu) loadvm 0 (qemu) loadvm 0 -(qemu) quit *** done ```
nasastry commented 7 years ago

from gdb:

Core was generated by `/usr/bin/qemu-system-ppc64 -nodefaults -machine accel=qtest -nographic -monitor'.
Program terminated with signal 6, Aborted.
#0  0x00007fffb704eff0 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install qemu-system-ppc-2.10.0-2.rel.gitc334a4e.el7.centos.ppc64le
(gdb) bt
#0  0x00007fffb704eff0 in raise () from /lib64/libc.so.6
#1  0x00007fffb705136c in abort () from /lib64/libc.so.6
#2  0x00007fffb7044c44 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007fffb7044d34 in __assert_fail () from /lib64/libc.so.6
#4  0x000000013a872e38 in qemu_event_set ()
#5  0x000000013a6dfb00 in qemu_loadvm_state ()
#6  0x000000013a6e0944 in load_snapshot ()
#7  0x000000013a561a08 in hmp_loadvm ()
#8  0x000000013a365a18 in handle_hmp_command ()
#9  0x000000013a3678ac in monitor_command_cb ()
#10 0x000000013a88882c in readline_handle_byte ()
#11 0x000000013a365d58 in monitor_read ()
#12 0x000000013a7e78ac in qemu_chr_be_write ()
#13 0x000000013a7e9b48 in fd_chr_read ()
#14 0x000000013a8083d4 in qio_channel_fd_source_dispatch ()
#15 0x00007fffb7553ab0 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#16 0x000000013a86db64 in main_loop_wait ()
#17 0x000000013a2fbc38 in main ()
nasastry commented 7 years ago

One more way to reproduce the same error

Start the guest using the following command.

qemu-system-ppc64 --nographic -vga none -machine pseries,accel=kvm,kvm-type=HV -m 2G,slots=32,maxmem=16G -device virtio-blk-pci,drive=rootdisk -drive file=/home/nasastry/hostos-3.0-ppc64le.qcow2,if=none,cache=none,id=rootdisk,format=qcow2 -monitor telnet:127.0.0.1:1234,server,nowait -net nic,model=virtio -net user -redir tcp:2000::22 -device nec-usb-xhci  -smp 8

Connect to qemu monitor by telnet to port 1234 and issue 'savevm 0, loadvm 0, loadvm 0'

# telnet localhost 1234
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
QEMU 2.10.0 monitor - type 'help' for more information
(qemu) savevm 0
(qemu) loadvm 0
(qemu) loadvm 0
Connection closed by foreign host.

then immediately seeing the crash.

qemu-system-ppc64: util/qemu-thread-posix.c:397: qemu_event_set: Assertion `ev->initialized' failed.
Aborted
sathnaga commented 7 years ago

simpler command reproduce on qemu-2.10.0-2.rel.gitc334a4e.el7.centos.ppc64le

qemu-kvm -M pseries  -smp 1 -enable-kvm /home/sath/hostos-3.0-ppc64le.qcow2 -monitor stdio -serial /dev/pts/4 -nographic -vga none -m 1024 -nodefaults
QEMU 2.10.0 monitor - type 'help' for more information
(qemu) savevm 0
(qemu) loadvm 0
(qemu) loadvm 0
qemu-system-ppc64: util/qemu-thread-posix.c:397: qemu_event_set: Assertion `ev->initialized' failed.
Aborted

Not hitting the crash on upstream qemu @ https://github.com/qemu/qemu/commit/a0b261db8c030813e30a39eae47359ac2a37f7e2

ppc64-softmmu/qemu-system-ppc64 -M pseries  -smp 1 -enable-kvm /home/sath/hostos-3.0-ppc64le.qcow2 -monitor stdio -serial /dev/pts/4 -nographic -vga none -m 1024 -nodefaults
QEMU 2.10.50 monitor - type 'help' for more information
(qemu) savevm 0
(qemu) loadvm 0
(qemu) loadvm 0
(qemu) 
cdeadmin commented 7 years ago

------- Comment From alexey@au1.ibm.com 2017-10-24 03:32:15 EDT------- https://git.qemu.org/?p=qemu.git;a=commit;h=5089e1862fe fixes it. Is this urgent or can wait v2.11 release scheduled to 12/12/2017?

cdeadmin commented 7 years ago

------- Comment From jamesspo@us.ibm.com 2017-11-15 15:16:41 EDT------- (In reply to comment #6) > https://git.qemu.org/?p=qemu.git;a=commit;h=5089e1862fe fixes it. Is this > urgent or can wait v2.11 release scheduled to 12/12/2017?

Alexey we'll just wait for qemu 2.11 rebase. Let's do that in Sprint 5 (merge to hostos-release branch for that sprint opens Dec 10, closes Dec 21). If you'd like to merge pre-release version(s) of 2.11 into hostos-devel before then, feel free. We have automated test runs on builds of the -devel branch, and would be good to have some test on it before it goes into hostos-release.

cdeadmin commented 6 years ago

------- Comment From bssrikanth@in.ibm.com 2017-12-20 03:48:13 EDT------- [root@ltczzj3 qemu-iotests]# uname -r 4.14.0-1.rel.git68b4afb.el7.centos.ppc64le

[root@ltczzj3 qemu-iotests]# ./check -qcow2 068 QEMU -- "/usr/bin/qemu-system-ppc64" -nodefaults -machine accel=qtest QEMU_IMG -- "/usr/bin/qemu-img" QEMU_IO -- "/usr/bin/qemu-io" --cache writeback -f qcow2 QEMU_NBD -- "/usr/bin/qemu-nbd" IMGFMT -- qcow2 (compat=1.1) IMGPROTO -- file PLATFORM -- Linux/ppc64le ltczzj3 4.14.0-1.rel.git68b4afb.el7.centos.ppc64le TEST_DIR -- /home/srikanth/qemu/build/tests/qemu-iotests/scratch SOCKET_SCM_HELPER -- /home/srikanth/qemu/build/tests/qemu-iotests/socket_scm_helper

068 7s ... Passed all 1 tests