Statically initialising pthread attributes in dynamic dlls.

Dave Korn dave.korn.cygwin@googlemail.com
Thu Feb 25 14:30:00 GMT 2010


On 25/02/2010 14:21, Corinna Vinschen wrote:

> Did you test it on Windows Server 2008?  

  I'm afraid I don't have access to any of the server versions.

> I wrote this already in a
> private email to cgf.  The really serious problem which lead to the
> changes in the SEH handling was that in the original code (which worked
> more or less flawlessly for ages) the exception handler chain was
> changed to an endless loop, so that the replacement SEH handler for
> the Cygwin handler became... the Cygwin handler.
> 
> However, this stopped working with Server 2008.  The code in Windows
> 2008 to check for the integrity of the SEH chain detected that and
> restored the chain to the default of calling just the Windows default
> exception handler.

  Yeah, the improved security stuff (referred to in my comment in the patch)
means IMO that we shouldn't try playing tricky games with the SEH chain full
stop, as who knows what future validation checks might be introduced?  This
was one of my two motivations for thinking that we should just introduce a
temporary SEH frame in the dll crt routine; the other is that, thinking about
failure modes, I think it would be less harmful to accidentally run a dlopened
DllMain without EH, than it would be to lose EH altogether on returning to the
main program for the remaining (probably short, without EH!) duration of the run.

> Btw., if you don't have a Server 2008 machine, just install from here:
> http://msdn.microsoft.com/en-us/evalcenter/cc137233.aspx
> 
> Works fine as a VM.  Even my Server 2008 domain controller is running in
> a VM.

  Hey, thanks!  I'll download it and check everything out.  More later.

    cheers,
      DaveK



More information about the Cygwin-patches mailing list