This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: ps shows same process more than once
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 2 Dec 2013 10:24:55 -0500
- Subject: Re: ps shows same process more than once
- Authentication-results: sourceware.org; auth=none
- References: <CAGaO6c9rxafNajvdzQhngOjTQn+fjjAp9NRLTpYbbgcKHe8R5A at mail dot gmail dot com> <20131128130813 dot GH2449 at calimero dot vinschen dot de> <20131128155504 dot GC5063 at ednor dot casa dot cgf dot cx> <20131128160243 dot GB5803 at ednor dot casa dot cgf dot cx> <CAGaO6c8EBBzQvdEkUFEOb4=npHXsdwgOYaUiL=WHO3iVsufZBg at mail dot gmail dot com>
- Reply-to: cygwin at cygwin dot com
On Mon, Dec 02, 2013 at 01:47:09PM +0800, George M. Florendo wrote:
>On 11/29/13, Christopher Faylor wrote:
>> On Thu, Nov 28, 2013 at 10:55:04AM -0500, Christopher Faylor wrote:
>>>On Thu, Nov 28, 2013 at 02:08:13PM +0100, Corinna Vinschen wrote:
>>>>On Nov 28 15:20, George M. Florendo wrote:
>>>>> Hi,
>>>>>
>>>>> I run a non cygwin apache process named httpd.exe. Checking it with
>>>>> "ps -W" shows a listing of the same process (with PID 4560 in this
>>>>> case) twice.
>>>>>
>>>>> $ ps -W | grep httpd
>>>>> 4560 1604 4560 5304 pty0 1000 09:55:21
>>>>> /home/georgeflorendo/wamp/bin/apache/Apache2.4.4/bin/httpd
>>>>> 4560 1604 4560 5304 pty0 1000 09:55:21
>>>>> /home/georgeflorendo/wamp/bin/apache/Apache2.4.4/bin/httpd
>>>>> 7508 0 0 7508 ? 0 15:09:50
>>>>> C:\cygwin\home\georgeflorendo\wamp\bin\apache\Apache2.4.4\bin\httpd.exe
>>>>>
>>>>> Doing a "ps aux" shows it only once.
>>>>>
>>>>> $ ps aux
>>>>> PID PPID PGID WINPID TTY UID STIME COMMAND
>>>>> 1340 7856 1340 5720 pty5 1000 15:13:50 /usr/bin/ps
>>>>> 1604 4008 1604 2292 pty0 1000 09:17:01
>>>>> /usr/bin/bash
>>>>> 4008 1 4008 4008 ? 1000 09:17:00
>>>>> /usr/bin/mintty
>>>>> 4560 1604 4560 5304 pty0 1000 09:55:21
>>>>> /home/georgeflorendo/wamp/bin/apache/Apache2.4.4/bin/httpd
>>>>>
>>>>> <snipped>
>>>>>
>>>>> Is it correct that ps -W shows the same process twice?
>>>>
>>>>Not exactly but it could happen. Can you try the latest snapshot Cygwin
>>>>DLL from http://cygwin.com/snapshots/ and see if it fixes the problem?
>>>
>>>I don't see anything in the ChangeLog which would affect this and I'd
>>>be concerned if there was.
>>>
>>>There are scenarios where two different windows pids can be associated
>>>with the same Cygwin pid. You should only see it when you do a "ps -W".
>>>
>>>So, AFAICT, the correct answer to the "Is it correct" is "Yes'.
>>
>> Oops. Sorry. Just noticed that the pids weren't "different". There
>> are still pathological situations where a pid can show up twice when
>> doing a "ps -W". I've seen the issue before but fixing it would involve
>> a global process lock which would slow down Cygwin for the benefit of
>> a more accurate "ps -W".
>
>Oh, I'm sorry too. Didn't get to read your first sentence earlier.
>I'd rather have a faster cygwin more than a more accurate "ps -W".
>
>Thanks for all your help.
Thanks for understanding. I will try to revisit this code sometime in
the near future to see if I can do something about this case. I had a
glimmer of an idea about how to fix this in the thinking room recently.
cgf
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple