This patch partially reverts the commit b7097ab39ed0 because it
seems to cause issues when longjmp is used within a signal handler.
The problem that the commit addressed no longer occurs even if this
chage is reverted.
Fixes: b7097ab39ed0 ("Cygwin: signal: Revive toggling incyg flag in
call_signal_handler()")
Reviewed-by:
Signed-off-by: Takashi Yano <[email protected]>
---
winsup/cygwin/exceptions.cc | 6 +++---
winsup/cygwin/local_includes/cygtls.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 804adc92b..bcc7fe6f8 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -932,7 +932,7 @@ _cygtls::interrupt_now (CONTEXT *cx, siginfo_t& si, void
*handler,
/* Delay the interrupt if we are
1) somehow inside the DLL
2) in a Windows DLL. */
- if (incyg || inside_kernel (cx, true))
+ if (incyg || inside_kernel (cx))
interrupted = false;
else
{
@@ -1797,7 +1797,7 @@ _cygtls::call_signal_handler ()
int this_errno = saved_errno;
reset_signal_arrived ();
- incyg = false;
+ incyg = 0;
current_sig = 0; /* Flag that we can accept another signal */
/* We have to fetch the original return address from the signal stack
@@ -1910,7 +1910,7 @@ _cygtls::call_signal_handler ()
}
unlock ();
- incyg = true;
+ incyg = 1;
set_signal_mask (_my_tls.sigmask, (this_sa_flags & SA_SIGINFO)
? context1.uc_sigmask : this_oldmask);
diff --git a/winsup/cygwin/local_includes/cygtls.h
b/winsup/cygwin/local_includes/cygtls.h
index 1b3bf65f1..615361d3f 100644
--- a/winsup/cygwin/local_includes/cygtls.h
+++ b/winsup/cygwin/local_includes/cygtls.h
@@ -198,7 +198,7 @@ public: /* Do NOT remove this public: line, it's a marker
for gentls_offsets. */
class san *andreas;
waitq wq;
volatile int current_sig;
- unsigned incyg;
+ volatile unsigned incyg;
volatile unsigned stacklock;
__tlsstack_t *stackptr;
__tlsstack_t stack[TLS_STACK_SIZE];
--
2.45.1