From: "Olivier Andrieu" <oandrieu@nerim.net>
To: "Christopher Conway" <conway@cs.columbia.edu>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Unix.system returns "no child processes"
Date: Fri, 9 Dec 2005 21:26:33 +0100 (CET) [thread overview]
Message-ID: <33149.::ffff:81.185.35.11.1134159993.squirrel@webmail.nerim.net> (raw)
In-Reply-To: <4399DC7E.6000509@cs.columbia.edu>
> Christopher Conway wrote:
> I am using Unix.system to invoke external commands from within Ocaml. On
> the old machines (with the 32-bit version of Ocaml), I would
> occasionally get the exception Unix_error(ECHILD,"waitpid","") from
> Unix.system. With the new machines, I'm seeing this at every call to
> Unix.system, every time. I have investigate the behavior of the
> sub-processes, and they are terminating normally, with no indication of
> any error.
the linux manpage for waitpid has this:
ERRORS
ECHILD if the process specified in pid does not exist or is not a
child of the calling process. (This can
happen for ones own child if the action for SIGCHLD is
set to SIG_IGN. See also the LINUX NOTES
section about threads.)
This begs the question: did you setup the SIGCHLD handler to SIG_IGN ? or
are you using threads ?
>
> I have a theory why this is happening, but no supporting evidence. It
> goes like this: system is basically fork+execv+waitpid; on the new
> machines, fork+execv is terminating so quickly that the process is gone
> before the call to waitpid.
No, the process should stay as a zombie (unless you've set a signal
handler for SIGCHLD I guess)
--
Olivier
next prev parent reply other threads:[~2005-12-09 20:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-09 19:35 Christopher Conway
2005-12-09 20:26 ` Olivier Andrieu [this message]
2005-12-10 0:15 [Caml-list] " Harrison, John R
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='33149.::ffff:81.185.35.11.1134159993.squirrel@webmail.nerim.net' \
--to=oandrieu@nerim.net \
--cc=caml-list@yquem.inria.fr \
--cc=conway@cs.columbia.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).