[Bug 375] httpd does not reap zombies

bugzilla at busybox.net bugzilla at busybox.net
Sun Jul 19 10:59:26 UTC 2009


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





--- Comment #14 from Denys Vlasenko <vda.linux at googlemail.com>  2009-07-19 10:59:25 UTC ---
In case they do not want to switch to a more recent version, they need at least
patch this bug in init.c

The bug in 1.8.x was here:

static int waitfor(const struct init_action *a, pid_t pid)
{
        int runpid;
        int status, wpid;

        runpid = (NULL == a) ? pid : run(a);
        while (1) {
                wpid = waitpid(runpid, &status, 0);
                if (wpid == runpid)
                        break;
                if (wpid == -1 && errno == ECHILD) {
                        /* we missed its termination */
                        break;
                }
                /* FIXME other errors should maybe trigger an error, but allow
                 * the program to continue */
        }
        return wpid;
}

The problem is, waitpid(runpid, &status, 0) would not wait for OTHER processes
(with pids != runpid).

The fix is to use waitpid(-1, &status, 0), which waits for any process.


-- 
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