[vbox-dev] Capturing a device usbLibDevCfgDrGet DeviceIoControl 1 fail winEr (31)

Mikhail Sennikovsky mikhail.sennikovsky at oracle.com
Tue Oct 18 13:02:20 GMT 2011


Hi Rabhi,

The usbLibDevCfgDrGet can now really fail when querying device info on 
device capture. This is because the device being captured gets (soft-) 
re-plugged, so it really disappears and then appears back, and doing 
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION and thing like this could 
fail within this time slot.
The problem is that since description of one and the same device could 
differ (depending on whether usbLibDevCfgDrGet fails or not), VBoxSVC 
may think it is two different devices. There is a logic in VBoxSVC that 
should prevent things like this, unfortunately it is hard to make it 
work 100% correct.
I'll have another look into it t see if it can be improved to work 
properly once I have a spare minute.

Thanks,
Mikhail

On 10/14/2011 7:18 PM, Ribhi Kamal wrote:
> For the issue in vboxsvc, it seems like its a locking issue.  See 
> attached log for more info.
> Thanks,
> Ribhi
> On Thu, Oct 13, 2011 at 2:02 PM, Ribhi Kamal <rbhkamal at gmail.com 
> <mailto:rbhkamal at gmail.com>> wrote:
>
>     Alright, this is a very old problem that used to happens A LOT
>     with the very first version of vbox that had usb support. The
>     problem went a way for a while and now its back. It also happens
>     in both my compiled and Oracle binaries.
>     Here is what happens:
>     The smart-card reader is inserted to the host and a virtual
>     machine is running (nothing is captured yet)
>     vboxmanage list usbhost, shows the smartcard device but without
>     the Manufacturer and product strings.
>     C:\Users\tester\Desktop\bin-new>VBoxManage.exe list usbhost
>     Host USB Devices:
>     UUID:               7344ae78-9c6a-429f-a5d7-95838e6084e7
>
>     VendorId:           0x04e6 (04E6)
>     ProductId:          0x511c (511C)
>     Revision:           5.24 (0524)
>     Address:            {50dd5230-ba8a-11d1-bf5d-0000f805f530}\0002
>     Current State:      Busy
>     Next, when trying to attach the device:
>     C:\Users\tester\Desktop\bin-new>VBoxManage.exe controlvm testing
>     usbattach {50dd5230-ba8a-11d1-bf5d-0000f805f530}\0002
>     C:\Users\tester\Desktop\bin-new>VBoxManage.exe list usbhost
>     Host USB Devices:
>     UUID:               7344ae78-9c6a-429f-a5d7-95838e6084e7
>
>     VendorId:           0x04e6 (04E6)
>     ProductId:          0x511c (511C)
>     Revision:           5.24 (0524)
>     Address:            {50dd5230-ba8a-11d1-bf5d-0000f805f530}\0002
>     Current State:      Captured
>     UUID:               c78f6adb-5884-4bd2-8449-a06a892f0629
>
>     VendorId:           0x04e6 (04E6)
>     ProductId:          0x511c (511C)
>     Revision:           5.24 (0524)
>     Manufacturer:       Axalto
>     Product:            Reflex USB v3
>     Address:
>     \\?\usb#vid_80ee&pid_cafe#21120614404073#{00873fdf-cafe-80ee-aa5e-00c04fb1720b}
>     Current State:      Held
>
>     C:\Users\tester\Desktop\bin-new>VBoxManage.exe list usbhost
>     Host USB Devices:
>     UUID:               7344ae78-9c6a-429f-a5d7-95838e6084e7
>
>     VendorId:           0x04e6 (04E6)
>     ProductId:          0x511c (511C)
>     Revision:           5.24 (0524)
>     Address:            {50dd5230-ba8a-11d1-bf5d-0000f805f530}\0002
>     Current State:      Captured
>     UUID:               c78f6adb-5884-4bd2-8449-a06a892f0629
>
>     VendorId:           0x04e6 (04E6)
>     ProductId:          0x511c (511C)
>     Revision:           5.24 (0524)
>     Manufacturer:       Axalto
>     Product:            Reflex USB v3
>     Address:            {50dd5230-ba8a-11d1-bf5d-0000f805f530}\0002
>     Current State:      Busy
>     Now the description for the smartcard reader is visable and the
>     capture will work.
>     C:\Users\tester\Desktop\bin-new>
>     C:\Users\tester\Desktop\bin-new>VBoxManage.exe controlvm testing
>     usbattach {50dd5230-ba8a-11d1-bf5d-0000f805f530}\0002
>     VBoxManage.exe: error: USB device '<unknown>' with UUID
>     {7344ae78-9c6a-429f-a5d7-95838e6084e7} is busy with a previous
>     request. Please try again later
>     VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057),
>     component HostUSBDevice, interface IHostUSBDevice, callee IUnknown
>     VBoxManage.exe: error: Context: "AttachUSBDevice(usbId.raw())" at
>     line 832 of file VBoxManageControlVM.cpp
>     C:\Users\tester\Desktop\bin-new>VBoxManage.exe controlvm testing
>     usbattach *c78f6adb-5884-4bd2-8449-a06a892f0629*
>     C:\Users\tester\Desktop\bin-new>VBoxManage.exe list usbhost
>     Host USB Devices:
>     UUID:               7344ae78-9c6a-429f-a5d7-95838e6084e7
>
>     VendorId:           0x04e6 (04E6)
>     ProductId:          0x511c (511C)
>     Revision:           5.24 (0524)
>     Address:            {50dd5230-ba8a-11d1-bf5d-0000f805f530}\0002
>     Current State:      Captured
>     UUID:               c78f6adb-5884-4bd2-8449-a06a892f0629
>
>     VendorId:           0x04e6 (04E6)
>     ProductId:          0x511c (511C)
>     Revision:           5.24 (0524)
>     Manufacturer:       Axalto
>     Product:            Reflex USB v3
>     Address:
>     \\?\usb#vid_80ee&pid_cafe#21120614404073#{00873fdf-cafe-80ee-aa5e-00c04fb1720b}
>     Current State:      Captured
>
>     C:\Users\tester\Desktop\bin-new>
>     I'm not sure, but I think this problem was not in 4.1.2 and
>     definitely not in 4.0.12.
>     Thanks,
>     Ribhi
>     On Thu, Oct 13, 2011 at 12:12 PM, Ribhi Kamal <rbhkamal at gmail.com
>     <mailto:rbhkamal at gmail.com>> wrote:
>
>         More than often I see the following error when trying to
>         capture the axalto smartcard reader:
>         VBoxSVC.log
>         VirtualBox (XP)COM Server 4.1.51_OSE r38834 win.amd64 (Oct 11
>         2011 12:53:24) release log
>         00:00:00.000 main     Log opened 2011-10-13T15:58:02.008196600Z
>         00:00:00.000 main     OS Product: Windows 7
>         00:00:00.000 main     OS Release: 6.1.7601
>         00:00:00.000 main     Executable:
>         C:\Users\tester\Desktop\bin-new\VBOXSVC.exe
>         00:00:00.000 main     Process ID: 2152
>         00:00:00.000 main     Package type: WINDOWS_64BITS_GENERIC (OSE)
>         00:00:00.016          Loading settings file
>         "C:\Users\tester/.VirtualBox\VirtualBox.xml" with version
>         "1.12-windows"
>         00:00:00.156          usbLibDevCfgDrGet: DeviceIoControl 1
>         fail winEr (31)
>         00:00:00.453          VDInit finished
>         00:00:00.453          Loading settings file
>         "C:\Users\tester\VirtualBox VMs\testing\testing.vbox" with
>         version "1.11-windows"
>         00:00:01.794 USBPROXY usbLibDevCfgDrGet: DeviceIoControl 1
>         fail winEr (31)
>         ------------------------------------------------------------
>         After the capture the device will be left in the following state:
>         C:\Users\tester\Desktop\bin-new>VBoxManage.exe list usbhost
>         Host USB Devices:
>         UUID:               717a5a0d-3510-4b9e-a5f5-2830de45ff3f
>         VendorId:           0x04b9 (04B9)
>         ProductId:          0x1000 (1000)
>         Revision:           1.0 (0100)
>         Manufacturer:       Rainbow Technologies
>         Product:            iKey 1000
>         Address:
>         \\?\usb#vid_80ee&pid_cafe#5&35ea7c2c&0&1#{00873fdf-cafe-80ee-aa5e-00c04fb1720b}
>         Current State:      Captured
>         UUID:               407b053e-0566-47de-b293-a81781524dbf
>         VendorId:           0x04e6 (04E6)
>         ProductId:          0x511c (511C)
>         Revision:           5.24 (0524)
>         Address:            {50dd5230-ba8a-11d1-bf5d-0000f805f530}\0002
>         _*Current State:      Captured*_
>         UUID:               d027769c-8edb-4e12-a93e-56ff4e0614c6
>         VendorId:           0x0b97 (0B97)
>         ProductId:          0x7772 (7772)
>         Revision:           1.16 (0116)
>         Manufacturer:       O2
>         Product:            O2Micro CCID SC Reader
>         Address:            {50dd5230-ba8a-11d1-bf5d-0000f805f530}\0001
>         Current State:      Busy
>         There are two problems:
>         1- The capture issue. (maybe retry usbLibDevCfgDrGet?)
>         2- Handling the error is not done properly in vboxsvc(?) and
>         the device is left the "Captured" state eventhough it is not.
>         Please let me know how I can help.
>
>         Thanks,
>         -- Ribhi
>
>
>
>
>     -- 
>     -- Ribhi
>
>
>
>
> -- 
> -- Ribhi
>
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20111018/9d82420a/attachment.html>


More information about the vbox-dev mailing list