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

Infinite loop in LinuxHidManager.Run #8

Open
VictorBonjour opened this issue Nov 11, 2021 · 1 comment
Open

Infinite loop in LinuxHidManager.Run #8

VictorBonjour opened this issue Nov 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@VictorBonjour
Copy link

Hello there,
I came accross an issue while using HidSharp 2.1.0 on Linux raspberrypi 5.10.17-v7l+.
I am using an USB device that be rebooted via a HID message. I send in the command, receive an acknowledgment and then the device reboots and the connection is lost.
The HidSharp API is behaving fine and the connection loss is handled perfectly.
However I noticed that a background thread was using 100% CPU after sending the command and after investigation, I found that the thread was stuck in an infinite loop in LinuxHidManager.Run:

image

The call to NativeMethods.poll() always returns revents=0 and thus we never exit the while loop.
The commented code is mine and is my naive attempt at fixing the problem. The fix works, but I'm pretty sure I'm missing something in the big picture.
Please tell me if I can provide any more useful information.
With regards
Victor

@benedekkupper benedekkupper added the bug Something isn't working label Jun 20, 2022
@mublower
Copy link

I run in the same issue, Ubuntu22.04.03. @VictorBonjour I know this has been an issue for a long time , have you found a solution?

Regards
Dave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants