Summary: | Unplugging controller causes 100% usage of one CPU core | ||
---|---|---|---|
Product: | [Applications] systemsettings | Reporter: | tguen <tguenther.dev> |
Component: | kcm_joystick | Assignee: | Unassigned bugs mailing-list <unassigned-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | isma.af, tguenther.dev, xnagytibor |
Priority: | NOR | ||
Version: | 5.27.3 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-desktop/-/commit/7fe5642bc3dda5d04e299c2f929c54642964bd22 | Version Fixed In: | 6 |
Sentry Crash Report: |
Description
tguen
2017-01-08 11:08:05 UTC
Which process? systemsettings5 It stops using the CPU when I click the 'all settings' button in the top left. Issue remains in 5.21 I can also reproduce this with 5.23. I may be entirely wrong but this is what I see happening: 1. You pull out the joystick cable. 2. Joystick's device file gets nuked. 3. This select call [1] starts always returning immediately without timeouts. No errors thrown. 4. This read call [2] doesn't read anything anymore. No errors thrown. 5. Event loop goes hyperspeed because of the lack of timeouts. [1] https://invent.kde.org/plasma/plasma-desktop/-/blob/58f29efd5d2975129c07dcdc4a9eb78669c5eb67/kcms/joystick/joydevice.cpp#L292 [2] https://invent.kde.org/plasma/plasma-desktop/-/blob/58f29efd5d2975129c07dcdc4a9eb78669c5eb67/kcms/joystick/joydevice.cpp#L298 No idea about how to properly fix it though. This bug could be a prime candidate for the KDE Eco project. I don't think these kind of busy loops are environmentally-friendly. I have no hardware to test it however this bug may also affect the thermals and battery life of Valve's Steam Deck. Their user base is more likely to encounter this bug than the usual desktop KDE users for obvious reasons. And imagine unnecessarily spinning a core 100% on a handheld device where every Wh counts... Issue remains in 5.27.3 Should be fixed with the introduction of the new GameController KCM. It uses a completely different codepath via SDL2. Please, feel free to reopen if you still can reproduce it after Plasma 6. |