[Bug 214140] kmail creates zombie processes

OSidorkin at gmail.com OSidorkin at gmail.com
Thu May 31 15:14:00 BST 2012


https://bugs.kde.org/show_bug.cgi?id=214140

OSidorkin at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |OSidorkin at gmail.com

--- Comment #3 from OSidorkin at gmail.com ---
I've done some investigation using ktrace and switching between signed and
unsigned mails that causes new zombies creation. 
Seems that Kmail starts gpg2 in background using double fork invocation, and
the thread forked first becomes zombie.

Here is the trace:
 31180 kmail    CALL  fork
 31180 kmail    RET   fork 31843/0x7c63   <-- 31843 will become zombie
 31843 kmail    RET   fork 0
 31843 kmail    CALL  thr_self(0x82150c400)
 31843 kmail    RET   thr_self 0
 31180 kmail    CALL  sigprocmask(SIG_SETMASK,0x82150c4e8,0)
 31180 kmail    RET   sigprocmask 0
 31180 kmail    CALL  wait4(0x7c63,0x7ffffedf6b6c,0<><invalid>0,0)
 31843 kmail    CALL  getpid
 31843 kmail    RET   getpid 31843/0x7c63  <-- 31843 verifies if it is forked
process
.....
 31843 kmail    CALL  fork                 <-- 31843 forks again
....
 31843 kmail    RET   fork 31844/0x7c64
 31844 kmail    RET   fork 0               <-- 31844 is child of 31843 
....
 31844 kmail    CALL  getpid
 31844 kmail    RET   getpid 31844/0x7c64 
...
then 31844 closes many file descriptors
...
 31843 kmail    CALL  exit(0)           <-- 31843 calls exit and becomes zombie
(determined by ps later)
...
then 31844 closes more file descriptors
...
 31844 kmail    CALL  open(0x80c701043,0x2<O_RDWR>,<unused>0)  <-- 31844
executes gpg2
 31844 kmail    NAMI  "/dev/null"
 31844 kmail    RET   open 0
 31844 kmail    CALL  dup2(0,0x2)
 31844 kmail    RET   dup2 2
 31844 kmail    CALL  execve(0x86b49e3e0,0x86b4613c0,0x81b4e2600)
 31844 kmail    NAMI  "/usr/local/bin/gpg2"
 31844 kmail    NAMI  "/libexec/ld-elf.so.1"
 31844 gpg2     RET   execve 0
...
then gpg2 does its job
...
 31844 gpg2     CALL  exit(0)  <-- gpg2 exits

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Kdepim-bugs mailing list