Bug 1338752

Summary: Guest hangs after deactive the USB device in "selec USB devices for redirection" dialogue
Product: Red Hat Enterprise Linux 7 Reporter: Xiaodai Wang <xiaodwan>
Component: spiceAssignee: Default Assignee for SPICE Bugs <rh-spice-bugs>
Status: CLOSED ERRATA QA Contact: SPICE QE bug list <spice-qe-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: cfergeau, djasa, juzhou, mxie, mzhan, rbalakri, rduda, tpelka, tzheng, victortoso, xiaodwan
Target Milestone: rcKeywords: OtherQA
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: spice-0.12.4-18.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 03:44:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Xiaodai Wang 2016-05-23 11:42:25 UTC
Description of problem:
Guest hangs after deactive the USB device in "selec USB devices for redirection" dialogue.

Version-Release number of selected component (if applicable):
virt-viewer-2.0-7.el7.x86_64

# rpm -q usbredir qemu-kvm-rhev kernel libvirt
usbredir-0.6-8.el7.x86_64
qemu-kvm-rhev-2.6.0-2.el7.x86_64
kernel-3.10.0-408.el7.x86_64
libvirt-1.3.4-1.el7.x86_64
# rpm -qa | grep spice
spice-server-0.12.4-17.el7.x86_64
spice-gtk-0.31-2.el7.x86_64
spice-gtk3-0.31-2.el7.x86_64
spice-glib-0.31-2.el7.x86_64
spice-gtk-python-0.31-2.el7.x86_64
spice-vdagent-0.14.0-10.el7.x86_64
spice-protocol-0.12.11-1.el7.noarc

How reproducible:
100%

Steps to Reproduce:
1. Plug into a usb device to host.
2. Run virt-viewer $guest to open a vm.
$ virt-viewer -c qemu:///system rhel7.2
3. Click File->USB device selection, active the usb device which you plugged into the host and then click close button.
4. Redo step3 to deactive the usb device and click close button.

Actual results:
Guest hangs after deactiving the usb device. 

Expected results:
Guest should run normal and the usb device should be removed successfully.

Additional info:
This problem can also be reproduced with virt-manager. I'm not sure which component it should be. i think it may be a spice-gtk problem. Please help to move to the right component if i was wrong. Thanks!

Comment 2 Victor Toso 2016-05-30 14:00:33 UTC
This is fixed upstream by 0c1f5b00e7907aefee13f86a234558f00cd6c7ef

If reporter can double check with the following scratch-build it would be great!
https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=11104352

Comment 3 Victor Toso 2016-05-30 14:01:14 UTC
Moving to the right component.

Comment 4 Xiaodai Wang 2016-05-31 09:01:09 UTC
(In reply to Victor Toso from comment #2)
> This is fixed upstream by 0c1f5b00e7907aefee13f86a234558f00cd6c7ef
> 
> If reporter can double check with the following scratch-build it would be
> great!
> https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=11104352

Hi, this scratch build works well for this problem. Thanks!

Comment 5 Victor Toso 2016-05-31 09:14:19 UTC
(In reply to xiaodwan from comment #4)
> Hi, this scratch build works well for this problem. Thanks!

Many thanks for testing!

--

I was too brief con comment #2. Patch that fixes this is https://cgit.freedesktop.org/spice/spice/commit/?id=0c1f5b00e7907aefee13f86a234558f00cd6c7ef

The hint of the problem was the lock on the backtrace:

Thread 1 (Thread 0x7f9cfea72c40 (LWP 586)):
#0  0x00007f9cf8704f4d in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x00007f9cf8700d02 in _L_lock_791 () from /lib64/libpthread.so.0
#2  0x00007f9cf8700c08 in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x00007f9cfeee7e89 in qemu_mutex_lock ()
#4  0x00007f9cfed45ee2 in qemu_chr_fe_write ()
#5  0x00007f9cfee108c8 in usbredir_write ()
#6  0x00007f9cf80db2f3 in usbredirparser_do_write () from /lib64/libusbredirparser.so.1
#7  0x00007f9cfed48e87 in vmc_write ()
#8  0x00007f9cf9b2ce81 in spice_char_device_write_to_device () from /lib64/libspice-server.so.1
#9  0x00007f9cf9b2df39 in spice_char_device_wakeup () from /lib64/libspice-server.so.1
#10 0x00007f9cfed49216 in spice_chr_write ()
#11 0x00007f9cfed45eee in qemu_chr_fe_write ()
#12 0x00007f9cfee108c8 in usbredir_write ()
#13 0x00007f9cf80db2f3 in usbredirparser_do_write () from /lib64/libusbredirparser.so.1
#14 0x00007f9cfed48e87 in vmc_write ()
#15 0x00007f9cf9b2ce81 in spice_char_device_write_to_device () from /lib64/libspice-server.so.1
#16 0x00007f9cf9b7e64f in spicevmc_red_channel_client_handle_message () from /lib64/libspice-server.so.1
#17 0x00007f9cf9b3dfc3 in red_channel_client_receive () from /lib64/libspice-server.so.1
#18 0x00007f9cf9b4017c in red_channel_client_event () from /lib64/libspice-server.so.1
#19 0x00007f9cfee707e8 in aio_dispatch ()
#20 0x00007f9cfee63b4e in aio_ctx_dispatch ()
#21 0x00007f9cf7975d7a in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#22 0x00007f9cfee6f100 in main_loop_wait ()

Comment 6 Pavel Grunt 2016-06-24 08:16:52 UTC
*** Bug 1349390 has been marked as a duplicate of this bug. ***

Comment 7 Tomas Pelka 2016-09-01 13:50:51 UTC
Not in any erratum for 7.3, lets try to add it somewhere.

Comment 13 errata-xmlrpc 2016-11-04 03:44:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2324.html