X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SARE_SUB_ENC_UTF8,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: perl threads on 2008 R2 64bit = crash ( was: perl 5.10 threads =?utf-8?b?CW9u?= 1.5.25 = instant crash ) Date: Fri, 17 Jul 2009 14:15:04 +0000 (UTC) Lines: 47 Message-ID: References: <20090715185636 DOT GA16211 AT ednor DOT casa DOT cgf DOT cx> <4A5E2ED6 DOT 3070502 AT gmail DOT com> <20090715194539 DOT GZ27613 AT calimero DOT vinschen DOT de> <4A5E3F1F DOT 9040103 AT gmail DOT com> <20090716161219 DOT GP27613 AT calimero DOT vinschen DOT de> <4A5F59A1 DOT 1060902 AT gmail DOT com> <20090716195552 DOT GU27613 AT calimero DOT vinschen DOT de> <20090716211823 DOT GC22617 AT ednor DOT casa DOT cgf DOT cx> <20090717085727 DOT GW27613 AT calimero DOT vinschen DOT de> <4A607EE5 DOT 5050306 AT gmail DOT com> <20090717134114 DOT GX27613 AT calimero DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes 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 Corinna Vinschen cygwin.com> writes: > Do we have to take other handlers than the OS handlers and the Cygwin > handlers into account? Cygwin apps don't install SEH handlers, do > they? Or do C++ apps? I believe that libsigsegv does its magic by installing an SEH handler. libsigsegv is a C library, used (among others) by the cygwin build of m4 1.4.13. I also know that one of the new features in the recently announced beta version of gawk is the addition of support for using libsigsegv. At any rate, these snippets from the libsigsegv source are somewhat telling: /* In Cygwin programs, SetUnhandledExceptionFilter has no effect because Cygwin installs a global exception handler. We have to dig deep in order to install our main_exception_filter. */ /* Data structures for the current thread's exception handler chain. On the x86 Windows uses register fs, offset 0 to point to the current exception handler; Cygwin mucks with it, so we must do the same... :-/ */ /* Magic taken from winsup/cygwin/include/exceptions.h. */ /* Cygwin's original exception handler. */ static int (*cygwin_exception_handler) (EXCEPTION_RECORD *, void *, CONTEXT *, void *); /* Our exception handler. */ static int libsigsegv_exception_handler (EXCEPTION_RECORD *exception, void *frame, CONTEXT *context, void *dispatch) { EXCEPTION_POINTERS ExceptionInfo; ExceptionInfo.ExceptionRecord = exception; ExceptionInfo.ContextRecord = context; if (main_exception_filter (&ExceptionInfo) == EXCEPTION_CONTINUE_SEARCH) return cygwin_exception_handler (exception, frame, context, dispatch); else return 0; } [m4 wouldn't need to use libsigsegv if cygwin provided sigaltstack, but that's an entirely different can of worms.] -- Eric Blake -- 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