[Spice-devel] virt-viewer on win10 32bit abort when pullingoutthe USB

Sameeh Jubran sameeh at daynix.com
Sun Jan 28 16:24:11 UTC 2018


The issue that

On Fri, Jan 26, 2018 at 3:59 PM, Frediano Ziglio <fziglio at redhat.com> wrote:

> Is installing debug information not enough?
> Sameeh, can you provide him needed software?
>
The software needed is all provided by Microsoft and no intalling debug
info is not enough, the steps for collecting traces is completely covered
in the document I refereed to earlier. (https://github.com/daynix/
UsbDk/blob/master/Documentation/Tracing.txt).

Wang, can you please elaborate on what went wrong with traceview? You
should be able to install WDK successfully and get traceview from there. No
need for compilation.

Regarding the client crashing, I took a look at the code and I can tell you
what to investigate since I cant reproduce this.


spice-gtk [1] uses usbredir [2] for managing the usb and usbredir uses
libusb [3] which uses UsbDk [4] as a backend.

I think that the call stack looks like this when you remove the device:

*spice-gtk:*
spice_usb_device_manager_remove_dev or
spice_usb_device_manager_disconnect_device
disconnect_device_sync
spice_usbredir_channel_disconnect_device
usbredirhost_set_device (called with usb_dev_handle = null which causes the
redirection to stop as documented [5])


*usbredir:*
usbredirhost_set_device
usbredirhost_clear_device
usbredirhost_wait_for_cancel_completion
libusb_handle_events_timeout

*libusb:*
libusb_handle_events_timeout
handle_events
windows_handle_events
windows_handle_callback (status = LIBUSB_TRANSFER_ERROR)  --> libusb: error
[windows_transfer_callvack] detected I/O error 1627: [1627] During
execution, the function has encountered a problem

So I'd suggest that you add few debug prints to usbredir in order to
determine what actually causes the crash.

I'm not that familiar with spice compilation so can anyone shed a light on
Windows compilation of usbredir?

[1] - https://cgit.freedesktop.org/spice/spice-gtk/
[2] - https://cgit.freedesktop.org/spice/usbredir
[3] - https://github.com/libusb/libusb
[4] - https://github.com/daynix/UsbDk
<https://github.com/daynix/UsbDk/blob/master/Documentation/Tracing.txt>
[5] -
https://cgit.freedesktop.org/spice/usbredir/tree/usbredirhost/usbredirhost.h#n96



>

> Frediano
>
>
> ------------------------------
>
> *From: *"王杰东" <wangjiedong at kylinos.cn>
> *To: *"Sameeh Jubran" <sameeh at daynix.com>
> *Cc: *"Yan Vugenfirer" <yan at daynix.com>, "spice-devel" <spice-devel at lists.
> freedesktop.org>
> *Sent: *Friday, January 26, 2018 6:48:34 AM
>
> *Subject: *Re: [Spice-devel] virt-viewer on win10 32bit abort when
> pullingoutthe USB
>
> I'm sorry for no responding at once.
> I tried to install tracing tools , Dbgview.exe had only few info, however,
> another tools like traceview.exe from WDK could not be installed, so i get
> on traces now.
> But I build another environment using win10 32bit with virt-viewer 5.0/6.0
> and UsbDk 1.0.17/1.0.19, both of them aborted. because of the complex
> compilation process on windows, i can never debug the code.
> So i wish you can  investigate the BUG, thanks!
>
> ------------------ Original ------------------
> *From: * "Sameeh Jubran"<sameeh at daynix.com>;
> *Date: * Mon, Jan 15, 2018 06:55 PM
> *To: * "王杰东"<wangjiedong at kylinos.cn>;
> *Cc: * "spice-devel"<spice-devel at lists.freedesktop.org>; "Yan Vugenfirer"<
> yan at daynix.com>;
> *Subject: * Re: [Spice-devel] virt-viewer on win10 32bit abort when
> pullingoutthe USB
>
>
>
> On Mon, Jan 15, 2018 at 3:40 AM, 王杰东 <wangjiedong at kylinos.cn> wrote:
>
>> Firstly, I installed UsbDk 1.0.19 and VirtViewer 6.0.256 , then i tried
>> UsbDk 1.0.17 and VirtViewer 5.0.256 .
>>
> and i tried Sandisk and Kingston usb device , all of these aborted .
>> But i never install libusb additionally , only find libusb-1.0.dll in
>> virtviewer\bin\ .
>> is that enough ? it's right with windows 64bit when only installing UsbDk
>> and VirtViewer .
>>
> Yes this is enough.
>
> There are two issues that we need to investigate in order to resolve this:
>
> 1. What is the error occuring in the first place
> 2. Which component is not handling this failure correctly
>
> For 1 enabling UsbDk tracing can give us a bigger picture on what's
> causing this error, please refer to the following link for instructions on
> tracing UsbDk:
> https://github.com/daynix/UsbDk/blob/master/Documentation/Tracing.txt
>
> For 2 It could be the usbredir (https://cgit.freedesktop.org/
> spice/usbredir) component failing to handle libusb failures. I am not
> that familiar with the usbredir code,
> but inserting few debug prints in the main loop should give a good idea
> where this bug lies.
>
> Please do send traces back so we can further investigate the issue =)
>
>>
>>
>> ------------------ Original ------------------
>> *From: * "Sameeh Jubran"<sameeh at daynix.com>;
>> *Date: * Mon, Jan 15, 2018 00:22 AM
>> *To: * "王杰东"<wangjiedong at kylinos.cn>;
>> *Cc: * "spice-devel"<spice-devel at lists.freedesktop.org>;
>> *Subject: * Re: [Spice-devel] virt-viewer on win10 32bit abort when
>> pulling outthe USB
>>
>>
>>
>> On Sun, Jan 14, 2018 at 11:38 AM, 王杰东 <wangjiedong at kylinos.cn> wrote:
>>
>>> I installed lastest virt-viewer and UsbDk on win10 32bit OS , and I
>>> successed to redirect my USB to the windows 7 VM .
>>> But when i cancelled the check box of the USB or pulled out the USB ,
>>> remote-viewer.exe aborted at once .
>>> I tested some VERSION of virt-viewer、UsbDk and spice-server , but it
>>> allways aborted .
>>> I got this when --debug "libusb: error [windows_transfer_callvack]
>>> detected I/O error 1627: [1627] 执行期间,函数出了问题"
>>>
>> Which version of libusb, UsbDK are you using? Can you reproduce this with
>> other usb devices?
>>
>>
>>> Can you help me for this ? Thanks .
>>>
>>>
>>> _______________________________________________
>>> Spice-devel mailing list
>>> Spice-devel at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/spice-devel
>>>
>>>
>>
>>
>> --
>> Respectfully,
>> *Sameeh Jubran*
>> *Linkedin <https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a>*
>> *Software Engineer @ Daynix <http://www.daynix.com>.*
>>
>
>
>
> --
> Respectfully,
> *Sameeh Jubran*
> *Linkedin <https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a>*
> *Software Engineer @ Daynix <http://www.daynix.com>.*
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
>
>
>


-- 
Respectfully,
*Sameeh Jubran*
*Linkedin <https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a>*
*Software Engineer @ Daynix <http://www.daynix.com>.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180128/3f45b12b/attachment.html>


More information about the Spice-devel mailing list