This is the mail archive of the cygwin 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: problems in Perl process management


Hi - Asking again since I didn't get a response... 

> > > 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.

Both Proc::ProcessTable and 'ps -W' use CW_GETPINFO_FULL. My Perl testcase
<*> forks and runs '/bin/sleep' with the Perl backtick operator.
Proc::ProcessTable and 'ps -W' then report the following about the testcase
processes:

1. PID and PPID of the fork-ed Perl processes -- reported normally.
2. PID and PPID of the 'sleep' process -- reported as if it was a non-Cygwin
process. i.e. PID=<WINPID>, PPID=0.

But the 'sleep' process is a "Cygwin process", right? 

Does this indicate a bug in CW_GETPINFO_FULL?

Regards,
Sonam Chauhan
-- 
Electronic Commerce, Corporate Express Australia Ltd.
Phone: +61-2-9335-0725, Email: sonam.chauhan@ce.com.au
 
<*> Testcase attached to bug report filed here:
http://rt.cpan.org/NoAuth/Bug.html?id=12840


> -----Original Message-----
> From: Sonam Chauhan
> Sent: Wednesday, 18 May 2005 3:32 PM
> To: 'cygwin@cygwin.com'
> Subject: RE: problems in Perl process management
> 
> 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.chauhan@ce.com.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/

--
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/


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