From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d66c9f9cb6b86f72 X-Google-Attributes: gid103376,public From: "Bobby D. Bryant" Subject: Re: fork; execve --> defunct process. Date: 2000/01/18 Message-ID: <3885024F.E13C3561@mail.utexas.edu>#1/1 X-Deja-AN: 574471205 Content-Transfer-Encoding: 7bit References: <388414AD.E4D4C00D@mail.utexas.edu> <38843392.FBEA70CB@mail.com> X-Accept-Language: en,fr,de Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@cc.utexas.edu X-Trace: geraldo.cc.utexas.edu 948240901 23732 128.83.176.71 (19 Jan 2000 00:15:01 GMT) Organization: The University of Texas at Austin Mime-Version: 1.0 NNTP-Posting-Date: 19 Jan 2000 00:15:01 GMT Newsgroups: comp.lang.ada Date: 2000-01-19T00:15:01+00:00 List-Id: Mats Weber wrote: > execve never returns if it succeeds. That's fine. > What are you doing between fork and > execve in the child ? Nothing except check for PID = 0, plus whatever overhead is involved in a function call, since I've got everything under wrappers. > > However, the child process immediately(?) goes into "defunct" status. > > For example, if I try to run the testgtk program, the program's GUI > > never pops up, and a ps x shows: > > defunct means that the process is finished, but its parent does not know > yet. To avoid defunct processes, you must do a waitpid for the child in > the parent. Fine, but that's not my problem; I'll clean up the completed child processes iff I ever get them to run correctly. My problem is: why are the children going defunct immediately, rather than running the requested programs? I am getting core files for them, but they should not be bombing off, since they include programs that run well on their own (Electric Eyes, testgtk, etc.). The child process is created, execve returns a non-negative status, and the child process picks up the name of the requested program, but it apparently cores out before it actually does anything. Has anyone here used execve from Ada? Is there a special trick required to get it to work? Does the child process get into a confused state when execve tries to have it jump out of the middle of a running Ada program? I.e., are there leftover structures from Ada's run-time checking and/or task management system that are not cleanly erased when execve is called? (I'm not explicitly using tasks, but I assume the run-time infrastructure is there anyway.) Thanks, Bobby Bryant Austin, Texas