Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: <55E0A3E94323974F83CFC5AAB96F68B80149C9AA@snnexc03.in.ce.com.au> From: Sonam Chauhan To: "'cygwin AT cygwin DOT com'" Subject: RE: problems in Perl process management Date: Tue, 24 May 2005 17:11:00 +1000 MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes 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=, 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 DOT chauhan AT ce DOT com DOT 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 AT cygwin DOT 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 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/ -- 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/