Skip to content
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

libusb: stop read_thread from looping indefinitely (#456) #457

Merged
merged 1 commit into from
Sep 28, 2022
Merged

libusb: stop read_thread from looping indefinitely (#456) #457

merged 1 commit into from
Sep 28, 2022

Conversation

thesilvanator
Copy link
Contributor

- When `libusb_submit_transfer` in `read_thread` fails,
`read_callback` never gets called and never sets `transfer_loop_finished`
to true, causing `read_thread` to loop indefinitely.

- Fix this by skipping the handle_events for the transfer

- Fixes #456
@Youw Youw added the libusb Related to libusb backend label Sep 13, 2022
Copy link
Member

@Youw Youw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look about right

@thesilvanator
Copy link
Contributor Author

I see that you have approved this, but the one of the CI checks seems to be still waiting for completion. Is there anything I can do to fix this?

@Youw
Copy link
Member

Youw commented Sep 14, 2022

No worries, that is not a blocker.

@thesilvanator
Copy link
Contributor Author

Ah, ok. So when does this eventually get merged in?

@Youw Youw merged commit 5ce9051 into libusb:master Sep 28, 2022
jclulow pushed a commit to oxidecomputer/hidapi that referenced this pull request Mar 28, 2024
- When `libusb_submit_transfer` in `read_thread` fails, `read_callback` never gets called and never sets `transfer_loop_finished` to true, causing `read_thread` to loop indefinitely;

- Do not attempt to run a read loop if the initial `libusb_submit_transfer` fails fixes the issue;

Fixes: libusb#456
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libusb Related to libusb backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hidapi-libusb: if libusb_submit_transfer fails in read_thread, hid_close hangs
2 participants