Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2015-04-04 18:19:31 +0300
committerCorinna Vinschen <corinna@vinschen.de>2015-04-23 22:58:32 +0300
commit65c071bc4d4622af861b63066cd8cdb9d0ece467 (patch)
tree3851a8ba5f95a4eb94972b19b175c79f99d0e095 /winsup
parent19dc6ee82cafa7acbbc4aee8db7a6b511025a805 (diff)
Initialize context before RtlContextCapture
* exceptions.cc (call_signal_handler): Zero initialize context and set context flags, as RlCaptureContext doesn't. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/exceptions.cc8
2 files changed, 11 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 50fc01ef9..6d772c2fe 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-04 Jon TURNEY <jon.turney@dronecode.org.uk>
+
+ * exceptions.cc (call_signal_handler): Zero initialize context and set
+ context flags, as RlCaptureContext doesn't.
+
2015-04-09 Corinna Vinschen <corinna@vinschen.de>
* fhandler_dsp.cc (fhandler_dev_dsp::open): Call open_null.
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 0d1f36d50..fe543aee4 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -1496,8 +1496,12 @@ _cygtls::call_signal_handler ()
if (thissi.si_cyg)
memcpy (&thiscontext.uc_mcontext, ((cygwin_exception *)thissi.si_cyg)->context(), sizeof(CONTEXT));
else
- RtlCaptureContext ((CONTEXT *)&thiscontext.uc_mcontext);
- /* FIXME: Really this should be the context which the signal interrupted? */
+ {
+ /* FIXME: Really this should be the context which the signal interrupted? */
+ memset(&thiscontext.uc_mcontext, 0, sizeof(struct __mcontext));
+ thiscontext.uc_mcontext.ctxflags = CONTEXT_FULL;
+ RtlCaptureContext ((CONTEXT *)&thiscontext.uc_mcontext);
+ }
/* FIXME: If/when sigaltstack is implemented, this will need to do
something more complicated */