Subject: Re: 1.3.3-2: ps.exe bug for processes with a zero ppid
From: Christopher Faylor <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Wed, 3 Oct 2001 11:11:16 -0400

On Wed, Oct 03, 2001 at 05:53:58AM -0700, Robert Legros wrote:
>There is a follow up to the bug "1.3.3-2: Process creation is possible
>with ppid = 0 and pgid = 0"
><http://cygwin.com/ml/cygwin/2001-10/msg00109.html>.
>
>'ps.exe' does not behave correctly with such processes.  This is due to
>the fact that in the code, there is a criteria to see if a process is a
>Cygwin one or a Windows one.  And that criteria is precisely (p-ppid !=
>0) !.
>
>I have written a patch for 'ps.exe'.  It is more a hack than a real bug
>correction, but it works.  In fact the real bug correction must be done
>somewhere in the process creation routines inside 'cygwin1.dll'.  This
>patch is to be found in attachment.

You've hit the nail on the head.  This is a hack.  If the linux kernel
started setting pgids to 0, you would fix the linux kernel.  You wouldn't
fix 'ps'.

If ps is assuming that a pgid == 0 is not a cygwin process then obviously
something is screwed up somewhere.  So, the fix is in cygwin1.dll not
ps.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/