Bug 726317

Summary: code dumped when start guest with multi usb devices and specify usb port than 4.
Product: Red Hat Enterprise Linux 6 Reporter: FuXiangChun <xfu>
Component: qemu-kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 6.2CC: bcao, ddutile, juzhang, michen, mkenneth, qzhou, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-14 09:23:59 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 FuXiangChun 2011-07-28 08:01:57 UTC
Description of problem:
use commandline to start guest with multi usb devices, and specify usb port >4. code dumped

Version-Release number of selected component (if applicable):
# uname -r
2.6.32-171.el6.x86_64
# rpm -qa|grep kvm
qemu-kvm-0.12.1.2-2.172.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.# /usr/libexec/qemu-kvm -M rhel6.1.0 -enable-kvm -m 4G -smp 2,sockets=2,cores=1,threads=1 -name rhel6 -uuid 745fe449-aac8-29f1-0c2d-5042a707263b -boot c -drive file=rhel61.qcow2,if=none,id=drive-ide0-0-0,format=qcow2,cache=none,aio=threads -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,id=hostnet1,vhost=on,script=/etc/qemu-ifup -device rtl8139,netdev=hostnet1,mac=00:24:21:7F:B6:01,bus=pci.0,id=virtio-net-pci1 -usb -device usb-ehci,id=ehci1 -device usb-hub,port=1 -device usb-ehci,id=ehci2 -device usb-hub,port=2,bus=ehci1.0 -usb -device usb-ehci,id=ehci3 -device usb-hub,port=3 -device usb-ehci,id=ehci4 -device usb-hub,port=5,bus=ehci1.0 -monitor stdio  -spice disable-ticketing,port=5912
do_spice_init: starting 0.8.2
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
*** EHCI support is under development ***
*** EHCI support is under development ***
*** EHCI support is under development ***
*** EHCI support is under development ***
Warning: usb port 5 (bus ehci1.0) not found
Segmentation fault (core dumped)
2.
3.
  
Actual results:
code dumped

Expected results:
can not code dumped


Additional info:

Comment 1 juzhang 2011-07-28 09:38:31 UTC
> Actual results:
> code dumped
> 
Please upload core dump file.

Comment 2 FuXiangChun 2011-07-28 10:39:11 UTC
core dump file:

(gdb) bt
#0  0x00000037dcd2686f in __strlen_sse42 () from /lib64/libc.so.6
#1  0x0000000000478dcb in qemu_strdup (str=0xc <Address 0xc out of bounds>) at qemu-malloc.c:93
#2  0x00000000004b9d72 in vmstate_register (dev=0x35dbd10, instance_id=-1, vmsd=0x63e640, opaque=0x35dbd10) at savevm.c:1237
#3  0x00000000004bd81f in qdev_init (dev=0x35dbd10) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/qdev.c:288
#4  0x00000000004bdb79 in qdev_device_add (opts=0x1faa450) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/qdev.c:253
#5  0x0000000000409279 in device_init_func (opts=<value optimized out>, opaque=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4610
#6  0x0000000000478ffa in qemu_opts_foreach (list=<value optimized out>, func=0x409270 <device_init_func>, opaque=0x0, abort_on_failure=<value optimized out>) at qemu-option.c:943
#7  0x000000000040cf78 in 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:6143

Comment 6 FuXiangChun 2011-09-13 11:55:46 UTC
verify on above build (qemu-kvm-0.12.1.2-2.185.el6.usb.9.x86_64)

# /usr/libexec/qemu-kvm -M rhel6.1.0 -enable-kvm -m 4G -smp 2,sockets=2,cores=1,threads=1 -name rhel6 -uuid 745fe449-aac8-29f1-0c2d-5042a707263b -boot c -drive file=/home/rhel61-new.qcow2,if=none,id=drive-ide0-0-0,format=qcow2,cache=none,aio=threads -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -net none -monitor stdio -spice disable-ticketing,port=5912 -readconfig /home/ich9-ehci-uhci.cfg -device usb-hub,port=1,bus=ehci.0 -device usb-hub,port=2,bus=ehci.0 -device usb-hub,port=3,bus=ehci.0 -device usb-hub,port=4,bus=ehci.0 -device usb-hub,port=5,bus=ehci.0 -device usb-hub,port=6,bus=ehci.0

actual result:

guest boot successful

Comment 7 Gerd Hoffmann 2011-09-14 09:23:59 UTC
Good, then it actually is a dup of 734995

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