X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <4B844B2D.2030307@gmail.com> Date: Tue, 23 Feb 2010 21:39:57 +0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Statically initialising pthread attributes in dynamic dlls. 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> In-Reply-To: <4B841026.1000905@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 23/02/2010 17:28, Andrew West wrote: > > Further to this ( possibly instead of this ). When the code reaches this > point inside the call to pthread_mutexattr_init; > > if ((*object)->magic != magic) > > Shouldn't the SEH contain the cytls exception handler as the first item > in the list? I seem to have 4 things before it; I think the OS has wrapped the call to DllMain in its own handler that gets in ahead of cygwin's. When the pthread_mutex stuff throws during validating the verifyable object, the OS catches it, says "oops! there's been an exception during DllMain, this DLL is faulty" and unmaps it. Then LoadLibraryW returns an error status to dlopen, but the problem is that there's an unpopped return address on the tls sigfe stack, and when dlopen tries to return it jumps into that (now unmapped) space. cheers, DaveK -- 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