IntergatedCircuits / HidSharp

HIDSharp is a multiplatform C# library for USB HID devices by James F. Bellinger
https://www.zer7.com/software/hidsharp
Other
121 stars 34 forks source link

Infinite loop in LinuxHidManager.Run #8

Open VictorBonjour opened 2 years ago

VictorBonjour commented 2 years ago

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

mublower commented 8 months ago

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

DaVarga commented 6 hours ago

@benedekkupper This still happens on Manjaro Linux, Kernel 6.6.44-1. Is this project still maintained?