-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USBTransfer finalize issue #102
Comments
The bug to cause the hang on issue: If user didn't cancel the transfer, during the USBDeviceHandle finalizing, the python-libusb1/usb1/__init__.py Lines 1073 to 1085 in a03f4c3
|
As for the segment fault error, seems a libusb bug in macOS. See libusb/libusb#1059 |
Thank you for the very detailed bug report.
This code makes the assumption that every submitted transfer (
In the case you describe, this seems to not happen when you release the interface. I think in this case the kernel is the piece of code responsible for completing all in-flight transfers with an error in such case, and that libusb would then "just work": it would get the transfer completion from the kernel, call the transfer callback, which would remove it from the ...unless libusb actively does something to prevent that from happening when releasing the interface. Could you try increasing libusb verbosity to try to see what is happening at its level ? See |
In above code, if I don't cancel the transfers, the program will hang on exit.
By using
Ctrl-C
, I can see the program blocks on https://github.com/vpelletier/python-libusb1/blob/master/usb1/__init__.py#L1083 , and then it blocks on https://github.com/vpelletier/python-libusb1/blob/master/usb1/__init__.py#L307Another issue is that if
transfer.setBulk()
is never invoked after create the transfer, segment fault will occur.The text was updated successfully, but these errors were encountered: