X-Spam-Check-By: sourceware.org
Date: Thu, 23 Feb 2006 13:19:54 -0500
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Hanging at GetModuleFileName in inside_kernel function
Message-ID: <20060223181954.GG31464@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
References: <4BFEBADC-51DD-40CD-9595-9337ABCBDD8E@rehley.net> <000301c638a4$dfc6fd70$a501a8c0@CAM.ARTIMI.COM>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <000301c638a4$dfc6fd70$a501a8c0@CAM.ARTIMI.COM>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Thu, Feb 23, 2006 at 06:13:40PM -0000, Dave Korn wrote:
>On 23 February 2006 16:20, Peter Rehley wrote:
>
>> Yeah, I saw that change, and I tried yesterdays snapshot but it still
>> hung.  I also did some more googling and found that someone submitted
>> a patch a few years ago.  The patch checked to see if it was inside
>> the ntdll.dll by looking at the handle.
>> http://www.cygwin.com/ml/cygwin-patches/2003-q2/msg00004.html
>> 
>> I found this google too.
>> http://blogs.msdn.com/oldnewthing/archive/2004/01/28/63880.aspx
>> 
>> I'm going to try that patch today and see what happens.  Christopher
>> didn't apply it because it was a bandage and didn't really fix the
>> bigger problem.
>
>That all fits right in with your diagnosis of the problem; a deadlock
>of some kind I guess is the only thing that could make
>GetModuleFileName hang.
>
>Have you got a stack backtrace showing the call chain when this problem
>arises?

You'd need to decode the stack backtrace on multiple threads, if this is
really that kind of deadlock.

Btw, FWIW, I am excruciatingly aware of this type of deadlock.  I
suffered from it greatly when I moved more of the fork code into the
"DLLentry" part of cygwin to deal with problems caused by Corinna's
streamliing of mmap.

>We may be able to come up with a substitute for GMFN that would solve
>the problem.

Funny you should mention that.  I was just thinking that I could use
either use the technique that gdb uses to find shared library names or
possibly use the stuff in hookapi.cc.  Of course, *that* would be
subject to races.  So you'd potentially be trading races for deadlocks.

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/

