[BusyBox] init does not kill reparented processes

Ignacio García Pérez iggarpe at terra.es
Thu Aug 26 17:09:16 UTC 2004


Though remember to have read something like "zombie processes comsume little
more resources than a line in ps output", that is not acceptable in a
critical system that must run for years. Eventually (in my case *very*
quick) system will run out of resources and crash. It's like saying that a
memory leak in an application is Ok.

I'm using kernel 2.4.25, and standard glibc too. I do not think this is a
glibc-uClibc problem, but I'll just try a uClibc busybox and see if the
problem persists.

I've been able to solve the problem by setting up a SIGCHLD handler just
like the standard SysVinit init.c does, but this was a quick hack and I'm
SURE i does interfer with the respawn functionality of busybox init.c. I
don't use it though.

Google for "busybox zombie" and you'll find a patch someone posted that
contains just that solution. I insist: it is a hack (at least if applied to
current busybox init.c) and we should ask someone knowledgeable in busybox
init.c inetrnals to fix this.

Regards.
  -----Original Message-----
  From: Evgueni Tzvetanov [mailto:et at xceedium.com]
  Sent: Thursday, August 26, 2004 5:16 PM
  To: Ignacio García Pérez
  Cc: busybox at mail.codepoet.org
  Subject: Re: [BusyBox] init does not kill reparented processes


  I have the same problem with each daemon I try to kill. I have only a few
processes running on busybox 1.00-pre10, but with the normal glibc. Busybox
was compiled and linked with the same glibc, that is on the box. Is there a
way to avoid leaving the zombies or cleaning them up. It is running kernel
2.6.7 and is a Celeron machine with 256 MB memory.

  I created a small daemon in perl and a shell script to see how many
zombies can be created without a serious problem with the process control
and it turned to be around 7000. After that number the system slowed down
and shortly after that it run out of resources.

  Ignacio García Pérez wrote:
Hi,

I've recently set up a lightly modified version of the standard rshd server
that comes with Red Hat 9, and I've noticed that each remotely executed
process leaves a zombie process in the remote machine:

  209 root            Z   [sh]
  217 root            Z   [sh]
  221 root            Z   [sh]
  226 root            Z   [sh]

I'm using busybox-1.00-pre10, but have checked and the problem also appears
with busybox-1.00-rc3.

As far as I know, this happens because when a process dies, all its sons are
reparented to process 1, which is usually init, and whose task, among
others, is reaping these zombie processes.

So, for some unknown reason, init is not doing its job.

I've tried to modify init/init.c sources and create a SIGCHLD handler
function and just waits for zombie processes and then reaps them, and this
solves the problem, though it is probably not the right solution since it is
intefering with the init_main loop that is supposed to to the zombien
reaping, respawning, etc.

Does anyone know why unmodified init/init.c does not do its reaping job
properly?.

Thanks.

Nacho.

_______________________________________________
busybox mailing list
busybox at mail.busybox.net
http://busybox.net/mailman/listinfo/busybox




  --
  Evgueni Tzvetanov, Senior Software Engineer
  Xceedium, Inc. www.xceedium.com
  80 Maiden Lane, 7th Floor, New York, NY 10038
  Tel: 212-321-2270 x111, Fax: 212-321-2280

  This electronic mail message and any attached files contain information
intended for the exclusive use of the individual or entity to whom it is
addressed and may contain information that is proprietary, privileged,
confidential and/or exempt from disclosure under applicable law. If you are
not the intended recipient, you are hereby notified that any viewing,
copying, disclosure or distribution of this information may be subject to
legal restriction or sanction. Please notify the sender, by electronic mail
or telephone, of any unintended recipients and delete the original message
without making any copies.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.737 / Virus Database: 491 - Release Date: 8/11/2004
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20040826/6d5731d1/attachment.htm 


More information about the busybox mailing list