delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/02/23/16:22:25

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 <dave DOT korn DOT cygwin AT googlemail DOT com>
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>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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 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

- Raw text -


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