delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/15/12:18:45

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
Date: Thu, 15 Sep 2005 09:18:10 -0700 (PDT)
From: Eduardo Chappa <chappa AT math DOT washington DOT edu>
To: cygwin AT cygwin DOT com
Subject: Re: problem with getppid()
In-Reply-To: <20050915153358.GW5555@calimero.vinschen.de>
Message-ID: <Pine.LNX.4.63.0509150838370.24252@zeno1.math.washington.edu>
References: <Pine DOT LNX DOT 4 DOT 63 DOT 0509150809440 DOT 23407 AT zeno1 DOT math DOT washington DOT edu> <20050915153358 DOT GW5555 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
X-Antivirus: Scanned by Vexira Antivirus 1.1.1
X-IsSubscribed: yes

*** Corinna Vinschen (pcorinna-cygwin AT cygwin DOT cometh) wrote in the cygwin...:

:) > The output is "My parent is bad". I believe this is a bug in Cygwin's 
:) > implementation of getppid().
:) 
:) No, it's not a bug.  GDB starts the inferior process using the standard 
:) Windows mechanisms since it should be useful also for native debugging. 
:) When the inferior process is not started by Cygwin's own fork/exec 
:) process, the child process doesn't know anything about its parent 
:) process, at least not on Windows 9x.  There's a way to retrieve the 
:) native parent PID by using NtQueryInformationProcess on NT, but it 
:) doesn't seem very useful to get this information.

Dear Corinna,

  Thank you for your fast response. Now I understand the issue that is 
involved. I have had this problem runing Pine in Cygwin. I've tried this 
in Windows 2000 Pro and Windows XP Pro. The same issue is not present in 
Linux, where I get the "expected" behavior. The manual of getppid makes me 
believe that the correct behavior for getppid is to return gdb's pid in 
the "bad" behavior, and since it is documented that getppid is supported 
in Cygwin, I would expect it to behave that way.

  The problem I have is that when Pine gets ppid == 1 it exits, and this 
is checked after a timeout for a select() command, which makes it very 
hard to debug pine under gdb. It would be great if I did not have to 
modify the source code of Pine to get around this problem. I can work 
around this at this moment, but I'd rather not have to modify Pine to work 
around this.

  From your response it seems that you are not willing to "fix" this 
problem. If that is the case, simply confirm this, and I will understand, 
otherwise it would be great if this were corrected in a future release and 
I would appreciate this a lot.

  Thank you for your consideration!

-- 
Eduardo
http://www.math.washington.edu/~chappa/pine/

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