delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/04/23/18:09:37

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <49F0E6B3.7030607@cygwin.com>
Date: Thu, 23 Apr 2009 18:07:47 -0400
From: "Larry Hall (Cygwin)" <reply-to-list-only-lh AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20090101 Remi/2.0.0.19-1.fc8.remi Lightning/0.9 Thunderbird/2.0.0.19 Mnenhy/0.7.5.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: pstree on windows xp - find process spawned from windows process
References: <23197461 DOT post AT talk DOT nabble DOT com> <49F0B2B9 DOT 7000804 AT cygwin DOT com> <23205009 DOT post AT talk DOT nabble DOT com>
In-Reply-To: <23205009.post@talk.nabble.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

nachum wrote:
>>> Hi, I'm new to cygwin, and I am beginning to like it. I am having trouble
>>> though with child processes that have only Windows PIDs and not cygwin
>>> PIDs.
>>>
>>> When I run Xilinx bitgen from cygwin 2 processes are run both with the
>>> name
>>> bitgen.exe. Below I am running bitgen through make.
>>>
>>>       PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
>>> S    3936    2836    3936       2380    0 12696 19:54:49 /usr/bin/make
>>> S     808    3936    3936       2852    0 12696 19:54:49
>>> /cygdrive/c/Xilinx/10.1/ISE/bin/nt/bitgen
>>>      2852       0       0       2852    ?    0 19:54:49
>>> c:\Xilinx\10.1\ISE\bin\nt\bitgen.exe
>>>       504       0       0        504    ?    0 19:54:49
>>> c:\Xilinx\10.1\ISE\bin\nt\unwrapped\bitgen.exe
>>>
>>> When I ctrl-c to kill bitgen after calling make I end up killing only
>>> process 808 which is also process 2852 as 808 is the child of 3936
>>> (make).
>>> 504 doesn't get killed, and within process explorer I see it running and
>>> it
>>> reports it's parent as 2852 even though 2852 is gone. I thought I could
>>> kill
>>> the process by finding it within the make file after the bitgen call and
>>> manually killing it, but I haven't found a way to find the process. I
>>> prefer
>>> not to use a name based kill of bitgen b/c that will kill all bitgens
>>> that
>>> might be going on at the same time.
>>>
>>> I am running in an xterm on XP 32 bit SP3. Here are some relevant
>>> versions:
>>> bash 3.2.48(21)
>>> ps 1.11
>>> pstree 21.5
>>> kill 1.14
>> I don't know anything about Xilinx/bitgen so I don't know why you end up
>> with the wrapped and unwrapped versions running.  That would be a question
>> for the Xilinx folks.  But if you just need to kill a process, you can
>> use '/bin/kill -f 504' in your example above.  That should kill the
>> Windows process for you.
> 
> I know that I can kill it with the -f switch, but I want to know how to
> figure out which process to kill. For example if I have 2 separate
> compilations going then I will have 4 bitgen processes running at once since
> the Xilinx bitgen tools spawn an "unwrapped" version of bitgen to do the
> actual processing. This means I need a programmatic way of saying this is
> the PID that belongs to this instance of make->bitgen. pstree doesn't seem
> to allow identifying Windows sub processes, if I could do that then I could
> use pstree to figure out which bitgen is spawned from make, and subsequently
> which unwrapped bitgen should be killed.

Since I'm not sure what Xilinx is doing, I can't really say.  Someone else
here *might* be able to tell you, if they have run into the same thing
either with Xilinx or some other native Windows app.  But since this
probably has more to do with Xilinx's particular implementation and less
to do with Cygwin proper, this would be off-topic for this list.  That's
one of the reasons why I was suggesting talking to the Xilinx folks.  That
and the fact that they should know exactly what they're doing, why, and
how you might track it.

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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