Yubico / Yubico.NET.SDK

A YubiKey SDK for .NET developers
Apache License 2.0
96 stars 48 forks source link

High CPU usage on Linux #45

Closed tkolo closed 1 year ago

tkolo commented 1 year ago

I've been using this SDK under Arch Linux and encountered an issue similar to #13 and #37. Upon closer inspection the problem seems to lie in LinuxHidDeviceListener.CheckForUpdates, here: https://github.com/Yubico/Yubico.NET.SDK/blob/1.7.0/Yubico.Core/src/Yubico/Core/Devices/Hid/LinuxHidDeviceListener.cs#L157 It seems that the code expects the call to udev_monitor_receive_device to block but, at least on my system, it doesn't, instead returning NULL pointer immediately. I'm by no means familiar with udev and systemd's documentation leaves a lot to be desired so I can't tell whenever this is a bug in udev/systemd or this SDK.

I'm using Arch Linux with systemd 253

$ systemctl --version
systemd 253 (253.3-3-arch)
+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified
GregDomzalski commented 1 year ago

Apologies for the delay. The fix for this issue has now been released in our 1.8.0 release: https://github.com/Yubico/Yubico.NET.SDK/releases/tag/1.8.0

I'm resolving this issue now that the fix should be in our public release.