summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/cygtls.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-02-13 09:42:22 +0000
committerCorinna Vinschen <corinna@vinschen.de>2008-02-13 09:42:22 +0000
commit5cb998e66c8a342dad9ea03fcb5126f12ec50156 (patch)
treea5ae719b8e10a5ac8cb4537b0a20dc28d557ed7b /winsup/cygwin/cygtls.cc
parent9cb5dea0e22c3fdde4f0c638b052a0186587cf8f (diff)
downloadcygnal-5cb998e66c8a342dad9ea03fcb5126f12ec50156.tar.gz
cygnal-5cb998e66c8a342dad9ea03fcb5126f12ec50156.tar.bz2
cygnal-5cb998e66c8a342dad9ea03fcb5126f12ec50156.zip
* cygtls.cc (_cygtls::init_exception_handler): Revert patch
from 2005-12-02. * exceptions.cc (stack_info::walk): Add workaround for NT 5.2 64 bit OSes. * wincap.h (wincaps::has_restricted_stack_args): New element. * wincap.cc: Implement above element throughout. (wincapc::init): Reset has_restricted_stack_args if not running under WOW64.
Diffstat (limited to 'winsup/cygwin/cygtls.cc')
-rw-r--r--winsup/cygwin/cygtls.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc
index 2bc7e85ba..af2723e95 100644
--- a/winsup/cygwin/cygtls.cc
+++ b/winsup/cygwin/cygtls.cc
@@ -260,7 +260,23 @@ void
_cygtls::init_exception_handler (exception_handler *eh)
{
el.handler = eh;
- el.prev = &el;
+ /* Apparently Windows stores some information about an exception and tries
+ to figure out if the SEH which returned 0 last time actually solved the
+ problem, or if the problem still persists (e.g. same exception at same
+ address). In this case Windows seems to decide that it can't trust
+ that SEH and calls the next handler in the chain instead.
+
+ At one point this was a loop (el.prev = &el;). 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." */
+ el.prev = _except_list;
_except_list = &el;
}