caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Harrison, John R" <johnh@ichips.intel.com>
To: "Christopher Conway" <conway@cs.columbia.edu>
Cc: <caml-list@yquem.inria.fr>, "Harrison, John R" <johnh@ichips.intel.com>
Subject: RE: [Caml-list] Unix.system returns "no child processes"
Date: Fri, 9 Dec 2005 16:15:41 -0800	[thread overview]
Message-ID: <196F1D996F92CD46A542EA519DB8CE4702AD0289@orsmsx409> (raw)

Hi Chris,

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

I also sometimes see the intermittent error:

   Exception: Unix.Unix_error (Unix.ECHILD, "waitpid", "").

But what I'm doing with the system call is sufficiently sleazy that I
probably deserve it. I'm running OCaml under the checkpointing program
"ckpt". The following function is supposed to make the session
checkpoint itself, then print a startup banner when execution is
resumed:

  let self_destruct bannerstring =
    let complete_banner =
      if bannerstring = "" then startup_banner
      else startup_banner^"\n        "^bannerstring in
    Gc.compact();
    let pid = string_of_int(Unix.getpid()) in
     (ignore(Unix.system("kill -USR1 "^pid));
      Format.print_string complete_banner;
      Format.print_newline(); Format.print_newline());;

Sometimes I get the exception above instead of the banner when the
process restarts. The likelihood of that happening seems highly
machine-dependent, and even on a given machine there's no obvious
pattern.

John.


             reply	other threads:[~2005-12-10  0:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-10  0:15 Harrison, John R [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-12-09 19:35 Christopher Conway
2005-12-09 20:26 ` [Caml-list] " Olivier Andrieu

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=196F1D996F92CD46A542EA519DB8CE4702AD0289@orsmsx409 \
    --to=johnh@ichips.intel.com \
    --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).