From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 5C069BB9C for ; Fri, 9 Dec 2005 21:26:41 +0100 (CET) Received: from mallaury.nerim.net (smtp-105-friday.noc.nerim.net [62.4.17.105]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jB9KQfpX009771 for ; Fri, 9 Dec 2005 21:26:41 +0100 Received: from webmail.nerim.net (archimonde.nerim.net [62.4.16.97]) by mallaury.nerim.net (Postfix) with ESMTP id BFD054F3A0; Fri, 9 Dec 2005 21:26:28 +0100 (CET) Received: from ::ffff:81.185.35.11 (SquirrelMail authenticated user oandrieu) by webmail.nerim.net with HTTP; Fri, 9 Dec 2005 21:26:33 +0100 (CET) Message-ID: <33149.::ffff:81.185.35.11.1134159993.squirrel@webmail.nerim.net> In-Reply-To: <4399DC7E.6000509@cs.columbia.edu> References: <4399DC7E.6000509@cs.columbia.edu> Date: Fri, 9 Dec 2005 21:26:33 +0100 (CET) Subject: Re: [Caml-list] Unix.system returns "no child processes" From: "Olivier Andrieu" To: "Christopher Conway" Cc: caml-list@yquem.inria.fr User-Agent: SquirrelMail/1.4.4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Miltered: at nez-perce with ID 4399E881.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 andrieu:01 oandrieu:01 nerim:01 ocaml:01 ocaml:01 waitpid:01 terminating:01 manpage:01 waitpid:01 sigchld:01 sig:01 threads:01 sigchld:01 handler:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 > 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 one’s 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