|
From: libusb T. <tr...@li...> - 2012-07-09 19:00:20
|
#140: Windows backend hangs on XP using multiple threads.
--------------------+-----------------------------------------
Reporter: mozmck | Owner:
Type: defect | Status: new
Milestone: | Component: libusb-1.0 Windows backend
Keywords: | Blocked By:
Blocks: |
--------------------+-----------------------------------------
I have a program with 2 threads. One thread submits OUT transfers, and
another thread calls libusb_handle_events_completed(). This event thread
also submits an IN transfer which is re-submitted in it's callback.
This code works in Linux, but hangs the program in windows after a short
amount of time. I have only tried this in WinXP because that's all I
have.
Here is a brief section of the debug output:
libusb: 1.351944 debug [] handling I/O completion with errcode 0
libusb: 1.361958 debug [] matched endpoint 01 with interface 0
libusb: 1.361958 debug [] could not duplicate handle for CancelIo - using
original one
libusb: 1.361958 debug [] writing 60 bytes
libusb: 1.361958 debug [] add fd 6 events 4
libusb: 1.361958 warning [] Unable to cancel I/O that was started from
another thread
libusb: 1.361958 debug [] transfer 009D2928 has callback 00464F9F
libusb: 1.361958 debug [] no URB with timeout or all handled by OS; no
timeout!
libusb: 1.361958 debug [] doing our own event handling
libusb: 1.361958 debug [] poll() 3 fds with timeout in 60000ms
libusb: 1.361958 warning [] invalid fd
libusb: 1.361958 debug [] poll() returned -1
libusb: 1.361958 error [] poll failed -1 err=9
And here is a section up to the very end of the log when it hung:
libusb: 1.392001 debug [] checking fd 3 with revents = 0000
libusb: 1.392001 debug [] checking fd 4 with revents = 0001
libusb: 1.392001 error [] could not find a matching transfer for fd 4
libusb: 1.392001 error [] backend handle_events failed with error -5
libusb: 1.392001 debug [] no URB with timeout or all handled by OS; no
timeout!
libusb: 1.402016 debug [] matched endpoint 01 with interface 0
libusb: 1.402016 debug [] could not duplicate handle for CancelIo - using
original one
libusb: 1.402016 debug [] writing 60 bytes
libusb: 1.402016 debug [] add fd 7 events 4
libusb: 1.402016 debug [] doing our own event handling
libusb: 1.402016 debug [] poll() 5 fds with timeout in 60000ms
libusb: 1.402016 debug [] poll() returned 3
libusb: 1.402016 debug [] checking fd 3 with revents = 0000
libusb: 1.402016 debug [] checking fd 4 with revents = 0001
--
Ticket URL: <https://libusb.org/ticket/140>
libusb <https://libusb.org/>
C library for writing portable USB drivers in userspace
|