[PATCH] rsync kills all user processes on fork failure

Bob Byrnes byrnes at curl.com
Wed May 8 20:34:01 EST 2002

The fix for this bug is incomplete: rsync can still do kill(-1, SIGUSR2) ...

On Mar 19, 1:34pm, paulh at hamjudo.com ("Paul Haas") wrote:
-- Subject: Re: [PATCH] rsync kills all user processes on fork failure
> I filed this as bug 4150 http://rsync.samba.org/cgi-bin/rsync/
> We had a few hundred hung processes and reached the limit for "max user
> processes" (see the ulimit command).   rsync did not handle this very
> well.  It passed -1 as a PID to kill().  When kill() gets -1, it kills
> all of the processes owned by that user, or if run by root, all processes.
> I attached a one line fix.  Let me know if I used the wrong format for a
> patch.  If the result of fork is -1 don't put it in the list of pids to
> kill.
> Reviewing the mailing list, I saw that this happened to at least one other
> person, see http://lists.samba.org/pipermail/rsync/2001-April/004158.html
> Back in April of 2001, Randy Kramer wrote: ...
-- End of excerpt from "Paul Haas"

Actually, I submitted a bug report (with a patch) for this back in
September 2000; see bug 2762 ...


Could someone look at the original patch?  It shows that there are TWO
distinct kill(-1, ...) bugs, one that affects SIGUSR1 and another that
affects SIGUSR2.  It looks like only one of these (SIGUSR1) has been
fixed ...  The patch for main.c is still needed.

Also, nothing currently protects against overflow of the all_pids array
by do_fork(), although I doubt that there are enough child processes
to trigger this bug (yet).

Bob Byrnes                        e-mail: byrnes at curl.com
Curl Corporation                  phone:  617-761-1200
400 Technology Square, 8th Floor  fax:    617-761-1201
Cambridge, MA  02139

More information about the rsync mailing list