When discovering an usb device with bulk transfer capability, and removing it very fast after it was discovered results in crash in libusb_bulk_transfer call.
Callstack (EXC_BAD_ACCESS):
list_del
remove_from_flying_list
libusb_submit_transfer
do_sync_bulk_transfer
libusb_bulk_transfer
This might have to do with thread safety the call is from a different thread than the one the device was discovered in, but I am unsure what should be synchronised to prevent this crash from happening. It is not reproducible every time I try it, but just every 4th time or so. So that makes me think that I am using this in a non-thread safe way.
This typical happens when I have an usb device connected that requires more power inrush than 500mA that can be given. Leads to a discovery and then the usb device is shutdown when powered up.
libusb 1.0.22
osx version 10.13.6 (17G65)
When discovering an usb device with bulk transfer capability, and removing it very fast after it was discovered results in crash in libusb_bulk_transfer call.
Callstack (EXC_BAD_ACCESS):
list_del
remove_from_flying_list
libusb_submit_transfer
do_sync_bulk_transfer
libusb_bulk_transfer
This might have to do with thread safety the call is from a different thread than the one the device was discovered in, but I am unsure what should be synchronised to prevent this crash from happening. It is not reproducible every time I try it, but just every 4th time or so. So that makes me think that I am using this in a non-thread safe way.
This typical happens when I have an usb device connected that requires more power inrush than 500mA that can be given. Leads to a discovery and then the usb device is shutdown when powered up.
libusb 1.0.22
osx version 10.13.6 (17G65)