From 9a5abcc896bde48ae72fd62fe43a2307663d8ad5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 30 Jan 2019 20:05:39 +0100 Subject: Cygwin: x86_64: pthreads: Install exception handler after switching stack After creating a pthread, the stack gets moved to the desired memory location. While the 32 bit thread wrapper copies the exception handler information to the new stack (so we have at least *some* exception handler present), the x86_64 code didn't perform any exception handler magic. Fix that. Signed-off-by: Corinna Vinschen --- winsup/cygwin/thread.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index c7b7e5157..f353dd497 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -30,6 +30,7 @@ details. */ #include "cygheap.h" #include "ntdll.h" #include "cygwait.h" +#include "exception.h" extern "C" void __fp_lock_all (); extern "C" void __fp_unlock_all (); @@ -1990,6 +1991,7 @@ pthread_spinlock::unlock () DWORD WINAPI pthread::thread_init_wrapper (void *arg) { + exception protect; pthread *thread = (pthread *) arg; /* This *must* be set prior to calling set_tls_self_pointer or there is a race with the signal processing code which may miss the signal mask -- cgit v1.2.3