other: 0.809 debug: 0.805 permissions: 0.744 device: 0.725 graphic: 0.717 performance: 0.714 vnc: 0.712 KVM: 0.702 semantic: 0.683 PID: 0.627 boot: 0.624 socket: 0.613 files: 0.558 network: 0.540 qemu-system-x86_64 crashed with SIGABRT I've been getting this periodically since my upgrade to qemu 2.0 in trusty this morning. ProblemType: Crash DistroRelease: Ubuntu 14.04 Package: qemu-system-x86 2.0.0~rc1+dfsg-0ubuntu1 ProcVersionSignature: Ubuntu 3.13.0-23.45-generic 3.13.8 Uname: Linux 3.13.0-23-generic x86_64 ApportVersion: 2.14.1-0ubuntu1 Architecture: amd64 Date: Mon Apr 7 13:31:53 2014 ExecutablePath: /usr/bin/qemu-system-x86_64 InstallationDate: Installed on 2013-11-26 (131 days ago) InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1) ProcEnviron: PATH=(custom, no user) Registers: No symbol table is loaded. Use the "file" command. Signal: 6 SourcePackage: qemu StacktraceTop: Title: qemu-system-x86_64 crashed with SIGABRT UpgradeStatus: Upgraded to trusty on 2014-01-17 (79 days ago) UserGroups: It seems to happen when my quantal i386 guest is using the VMVGA driver. Switching to Cirrus fixes it. Also happens to trusty amd64 guest with VMVGA driver. Stacktrace: #0 0x00007f4eb7fa1f79 in ?? () No symbol table info available. Cannot access memory at address 0x7fffa1617188 StacktraceSource: #0 0x00007f4eb7fa1f79 in ?? () StacktraceTop: ?? () And it is not just with vnc either. 2f487a3d40faff1772e14da6b921900915501f9a was ok, so bisecting right now. Hm, bisect is pointing at 6ff45f01c734e1ad051f19913449e2577c9f4b7d which is very unlikely. I'll have to keep playing. Pretty sure that commit b533f658a98325d0e47b36113bd9f5bcc046fdae is the first bad commit. This is interesting. The commit is correct in that kvm_vm_ioctl() returns -errno, not -1, on error. However, the caller, kvm_physical_sync_dirty_bitmap, on seeing the error, shortcuts some extra errors to return -1 itself, but its caller then ignores its error. An extra debug statement shows that the ioctl is getting ioctl failed: No such file or directory At the point when the ioctl fails, this is the backtrace: (gdb) where #0 kvm_physical_sync_dirty_bitmap (section=0x7fffffffd820) at /home/serge/src/qemu/kvm-all.c:446 #1 0x000055555580e30c in kvm_log_sync (listener=, section=) at /home/serge/src/qemu/kvm-all.c:803 #2 0x000055555581390e in memory_region_sync_dirty_bitmap (mr=mr@entry=0x555556257ca8) at /home/serge/src/qemu/memory.c:1210 #3 0x00005555557d943f in vga_sync_dirty_bitmap (s=0x555556257c98) at /home/serge/src/qemu/hw/display/vga.c:1618 #4 vga_draw_graphic (full_update=0, s=0x555556257c98) at /home/serge/src/qemu/hw/display/vga.c:1653 #5 vga_update_display (opaque=0x555556257c98) at /home/serge/src/qemu/hw/display/vga.c:1913 #6 0x0000555555780d92 in dpy_refresh (s=0x555556203690) at ui/console.c:1416 #7 gui_update (opaque=0x555556203690) at ui/console.c:194 #8 0x0000555555764bd9 in timerlist_run_timers (timer_list=0x5555561d2460) at qemu-timer.c:488 #9 0x0000555555764e44 in qemu_clock_run_timers (type=) at qemu-timer.c:499 #10 qemu_clock_run_all_timers () at qemu-timer.c:605 #11 0x0000555555729dbc in main_loop_wait (nonblocking=) at main-loop.c:490 #12 0x00005555555e6196 in main_loop () at vl.c:2051 #13 main (argc=, argv=, envp=) at vl.c:4506 (which means my comment #8 is off track - the caller in this case is checking the return value, then aborting - and this is the exact same backtrace as we get anyway) Looking at arch/x86/kvm/x86.c, ENOENT (only) happens when memslot->dirty_bitmap is NULL in kvm_vm_ioctl_get_dirty_log(). It seems reasonable that if we are requesting writing a dirty bitmap, and kernel says it's not dirty, we ignore that failure? I.e. ignore ENOENT? ENOENT (iiuc) means the kernel has an empty dirty bitmap for this slot. Don't abort in that case. This appears to solve the bug reported at https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1303926 which first showed up with commit b533f658a98325d: fix return check for KVM_GET_DIRTY_LOG ioctl Signed-off-by: Serge Hallyn