All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Cc: Linus Torvalds <torvalds@osdl.org>
Subject: [Q] what to do when waitpid() returns ECHILD under signal(SIGCHLD, SIG_IGN)?
Date: Mon, 19 Jun 2006 16:49:09 -0700	[thread overview]
Message-ID: <7vwtbc7ll6.fsf@assigned-by-dhcp.cox.net> (raw)

Somebody I met last week in Japan reported that the socks client
he uses to cross the firewall to connect to git:// port from his
company environment seems to do signal(SIGCHLD, SIG_IGN) before
spawning git.  When "git clone" is invoked this way, we get a
mysterious failure.

I can reproduce the problem without using funny socks client
like this:

        : gitster; trap '' SIGCHLD
        : gitster; git clone git://git.kernel.org/pub/scm/git/git.git/ foo.git
        error: waitpid failed (No child processes)
        fetch-pack from 'git://git.kernel.org/pub/scm/git/git.git/' failed.
        : gitster; ls foo.git
        ls: foo.git: No such file or directory

We could work this around by having signal(SIGCHLD, SIG_DFL)
upfront in git.c::main(), but I am wondering what the standard
practice for programs that use waitpid() call.  Do they protect
themselves from this in order to reliably obtain child exit
status?  Or do they simply consider it is a user error to run a
program that use waitpid() with SIGCHLD ignored?

http://www.opengroup.org/onlinepubs/009695399/functions/waitpid.html

explicitly says this is an expected behaviour, so barfing upon
ECHILD sounds like a bug on our part.

             reply	other threads:[~2006-06-19 23:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-19 23:49 Junio C Hamano [this message]
2006-06-19 23:57 ` [Q] what to do when waitpid() returns ECHILD under signal(SIGCHLD, SIG_IGN)? Linus Torvalds
2006-06-20  0:36   ` Junio C Hamano
2006-06-20  0:44     ` Linus Torvalds
2006-06-20  3:11       ` [PATCH] Restore SIGCHLD to SIG_DFL where we care about waitpid() Junio C Hamano
2006-06-20 12:59         ` Petr Baudis
2006-06-20 16:09 ` [Q] what to do when waitpid() returns ECHILD under signal(SIGCHLD, SIG_IGN)? Edgar Toernig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vwtbc7ll6.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.