This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More spawn & Windows processes


At 07:41 PM 12/26/2004 -0500, you wrote:
>On Sun, Dec 26, 2004 at 07:31:36PM -0500, Christopher Faylor wrote:
>>Why not just generically detect when exitcode hasn't been set and use
>>the value returned from GetExitCodeProcess in proc_waiter?  That is the
>>way I was originally going to handle the problem with getting the exit
>>code from processes that had been killed via the task manager.  I'll
>>just implement that.  It eliminates the extra code in init.cc and just
>>moves the detection from child_info::sync.
>
>Actually, no, it doesn't fix this case because a grandchild exec'ed
>process that has been killed via task manager or with a grandchild
>exec'ed process which has used ExitProcess.
>
>Back to the drawing board...

Looks good, but I noticed one strange thing on WinME.
Launching "strace sh -c cygcheck" from a cygwin shell results
in strace not terminating, because the initial sh doesn't.
After killing the sh, strace remains <defunct>

~: ps
  <snip>
  1082615  990515 1082615 4293856601  con  740 10:33:18 /usr/bin/strace
  1086927       1 1086927 4293880369  con  740 10:33:18 /c/PROGRAM
FILES/CYGWIN/BIN/SH
  1100003 99219811 1100003 4293868193    2  740 10:33:27 /usr/bin/ps
~: kill -9  1086927
~: ps
  1082615  990515 1082615 4293856601  con  740 10:33:18 <defunct>
 
Minor issues:
- ppid of spawn(P_DETACH) process should be set to 1
-   sigproc_printf ("Calling ExitProcess %d", n);
  "n" should be "exitcode"
-           /* We could just let this happen automatically when the process
             exits but this should gain us a microsecond or so by notifying
             the parent early.  */
          myself->alert_parent (0);
  should now be able to save microseconds by simply closing the pipe.


Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]