Bug 450830 - drkonqi remains running after wayland session end, crashed applications eating CPU
Summary: drkonqi remains running after wayland session end, crashed applications eatin...
Status: RESOLVED WORKSFORME
Alias: None
Product: drkonqi
Classification: Applications
Component: general (show other bugs)
Version: 5.23.5
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-25 13:50 UTC by pelzi
Modified: 2022-02-28 13:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pelzi 2022-02-25 13:50:20 UTC
SUMMARY

When ending a session, several background applications tend to crash for whatever reason, raising several instances of drkonqi. However, drkonqi doesn't seem to make any sense in this context, as the session is already closed, nothing can be shown to the user. drkonqi fails to handle this situation adequately and keeps running. All crashed applications remain infinitely busily looping (in wait4 calls on their respective drkonqi instance with WNOHANG flag set), eating a lot of CPU.

STEPS TO REPRODUCE
1. Use some of the less robust KDE components (kakonadi, korganizer, kmail often does the trick)
2. Log out from the desktop and wait for the display manager's login page
3. Check out in a text console if remainders of your session are still running, and analyse what they do

OBSERVED RESULT
All crashed applications remain infinitely busily looping (in wait4 calls on their respective drkonqi instance with WNOHANG flag set), eating a lot of CPU.

EXPECTED RESULT
Even in case of buggy applications, drkonqi correctly determines that the user session is already closed, does not attempt to show dialogues within those no longer existing sessions, but terminates cleanly instead.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Harald Sitter 2022-02-28 13:36:53 UTC
That makes no sense. There's literally code that checks if the session is closed https://invent.kde.org/plasma/drkonqi/-/blob/master/src/main.cpp#L78 so I am left inferring that the session wasn't closed when the crash occurred.

In any event https://www.freedesktop.org/software/systemd/man/logind.conf.html#KillUserProcesses= is your friend.