graesslin created this revision. Restricted Application added a project: Plasma. Restricted Application added a subscriber: plasma-devel.
REVISION SUMMARY With the long running kcheckpass there is the possibility that kcheckpass becomes an orphan. Kcheckpass terminates once it gets SIGUSR2 sent from the parent process (that is kscreenlocker_greet). If kscreenlocker_greet crashes it cannot send SIGUSR2 to kcheckpass and thus kcheckpass becomes an orphan. This can easily be seen in the killTest autotest which results in many orphaned kcheckpass processes after execution. This change uses the linux specific PR_SET_PDEATHSIG to send SIGUSR2 to kcheckpass when the parent process dies. Thus kcheckpass can get out of the waiting and terminate without becoming an orphan. In this case it is not a problem to use a linux specific syscall. The long running kcheckpass is only used if kscreenlocker is built with seccomp support which is also linux specific. TEST PLAN Run killTest and check the number of orphaned kcheckpass. Without this change we had 17 orphaned processes, with this change none. REPOSITORY R133 KScreenLocker BRANCH kcheckpass-no-orphan REVISION DETAIL https://phabricator.kde.org/D5547 AFFECTED FILES kcheckpass/kcheckpass.c To: graesslin, #plasma Cc: plasma-devel, spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol