https://bugs.kde.org/show_bug.cgi?id=507883
Bug ID: 507883 Summary: ksgrd_network_helper hangs on system shutdown Classification: Applications Product: plasma-systemmonitor Version First 6.4.3 Reported In: Platform: Arch Linux OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: general Assignee: ksysguard-b...@kde.org Reporter: kde.designer...@passfwd.com CC: ahiems...@heimr.nl, plasma-b...@kde.org Target Milestone: --- SUMMARY When running the default plasma-systemmonitor overview page, the system will hang on shutdown / restart for varying amounts of time, sometimes long enough to hit the SIGKILL timeout. Example log of the issue: Aug 04 17:22:02 systemd[1174]: Started System Monitor. Aug 04 17:34:06 systemd[1174]: Stopping System Monitor... Aug 04 17:35:36 systemd[1174]: app-org.kde.plasma\x2dsystemmonitor@a797899b4b96428aa30f8a08fee87e88.service: State 'stop-sigterm' timed out. Killing. Aug 04 17:35:36 systemd[1174]: app-org.kde.plasma\x2dsystemmonitor@a797899b4b96428aa30f8a08fee87e88.service: Killing process 5467 (ksgrd_network_h) with signal SIGKILL. Aug 04 17:35:36 systemd[1174]: app-org.kde.plasma\x2dsystemmonitor@a797899b4b96428aa30f8a08fee87e88.service: Killing process 5474 (ksgrd_network_h) with signal SIGKILL. Aug 04 17:35:36 systemd[1174]: app-org.kde.plasma\x2dsystemmonitor@a797899b4b96428aa30f8a08fee87e88.service: Failed with result 'timeout'. Aug 04 17:35:36 systemd[1174]: Stopped System Monitor. Aug 04 17:35:36 systemd[1174]: app-org.kde.plasma\x2dsystemmonitor@a797899b4b96428aa30f8a08fee87e88.service: Consumed 31.842s CPU time, 125.4M memory peak. STEPS TO REPRODUCE 1. Start System Monitor 2. Issue system shutdown or restart OBSERVED RESULT System shutdown varies wildly between a few seconds to over 90 seconds. EXPECTED RESULT System shutdown consistently occurs within a few seconds. SOFTWARE/OS VERSIONS Linux/KDE Plasma: 6.15.9-arch1-1 KDE Plasma Version: 6.4.3 KDE Frameworks Version: 6.16.0 Qt Version: 6.9.1 ADDITIONAL INFORMATION After examining the source, it looks like the issue probably lies in Capture::nextPacket(). This function will block indefinitely until the next network packet is received, with no way to interrupt at program exit. This means that even on process shutdown, the network helper will block until any TCP/UDP traffic is received (at which point it will see that m_running is now false, and will join the thread). Assuming that network activity is minimal to nonexistent on system shutdown, this could block for an arbitrary amount of time, instead of exiting gracefully. -- You are receiving this mail because: You are watching all bug changes.