delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/18/01:33:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <55E0A3E94323974F83CFC5AAB96F68B8014197A6@snnexc03.in.ce.com.au>
From: Sonam Chauhan <sonam DOT chauhan AT ce DOT com DOT au>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: RE: problems in Perl process management
Date: Wed, 18 May 2005 15:31:36 +1000
MIME-Version: 1.0
X-IsSubscribed: yes

Thanks for raising 'ps -W' behavior Chris. It is interesting.

> >From what I gather, the root problem is that for some processes (as
> >demonstrated by my testcase script), the CW_GETPINFO_FULL query returns:
> >1. Invalid PPIDs
> 
> Only PPIDs for cygwin processes are returned.  Everything else should be
> 0.

This isn't happening in my testcase - a Perl script that forks, then
executes `/bin/sleep` with a Perl backtick. Proc::ProcessTable (i.e.
CW_GETPINFO_FULL) returns invalid PPID (0) and PID (the WINPID) for the
child sleep process, but it does returns correct PID and PPID data for the
fork-ed Perl parent processes.

The PID/PPID of the backticked sleep process shows up correctly in 'ps'.

Would this be an issue within CW_GETPINFO_FULL? 


> >2. WINPID instead of Cygwin PID.
> 

> A cygwin pid can actually be spread across two processes.  You see this
> with
> "ps -W" if you do something like:
> 
>   bash -c "exec sleep 20"
> 
> in one window and:
> 
>   ps -W
> 
> in another window.

I tried this but don't see what you mean. Here, in one window, I do:
=======================
$  bash -c "exec sleep 20"
=======================

In the second window, 'ps -W' only reports the PID & PPID for a single sleep
process:
===================================
$ ps  -W | grep sleep
     1012       0       0       1012    ?    0 14:57:51
C:\cygwin\bin\sleep.exe
===================================

However, instead of sleep, if I run a windows program like calc.exe in the
background, ps -W reports two processes: Was this what you meant about the
cygwin pid being spread across two processes?

===================================
$ calc &
[1] 2380

$ ps -W | grep calc
     2380    3780    2380       3604    0  400 15:18:21
/cygdrive/c/WINDOWS/system32/calc
     3604       0       0       3604    ?    0 15:18:22
c:\WINDOWS\system32\calc.exe
===================================

Regards,
Sonam Chauhan
-- 
Electronic Commerce, Corporate Express Australia Ltd.
Phone: +61-2-9335-0725, Email: sonam DOT chauhan AT ce DOT com DOT au
 

> 
> cgf
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019