Bug 595612

Summary: Vhost_net: Segfault occurred during guest reboot
Product: Red Hat Enterprise Linux 6 Reporter: Amos Kong <akong>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: ailan, amit.shah, gyue, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-25 09:28:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Amos Kong 2010-05-25 07:51:18 UTC
Description of problem:
Boot up a rhel6 guest with 'vhost=on' option, and execute 'reboot' command, segfault occurred.
When boot up with 'vhost=off' option, bug could not be reproduced. If use original option(-net tap,vlan=0,ifname=virtio_0_6001,script....), this bug doesn't exist.

Command line ('vhost=on'):
/root/vhost/client/tests/kvm/qemu -name 'vm1' -monitor tcp:0:6001,server,nowait -drive file=/root/vhost/client/tests/kvm/images/RHEL-Server-6.0-64-virtio.qcow2,if=ide,cache=none,boot=on -net nic,vlan=0,netdev=foo_6001,model=virtio,macaddr=02:A9:7C:6C:b3:74 -netdev tap,id=foo_6001,vhost=on,ifname=virtio_0_6001,script=/root/vhost/client/tests/kvm/scripts/qemu-ifup-switch,downscript=no -m 4096 -smp 2 -soundhw ac97 -usbdevice tablet -rtc-td-hack -no-hpet -cpu qemu64,+sse2 -no-kvm-pit-reinjection -redir tcp:5000::22 -vnc :0 -serial unix:/tmp/serial-20100525-144754-R4GR,server,nowait

Original command line:
# /root/vhost/client/tests/kvm/qemu -name 'vm1' -monitor tcp:0:6001,server,nowait -drive file=/root/vhost/client/tests/kvm/images/RHEL-Server-6.0-64-virtio.qcow2,if=ide,cache=none,boot=on -net nic,vlan=0,model=virtio,macaddr=02:A9:7C:6C:b3:74 -net tap,vlan=0,ifname=virtio_0_6001,script=/root/vhost/client/tests/kvm/scripts/qemu-ifup-switch,downscript=no -m 4096 -smp 2 -soundhw ac97 -usbdevice tablet -rtc-td-hack -no-hpet -cpu qemu64,+sse2 -no-kvm-pit-reinjection -redir tcp:5000::22 -vnc :0 -serial unix:/tmp/serial-20100525-144754-R4GR,server,nowait


Version-Release number of selected component (if applicable):
guest kernel:2.6.32-22.el6.x86_64
host kernel:2.6.32-25.el6.x86_64

# rpm -qa |grep qemu
gpxe-roms-qemu-0.9.7-6.2.el6.noarch
qemu-kvm-0.12.1.2-2.62.el6.x86_64
qemu-img-0.12.1.2-2.62.el6.x86_64
qemu-kvm-tools-0.12.1.2-2.62.el6.x86_64
qemu-kvm-debuginfo-0.12.1.2-2.62.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.boot up a rhel6 guest with 'vhost=on' option
2.check if guest network works
# ping www.redhat.com
3.reboot guest
# reboot
  
Actual results:
segfault occurred

Expected results:
guest can reboot successfully

Additional info:

1. vhost_net module has been loaded.
host)#lsmod |grep vhost_net
vhost_net              22833  1
macvtap                 7573  1 vhost_net
tun                    16295  3 vhost_net

2. core-dump:
Program received signal SIGSEGV, Segmentation fault.
event_notifier_get_fd (e=0x48) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/event_notifier.c:38
38      {
(gdb) bt
#0  event_notifier_get_fd (e=0x48) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/event_notifier.c:38
#1  0x00000000004208ff in virtio_pci_mask_notifier (dev=0x2d21cc0, vector=1, opaque=0x0, masked=1) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/virtio-pci.c:410
#2  0x000000000042b961 in msix_set_mask_notifier (dev=0x2d21cc0, vector=1, opaque=0x0) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/msix.c:618
#3  0x000000000041fedc in virtio_pci_set_guest_notifier (opaque=0x2d21cc0, n=0, assign=false) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/virtio-pci.c:442
#4  0x00000000004224cf in vhost_virtqueue_cleanup (dev=0x18a0ff0, vdev=0x2d32010, vq=0x18a1068, idx=0) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/vhost.c:573
#5  0x00000000004228db in vhost_dev_stop (hdev=0x18a0ff0, vdev=0x2d32010) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/vhost.c:701
#6  0x00000000004221e9 in vhost_net_stop (net=0x18a0ff0, dev=0x2d32010) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/vhost_net.c:162
#7  0x000000000041f942 in virtio_net_reset (vdev=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/virtio-net.c:123
#8  0x0000000000575eaf in virtio_reset (opaque=0x2d32010) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/virtio.c:447
#9  0x0000000000420aa0 in virtio_pci_reset (d=0x2d21cc0) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/virtio-pci.c:170
#10 0x000000000040901a in qemu_system_reset () at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:3455
#11 0x0000000000428291 in qemu_kvm_system_reset () at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:1868
#12 kvm_main_loop () at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:2138
#13 0x000000000040e10b 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:4277
#14 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:6407
(gdb)

Comment 2 Amit Shah 2010-05-25 09:28:42 UTC

*** This bug has been marked as a duplicate of bug 585940 ***