Summary: | libusb_handle_events_completed() hangs after device removal | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Konrad Jopek <kjopek> | ||||
Component: | usb | Assignee: | freebsd-usb (Nobody) <usb> | ||||
Status: | New --- | ||||||
Severity: | Affects Some People | CC: | hselasky | ||||
Priority: | --- | ||||||
Version: | 11.0-RELEASE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Konrad Jopek
2017-01-04 13:39:36 UTC
Hi, Can you set the LIBUSB_DEBUG environment before running the USB application? env LIBUSB_DEBUG=0 program > log0.txt env LIBUSB_DEBUG=1 program > log1.txt env LIBUSB_DEBUG=2 program > log2.txt And reproduce the issue? libusb_handle_events_completed() only returns when the *completed variable is set to non-zero, typically when the USB transfer callbacks receive a CANCELLED error code. Maybe the pcscd APP doesn't check for this error code? --HPS Hi, Also try to attach to the hung process using "gdb -p proc_number" and enter "bt" to get a backtrace. It will be helpful. --HPS Q: How to cancel a transfer after device removal if libusb_cancel_transfer() fails with LIBUSB_ERROR_NOT_FOUND since the device is removed? A: The FreeBSD USB stack will automatically cancel all pending transfers belonging to a USB device when it is detached and upon receiving a transfer status of LIBUSB_TRANSFER_CANCELLED, pcscd should not try re-submit the USB transfer and set its termination flag. --HPS |