X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Wed, 24 Feb 2010 02:23:35 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Statically initialising pthread attributes in dynamic dlls.
Message-ID: <20100224072335.GA4085@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4B825D76.6000105@gmail.com>  <4B82C093.7010001@gmail.com>  <4B83A727.3030101@gmail.com>  <4B841026.1000905@gmail.com>  <20100224004403.GA24591@ednor.casa.cgf.cx>  <4B848353.2010209@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4B848353.2010209@gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
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 Wed, Feb 24, 2010 at 01:39:31AM +0000, Dave Korn wrote:
>On 24/02/2010 00:44, Christopher Faylor wrote:
>
>> I never saw the cygwin exception handler on the list twice when I was
>> debugging this.  That isn't supposed to happen and I don't see how it
>> could happen unless Windows is doing it since the code in
>> _cygtls::init_exception_handler is supposed to prevent that and, if it
>> was on the list twice bad stuff happened.
>> 
>> That actually looks like a typo above since you seem to have typed the
>> same address twice.
>> 
>> Anyway, I've revisited this code, just like I knew I would, and have
>> added YA in a long series of tweaks which seems to fix your particular
>> problem.  The fix is in the latest snapshot.
>
>  :( I think I can see where the next problem is going to arise already.
>
>  If we move el to the front of the list each time, what's going to happen
>when we eventually return from LoadLibrary, and el.prev is still pointing at
>the now-deallocated stack frames where LoadLibrary created its temporary
>EXCEPTION_REGISTRATION structures ?

Unless you can show that LoadLibrary isn't smart enough to clean up
after itself in this scenario, I think it's a non-issue.

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

