You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have a device with an async transfer callback.
On Linux, if I physically disconnect the device, both with an USB2 or USB3 cable, the callback triggers and I see its status is LIBUSB_TRANSFER_NO_DEVICE.
On MacOSX however, if the device is connected via USB2 cable, I see the transfer status is LIBUSB_TRANSFER_ERROR. If the cable used is USB3, I see transfer status LIBUSB_TRANSFER_CANCELLED.
Is it expected behavior?
The text was updated successfully, but these errors were encountered:
fabiensanglard
changed the title
Macosx never returns LIBUSB_TRANSFER_NO_DEVICE?
Darwin async callback inconsistency: LIBUSB_TRANSFER_NO_DEVICE
Dec 7, 2023
Problem: adb server with libusb backend crashes when unplugging a device using an USB3 cable (macosx only). There are two issues at hand here.
First there is bug in libusb (libusb/libusb#1364). Upon detach, the transfer callback should be called with status LIBUSB_TRANSFER_NO_DEVICE but on darwin we get LIBUSB_TRANSFER_CANCELLED.
Second, this Check is wrong anyway. Upon detach, the read callback are triggered BEFORE the hotplug callback so `terminated_` cannot be set to true anyway.
Solution: Remove agressive trap. adb server doesn't crash if the trap
is removed and works normally.
Fixes: 308190337
Test: NA
Change-Id: I8ba10f910b6423e467a1b442aeba1e31c7a6610a
Let's say I have a device with an async transfer callback.
On Linux, if I physically disconnect the device, both with an USB2 or USB3 cable, the callback triggers and I see its status is
LIBUSB_TRANSFER_NO_DEVICE
.On MacOSX however, if the device is connected via USB2 cable, I see the transfer status is
LIBUSB_TRANSFER_ERROR
. If the cable used is USB3, I see transfer statusLIBUSB_TRANSFER_CANCELLED
.Is it expected behavior?
The text was updated successfully, but these errors were encountered: