From a506664be6f93a51152cb7c25fad1f9466ebc78c Mon Sep 17 00:00:00 2001
From: Kaz Kylheku <kaz@kylheku.com>
Date: Tue, 14 Apr 2020 06:17:21 -0700
Subject: unwind: regression: signal mask restoring.

We have a regression introduced in TXR 230, as part of the
bugfix for the extended_setjmp crash caused by PIE
executables.

This bug (for instance) causes signal handling to misbehave
after TXR handles a single asynchronous signal. In the REPL,
if the user interrupts a (usleep ...) operation with Ctrl-C,
it is afterward not possible to issue any more Ctrl-C
interrupts, asynchronous or not. The reason is that an
asynchronous interrupt directly throws an exception out of
the signal handler. Then the botched restoring of the signal
mask in extjmp_restore will install the wrong signal mask,
causing the signal to be blocked.

* unwind.c (extjmp_restore): Remove stray statement that
clobbers the saved mask of blocked signals. This was
accidentally been copy-and-pasted from extjmp_save.
---
 unwind.c | 1 -
 1 file changed, 1 deletion(-)

(limited to 'unwind.c')

diff --git a/unwind.c b/unwind.c
index 408cb67c..6459a5e1 100644
--- a/unwind.c
+++ b/unwind.c
@@ -1214,7 +1214,6 @@ void extjmp_restore(extended_jmp_buf *ejb)
    gc_prot_top = ejb->gc_pt;
 #if HAVE_POSIX_SIGS
    async_sig_enabled = ejb->se;
-   ejb->blocked.set = sig_blocked_cache.set;
    sig_mask(SIG_SETMASK,
             strip_qual(small_sigset_t *, &ejb->blocked), 0);
 
-- 
cgit v1.2.3