diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-07-04 22:49:30 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-07-04 22:49:30 +0200 |
commit | 2cd7eb7f60208b0ffd51a9e117a8846c33b4ad41 (patch) | |
tree | 0ebf0d1b51a4bd5642c288b0572939399df962a4 /winsup/cygwin/autoload.cc | |
parent | 757c0871f74c3a2d682398490bcae8873d1fafd4 (diff) | |
download | cygnal-2cd7eb7f60208b0ffd51a9e117a8846c33b4ad41.tar.gz cygnal-2cd7eb7f60208b0ffd51a9e117a8846c33b4ad41.tar.bz2 cygnal-2cd7eb7f60208b0ffd51a9e117a8846c33b4ad41.zip |
Fix original stack when running signal handler on alternate stack
* autoload.cc (SetThreadStackGuarantee): Import.
* cygtls.h (struct _cygtls): Replace thread_context with a ucontext_t
called context.
* exceptions.cc (exception::handle): Exit from process via signal_exit
in case sig_send returns from handling a stack overflow SIGSEGV.
Explain why.
(dumpstack_overflow_wrapper): Thread wrapper to create a stackdump
from another thread.
(signal_exit): Fix argument list to reflect three-arg signal handler.
In case we have to create a stackdump for a stack overflow condition,
do so from a separate thread. Explain why.
(sigpacket::process): Don't run signal_exit on alternate stack.
(altstack_wrapper): Wrapper function to do stack correction when
calling the signal handler on an alternate stack to handle a stack
overflow. Make sure to have lots of comments.
(_cygtls::call_signal_handler): Drop local context variable to reduce
stack pressure. Use this->context instead. Change inline assembler
to call altstack_wrapper.
(_cygtls::signal_debugger): Accommodate aforementioned change to
struct _cygtls.
* tlsoffset.h: Regenerate.
* tlsoffset64.h: Regenerate.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/autoload.cc')
-rw-r--r-- | winsup/cygwin/autoload.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index 5832e27bf..6423a67a6 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -581,6 +581,7 @@ LoadDLLfunc (GetSystemTimePreciseAsFileTime, 4, kernel32) LoadDLLfuncEx (IdnToAscii, 20, kernel32, 1) LoadDLLfuncEx (IdnToUnicode, 20, kernel32, 1) LoadDLLfunc (LocaleNameToLCID, 8, kernel32) +LoadDLLfunc (SetThreadStackGuarantee, 4, kernel32) /* ldap functions are cdecl! */ #pragma push_macro ("mangle") |