This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Statically initialising pthread attributes in dynamic dlls.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]