delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/02/24/16:51:51

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 24 Feb 2010 16:44:59 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Statically initialising pthread attributes in dynamic dlls.
Message-ID: <20100224214459.GA19766@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4B825D76 DOT 6000105 AT gmail DOT com> <4B82C093 DOT 7010001 AT gmail DOT com> <4B83A727 DOT 3030101 AT gmail DOT com> <4B841026 DOT 1000905 AT gmail DOT com> <20100224004403 DOT GA24591 AT ednor DOT casa DOT cgf DOT cx> <4B848353 DOT 2010209 AT gmail DOT com> <4B84B08C DOT 7060302 AT gmail DOT com> <4B84B887 DOT 6070801 AT gmail DOT com> <4B856401 DOT 2000905 AT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <4B856401.2000905@gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Wed, Feb 24, 2010 at 05:38:09PM +0000, Andrew West wrote:
>On 24/02/2010 05:26, Dave Korn wrote:
>>    Yeh, that works nicely.  Here's what I tested, along with a couple of extra
>> test cases I used to check whether exception handling was still working before
>> and after the dlopen call.  With the current state of HEAD, the first one
>> works (by which I mean "prints 'sig 11' forever" and the second one fails (by
>> which I means reaches some sort of exit without hitting the signal handler at
>> all).  With the attached diff, they both work (as does the original unmodified
>> testcase).
>>
>>    This is just a brain dump because I'm off to bed now, hence no change log,
>> and there's still commented-out stuff and inadequate commenting, but I figured
>>   I may as well let everyone know what I found out.  'night all!
>>
>>    
>
>I've tried out the latest snapshots with the code that I originally 
>found this bug with and it fixed the problem of
>being able to successfully call dlopen, but I seemed to run into what I 
>think was a similar problem when
>I called dlclose.
>
>Unfortunately I can't seem to create a simple test case demonstrating 
>this. If LoadLibrary could possibly remove
>the cygwin exception_handler isn't it possible that FreeLibrary could as 
>well?
>
>I adding the line;
>
>  _my_tls.init_exception_handler (_cygtls::handle_exceptions);
>
>To 'cygwin_detach_dll' before the 'dlls.detach' call and this seemed to 
>fix the problem, but I'm not entirely sure of
>what the reprocusions of this might be.

Hmm.  That would presumably cause the behavior that Dave Korn noted of
removing the handler after FreeLibrary returns.  So you'd have to put it
there and in dlclose.  I'll upload a new snapshot with that fix soon.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019