SIGCHLD SIG_IGN, then wait - warning messages

Hardy Merrill hmerrill at redhat.com
Wed Jul 23 02:33:14 EST 2003


Rsync maintainers please review rsync bug
                                                                                
  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=98740
                                                                                
The code in question is in socket.c in start_accept_loop.
The user is getting these warning messages:
                                                                                
-----------------------------
Jul  8 12:56:59 ftp kernel: application bug: rsync(1051) has SIGCHLD set to
SIG_IGN but calls wait().
Jul  8 12:56:59 ftp kernel: (see the NOTES section of 'man 2 wait'). Workaround
activated.
-----------------------------
                                                                                
I was able to reproduce that error with rsync server and
client on Red Hat OS's on a fairly consistent basis by
running an rsync server (rsync version 2.5.6 protocol
version 27 from cvs 7/14) from the command line
(rsync --daemon), and connecting with an rsync-2.4.6
client with this command:
    rsync -avv my.server.com::test/one /tmp/rsync_test

I also produced the same error by using the same command
from an rsync-2.5.6 protocol version 26 client.

Here is my /etc/rsyncd.conf file:
-----------------------------
log file = /var/log/rsync
[test]
        uid = rsync1
        gid = rsync1
        path = /rsync_test
        comment = Rsync Test - Comment
-----------------------------
                                                                                
Quoting one of the bug messages,
   "These messages are a warning that rsync is not
    standards compliant with respect to its handling
    of child processes. According to POSIX (3.3.1.3)
    it is unspecified what happens when SIGCHLD is set
    to SIG_IGN."
                                                                                
This code in socket.c:
-----------------------------
        signal(SIGCHLD, SIG_IGN);
                                                                                
        /* we shouldn't have any children left hanging around
           but I have had reports that on Digital Unix zombies
           are produced, so this ensures that they are reaped */
    #ifdef WNOHANG
        while (waitpid(-1, NULL, WNOHANG) > 0);
    #endif
-----------------------------

sets SIGCHLD to SIG_IGN, and *then* waits if WNOHANG is
defined.  It would appear that if there are still children
left to be cleaned up in Digital Unix after setting SIGCHLD
to SIG_IGN, that there might be a bug in Digital Unix that
rsync is coding a fix for.
                                                                                
One coding change could be to change the #ifdef WNOHANG to
a #ifdef <Digital Unix string>, so that only Digital Unix
OS's would include and execute the waitpid.  This would
stop warning messages from being produced.
                                                                                
Thanks.
                                                                                
--
Hardy Merrill
Red Hat, Inc.



More information about the rsync mailing list