[GH-ISSUE #256] Defunct orphans never reaped #182

Closed
opened 2026-05-05 05:15:46 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @creideiki on GitHub (Jan 23, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/256

I'm trying to run my e-mail klient (KMail) in Firejail 0.9.36. It works, but trying to use GnuPG leaves a lot of defunct processes around, so after a while my (global) process tree looks like this:

13943 creidei+  \_ /bin/bash
14230 root          \_ firejail kmail
14231 creidei+          \_ firejail kmail
14233 creidei+              \_ kmail
14276 creidei+              \_ [gpgconf] <defunct>
14278 creidei+              \_ [gpgconf] <defunct>
14280 creidei+              \_ [gpg2] <defunct>
14282 creidei+              \_ [gpgsm] <defunct>
14284 creidei+              \_ [gpgconf] <defunct>
14287 creidei+              \_ [gpg2] <defunct>
14290 creidei+              \_ [gpg2] <defunct>
14295 creidei+              \_ [gpg2] <defunct>
...

Apparently, KMail expects Init to wait() for those processes. However, PID 1 in the jail is the Firejail child, which does get the SIGCHLD signals, but ignores them since they aren't for the jailed application itself:

# strace -p 16071
Process 16071 attached
wait4(3, 0x7cf193bf34, 0, NULL)         = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=29, si_uid=1000, si_status=0, si_utime=7, si_stime=6} ---
wait4(3, 0x7cf193bf34, 0, NULL)         = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32, si_uid=1000, si_status=0, si_utime=3, si_stime=3} ---
wait4(3, 0x7cf193bf34, 0, NULL)         = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=36, si_uid=1000, si_status=0, si_utime=8, si_stime=5} ---
wait4(3, 0x7cf193bf34, 0, NULL)         = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=39, si_uid=1000, si_status=0, si_utime=0, si_stime=3} ---

I found https://github.com/ScoreUnder/fjinit which doesn't work. I can't see how it is supposed to work, since it can never be PID 1 in the jail. Instead, the Firejail child processs should be reaping those orphans.

Originally created by @creideiki on GitHub (Jan 23, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/256 I'm trying to run my e-mail klient (KMail) in Firejail 0.9.36. It works, but trying to use GnuPG leaves a lot of defunct processes around, so after a while my (global) process tree looks like this: ``` 13943 creidei+ \_ /bin/bash 14230 root \_ firejail kmail 14231 creidei+ \_ firejail kmail 14233 creidei+ \_ kmail 14276 creidei+ \_ [gpgconf] <defunct> 14278 creidei+ \_ [gpgconf] <defunct> 14280 creidei+ \_ [gpg2] <defunct> 14282 creidei+ \_ [gpgsm] <defunct> 14284 creidei+ \_ [gpgconf] <defunct> 14287 creidei+ \_ [gpg2] <defunct> 14290 creidei+ \_ [gpg2] <defunct> 14295 creidei+ \_ [gpg2] <defunct> ... ``` Apparently, KMail expects Init to wait() for those processes. However, PID 1 in the jail is the Firejail child, which does get the SIGCHLD signals, but ignores them since they aren't for the jailed application itself: ``` # strace -p 16071 Process 16071 attached wait4(3, 0x7cf193bf34, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=29, si_uid=1000, si_status=0, si_utime=7, si_stime=6} --- wait4(3, 0x7cf193bf34, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=32, si_uid=1000, si_status=0, si_utime=3, si_stime=3} --- wait4(3, 0x7cf193bf34, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=36, si_uid=1000, si_status=0, si_utime=8, si_stime=5} --- wait4(3, 0x7cf193bf34, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=39, si_uid=1000, si_status=0, si_utime=0, si_stime=3} --- ``` I found https://github.com/ScoreUnder/fjinit which doesn't work. I can't see how it is supposed to work, since it can never be PID 1 in the jail. Instead, the Firejail child processs should be reaping those orphans.
Author
Owner

@netblue30 commented on GitHub (Jan 24, 2016):

It is fixed, thanks for the bug.

<!-- gh-comment-id:174298569 --> @netblue30 commented on GitHub (Jan 24, 2016): It is fixed, thanks for the bug.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#182
No description provided.