[Bug 375] httpd does not reap zombies

bugzilla at busybox.net bugzilla at busybox.net
Thu Jul 16 15:21:03 UTC 2009


https://bugs.busybox.net/show_bug.cgi?id=375





--- Comment #9 from Denys Vlasenko <vda.linux at googlemail.com>  2009-07-16 15:21:02 UTC ---
(In reply to comment #8)
> (In reply to comment #7)
> > Can you send the RPM to vda.linux at googlemail.com?
> 
> Sent.

I don't see it, but nevermind. I see where the problem is.


> > Can you produce a strace log and show "ps -AH" output fragment which shows
> > zombies being created?
> 
> 2 problems here:
> 1) busybox on my unit does not support strace - I'll need to rebuild
> 2) busybox's ps command does not support AH options
> 
> I have the output from 'ps -w' - this is after refreshing the web browser 4
> times:
> 
>   PID  Uid        VSZ Stat Command
>     1 root       2568 S   init       
...
>   332 root       2568 S   /usr/sbin/httpd -h /home/httpd/html -c
> /etc/httpd.conf 
>   415 root            SWN [jffs2_gcd_mtd1]
>   433 root            Z   [tar]

Hmm... what is *this*?

>   798 root            Z   [xmlUtil]
>   800 root            Z   [xmlUtil]
>   806 root            Z   [xmlUtil]
>   834 root            Z   [xmlUtil]

Yep. Here they are. But there are no corresponding zombies of *httpd slaves*.

There are three processes running when you run a single CGI session: 1. httpd
"master", which spawns new https "slaves" - in your listing, master has PID
332; 2. httpd "slave", which sends files, or spawns CGIs and then pumps data
to/from CGI<->network; and 3. CGI process.

Note that you do not see any of slaves in your ps -w. Because they successfully
detected EOF from CGI and exited. _Before CGI itself managed to exit_!

What happens in this case? CGI (and any other program) gets reparented to init
if its parent dies. When CGI dies, it will become a zombie until _init_ "waits
for it" (runs wait[pid] syscall).

And I think your init is broken. It does not do that. Why I think so? Because I
see another unreaped zombie - [tar]. I don't think it is related to httpd! :)

You need to fix your init.


-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list