HidSharp icon indicating copy to clipboard operation
HidSharp copied to clipboard

Infinite loop in LinuxHidManager.Run

Open VictorBonjour opened this issue 3 years ago • 1 comments

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

VictorBonjour avatar Nov 11 '21 10:11 VictorBonjour

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

mublower avatar Dec 18 '23 13:12 mublower

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

DaVarga avatar Aug 26 '24 21:08 DaVarga

Fixed with #34, thanks @DaVarga !

benedekkupper avatar Sep 17 '24 10:09 benedekkupper