diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-07-04 23:49:30 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-07-04 23:49:30 +0300 |
commit | 2cd7eb7f60208b0ffd51a9e117a8846c33b4ad41 (patch) | |
tree | 0ebf0d1b51a4bd5642c288b0572939399df962a4 /winsup/cygwin/tlsoffsets64.h | |
parent | 757c0871f74c3a2d682398490bcae8873d1fafd4 (diff) |
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/tlsoffsets64.h')
-rw-r--r-- | winsup/cygwin/tlsoffsets64.h | 116 |
1 files changed, 60 insertions, 56 deletions
diff --git a/winsup/cygwin/tlsoffsets64.h b/winsup/cygwin/tlsoffsets64.h index 3f171b0ff..d137408d0 100644 --- a/winsup/cygwin/tlsoffsets64.h +++ b/winsup/cygwin/tlsoffsets64.h @@ -31,34 +31,36 @@ //; $tls::psignal_arrived = 4152; //; $tls::will_wait_for_signal = -8640; //; $tls::pwill_wait_for_signal = 4160; -//; $tls::thread_context = -8632; -//; $tls::pthread_context = 4168; -//; $tls::thread_id = -7400; -//; $tls::pthread_id = 5400; -//; $tls::infodata = -7396; -//; $tls::pinfodata = 5404; -//; $tls::tid = -7248; -//; $tls::ptid = 5552; -//; $tls::_ctinfo = -7240; -//; $tls::p_ctinfo = 5560; -//; $tls::andreas = -7232; -//; $tls::pandreas = 5568; -//; $tls::wq = -7224; -//; $tls::pwq = 5576; -//; $tls::sig = -7176; -//; $tls::psig = 5624; -//; $tls::incyg = -7172; -//; $tls::pincyg = 5628; -//; $tls::spinning = -7168; -//; $tls::pspinning = 5632; -//; $tls::stacklock = -7164; -//; $tls::pstacklock = 5636; -//; $tls::stackptr = -7160; -//; $tls::pstackptr = 5640; -//; $tls::stack = -7152; -//; $tls::pstack = 5648; -//; $tls::initialized = -5104; -//; $tls::pinitialized = 7696; +//; $tls::__align = -8632; +//; $tls::p__align = 4168; +//; $tls::context = -8624; +//; $tls::pcontext = 4176; +//; $tls::thread_id = -7328; +//; $tls::pthread_id = 5472; +//; $tls::infodata = -7324; +//; $tls::pinfodata = 5476; +//; $tls::tid = -7176; +//; $tls::ptid = 5624; +//; $tls::_ctinfo = -7168; +//; $tls::p_ctinfo = 5632; +//; $tls::andreas = -7160; +//; $tls::pandreas = 5640; +//; $tls::wq = -7152; +//; $tls::pwq = 5648; +//; $tls::sig = -7104; +//; $tls::psig = 5696; +//; $tls::incyg = -7100; +//; $tls::pincyg = 5700; +//; $tls::spinning = -7096; +//; $tls::pspinning = 5704; +//; $tls::stacklock = -7092; +//; $tls::pstacklock = 5708; +//; $tls::stackptr = -7088; +//; $tls::pstackptr = 5712; +//; $tls::stack = -7080; +//; $tls::pstack = 5720; +//; $tls::initialized = -5032; +//; $tls::pinitialized = 7768; //; __DATA__ #define tls_locals (-12800) @@ -91,31 +93,33 @@ #define tls_psignal_arrived (4152) #define tls_will_wait_for_signal (-8640) #define tls_pwill_wait_for_signal (4160) -#define tls_thread_context (-8632) -#define tls_pthread_context (4168) -#define tls_thread_id (-7400) -#define tls_pthread_id (5400) -#define tls_infodata (-7396) -#define tls_pinfodata (5404) -#define tls_tid (-7248) -#define tls_ptid (5552) -#define tls__ctinfo (-7240) -#define tls_p_ctinfo (5560) -#define tls_andreas (-7232) -#define tls_pandreas (5568) -#define tls_wq (-7224) -#define tls_pwq (5576) -#define tls_sig (-7176) -#define tls_psig (5624) -#define tls_incyg (-7172) -#define tls_pincyg (5628) -#define tls_spinning (-7168) -#define tls_pspinning (5632) -#define tls_stacklock (-7164) -#define tls_pstacklock (5636) -#define tls_stackptr (-7160) -#define tls_pstackptr (5640) -#define tls_stack (-7152) -#define tls_pstack (5648) -#define tls_initialized (-5104) -#define tls_pinitialized (7696) +#define tls___align (-8632) +#define tls_p__align (4168) +#define tls_context (-8624) +#define tls_pcontext (4176) +#define tls_thread_id (-7328) +#define tls_pthread_id (5472) +#define tls_infodata (-7324) +#define tls_pinfodata (5476) +#define tls_tid (-7176) +#define tls_ptid (5624) +#define tls__ctinfo (-7168) +#define tls_p_ctinfo (5632) +#define tls_andreas (-7160) +#define tls_pandreas (5640) +#define tls_wq (-7152) +#define tls_pwq (5648) +#define tls_sig (-7104) +#define tls_psig (5696) +#define tls_incyg (-7100) +#define tls_pincyg (5700) +#define tls_spinning (-7096) +#define tls_pspinning (5704) +#define tls_stacklock (-7092) +#define tls_pstacklock (5708) +#define tls_stackptr (-7088) +#define tls_pstackptr (5712) +#define tls_stack (-7080) +#define tls_pstack (5720) +#define tls_initialized (-5032) +#define tls_pinitialized (7768) |