This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 1/3] Initialize context before RtlContextCapture
- From: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- To: cygwin-patches at cygwin dot com
- Cc: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- Date: Thu, 9 Apr 2015 14:13:23 +0100
- Subject: [PATCH 1/3] Initialize context before RtlContextCapture
- Authentication-results: sourceware.org; auth=none
- References: <1428585205-14420-1-git-send-email-jon dot turney at dronecode dot org dot uk>
* 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>
---
winsup/cygwin/ChangeLog | 5 +++++
winsup/cygwin/exceptions.cc | 8 ++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 0d1f36d..9d50c1e 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 */
--
2.1.4