Red Hat Bugzilla – Bug 677222
segment fault happens after hot drive add then drive delete
Last modified: 2015-03-04 19:52:38 EST
Description of problem: do drive add, then do drive delete, segment fault happens. Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.144.el6.x86_64 How reproducible: 2/2 Steps to Reproduce: 1.boot guest with cli: /usr/libexec/qemu-kvm -enable-kvm -m 2G -smp 2,sockets=2,cores=1,threads=1 -name qcow2 -uuid bb312345-50b0-de70-921b-5c360a945678 -monitor stdio -rtc base=localtime -boot c -drive file=/root/test3.img,if=none,id=drive-ide0-0-0,format=qcow2,cache=none -device virtio-blk-pci,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:56:ad:a1,bus=pci.0,addr=0x7 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -vga qxl -spice port=5911,disable-ticketing -drive file=/home/raw.img,if=none,id=drive-ide0-0-1,format=raw,cache=none -device virtio-blk-pci,drive=drive-ide0-0-1,id=ide0-0-1 2. do drive add (qemu) __com.redhat_drive_add file=/dev/vgtest1/raw,format=raw,id=drive-virtio1 3.delete drive added in above step (qemu) __com.redhat_drive_del drive-virtio1 Actual results: segment fault happens after step3 (gdb) bt #0 0x0000000000472433 in do_drive_del (mon=<value optimized out>, qdict=<value optimized out>, ret_data=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/device-hotplug.c:134 #1 0x0000000000413e10 in monitor_call_handler (mon=0x15b3230, cmd=0x58e820, params=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:4338 #2 0x0000000000418d60 in handle_user_command (mon=0x15b3230, cmdline=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:4375 #3 0x0000000000418e8a in monitor_command_cb (mon=0x15b3230, cmdline=<value optimized out>, opaque=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:4930 #4 0x00000000004a580b in readline_handle_byte (rs=0x1fec960, ch=<value optimized out>) at readline.c:369 #5 0x00000000004190ac in monitor_read (opaque=<value optimized out>, buf=0x7fffe99ea6d0 "\r", size=1) at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:4916 #6 0x00000000004be1fb in qemu_chr_read (opaque=0x13b9840) at qemu-char.c:171 #7 fd_chr_read (opaque=0x13b9840) at qemu-char.c:657 #8 0x000000000040b95f in main_loop_wait (timeout=1000) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4424 #9 0x000000000042b29a in kvm_main_loop () at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:2165 #10 0x000000000040ef0f in main_loop (argc=<value optimized out>, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4634 #11 main (argc=<value optimized out>, argv=<value optimized out>, envp=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:6848 Expected results: drive delete ok. Additional info:
Reproduced. Probable cause: we're missing upstream commit commit 850ec113 "blockdev: Fix drive_del not to crash when drive is not in use".
Verify this bug with qemu-kvm-0.12.1.2-2.145.el6 as following steps: 1.add one drive via qemu monitor (qemu) __com.redhat_drive_add file=/dev/vgtest/raw,id=virtio1,format=raw,cache=none 2.delete this drive (qemu) __com.redhat_drive_del virtio1 3. add two drive (qemu) __com.redhat_drive_add file=/dev/vgtest/raw,id=virtio1,format=raw,cache=none (qemu)__com.redhat_drive_add file=/root/data.img,id=virtio2,format=qcow2,cache=none 4. delete these drive one by one (qemu) __com.redhat_drive_del virtio1 (qemu) __com.redhat_drive_del virtio2 After above steps, guest running fine. So this bug has been resolved.
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