diff options
Diffstat (limited to 'winsup/cygwin/cygtls.cc')
-rw-r--r-- | winsup/cygwin/cygtls.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index 0b37ed6b379..c2d7c2ed72e 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -222,7 +222,7 @@ _cygtls::set_siginfo (sigpacket *pack) infodata = pack->si; } -extern "C" DWORD __stdcall RtlUnwind (void *, void *, void *, DWORD); +extern "C" DWORD __stdcall RtlUnwind (void *, void *, void *, DWORD) __attribute__ ((noreturn)); int _cygtls::handle_threadlist_exception (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *c, void *) { @@ -249,7 +249,7 @@ _cygtls::handle_threadlist_exception (EXCEPTION_RECORD *e, exception_list *frame cygheap->threadlist[threadlist_ix]->remove (INFINITE); threadlist_ix = 0; RtlUnwind (frame, threadlist_exception_return, e, 0); - return 0; + /* Never returns */ } /* Set up the exception handler for the current thread. The x86 uses segment @@ -270,13 +270,8 @@ _cygtls::init_exception_handler (exception_handler *eh) At one point this was a loop (el.prev = ⪙). This outsmarted the above behaviour. Unfortunately this trick doesn't work anymore with Windows 2008, which irremediably gets into an endless loop, taking 100% - CPU. That's why we reverted to a normal SEH chain. - - On the bright side, Windows' behaviour is covered by POSIX: - - "If and when the function returns, if the value of sig was SIGFPE, - SIGILL, or SIGSEGV or any other implementation-defined value - corresponding to a computational exception, the behavior is undefined." */ + CPU. That's why we reverted to a normal SEH chain and changed the way + the exception handler returns to the application. */ el.prev = _except_list; _except_list = ⪙ } |