X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Mon, 23 Nov 2009 13:20:25 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: [1.7] Updated: cygwin-1.7.0-65 Message-ID: <20091123182025.GB11830@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20091120093210 DOT GQ29173 AT calimero DOT vinschen DOT de> <20091121110204 DOT GB23273 AT calimero DOT vinschen DOT de> <20091121212239 DOT GD29173 AT calimero DOT vinschen DOT de> <20091123091612 DOT GE29173 AT calimero DOT vinschen DOT de> <20091123100122 DOT GI29173 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Mon, Nov 23, 2009 at 10:07:05PM +0800, Huang Bambo wrote: >2009/11/23 Corinna Vinschen : >> On Nov 23 17:43, Huang Bambo wrote: >>> 2009/11/23 Corinna Vinschen : >>> > On Nov 22 09:33, Huang Bambo wrote: >>> >> And there's another quesiton: >>> >> The handle of chile process( created by fork ) seems never been closed >>> >> bye parent process. Is it need to be closed? >>> > >>> > I don't understand the question. ?There's one dangling socket handle left >>> > and I know where and why it happens. ?Other than that, I don't see any >>> > other socket handling which is left open accidentally. >>> > >>> While run my last test code, every time comes one connection, there >>> are 3 handle leak( I monited it by Process Explorer( from >>> www.sysinternals.com)), one is the chile process's handle, one is of >>> "Section ? ? ?\BaseNamedObjects\cygwin1S5-9770bb4ddbd85dca\cygpid.xxxx", >>> the other one is of \Device\Afd. >>> I mean is there any other leak with those handles. >> >> The leak is a result of the parent process not calling wait(2) or >> waitpid(2) to reap the child process. ?If you let the process properly >> call wait/waitpid, you won't see a leak, except for the current socket >> leak this thread is about. > >There's some diffirence between cygwin and other *nix: >In other *nix with this condition, those ended child process could be >list by ps command with tag, will you fix it? Cygwin should produce zombie processes. You don't see zombie processes if the child has exited and the parent goes away though. In that case the process just disappears, just like on linux. You *should* see a zombie when the parent is alive by not waiting for children. The "leak" that Corinna is talking about comes about when the parent has not called wait since the parent keeps handles open to its children until they are reaped. That's how we know whether a process is a zombie or not. cgf -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple