This is the mail archive of the cygwin-patches 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]

Patch for silent crash with Cygwin1.dll v 1.5.19-4

Since installing Cygwin1.dll v 1.5.19-4, I have a
problem with the computer algebra system SAGE dying
at startup with no error messages (i.e. I get returned
to the bash prompt with no messages of any sort).
The problem occurs when a dll that is created with c++
is dlopen()'d. Microsoft's LoadLibrary() function
installs its own exception handler (at fs:0) which
does not pass control back to Cygwin's exception
handler; thus, when the dll is loaded, 
   pthread::once() gets called, which calls
(indirectly) into
   pthread_key_create() which call into 
   verifyable_object_isvalid() in winsup/ 
This last function raises an exception which
LoadLibrary() assumes to be fatal, thereby
short-circuiting the exception mechanism built into

The code below corrects this problem. 

2006-04-11 Gary Zablackis
 * (Thanks to Bernhard Loos for pointing the way)
 * (dll_dllcrt0()): install Cygwin
exception handler so that Cygwin can handle checking
for invalid pointers in dlopen()'ed dlls.

RCS file: /cvs/src/src/winsup/cygwin/,v
retrieving revision 1.49
diff -u -p -r1.49
--- 14 Mar 2006 19:07:36 -0000      1.49
+++ 12 Apr 2006 13:41:24 -0000
@@ -351,6 +351,8 @@ dll_list::load_after_fork (HANDLE
 extern "C" int
 dll_dllcrt0 (HMODULE h, per_process *p)
+  _my_tls.init_exception_handler
   if (p == NULL)
     p = &__cygwin_user_data;

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

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