This reverts commit 4af3677117a5bb2f4660d750fa4eddc6ef44e7f2 which
aborted on a "nested signal" (handling a signal handler while inside
a signal handler).

Nested signals were never strictly impossible, but even more importantly,
if a signal handler is exited with a longjmp or siglongjmp, our test code
would think it is still inside the handler, and the next signal handler
called by thi thread will abort on a supposedly "nested signal".

Perhaps this test can be redeemed if siglongjmp() would also clear the
signal_nesting flag, but it's easier just to remove this test.

Signed-off-by: Nadav Har'El <[email protected]>
---
 arch/x64/signal.cc | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/x64/signal.cc b/arch/x64/signal.cc
index cf36a74..105de84 100644
--- a/arch/x64/signal.cc
+++ b/arch/x64/signal.cc
@@ -43,16 +43,9 @@ void build_signal_frame(exception_frame* ef,
 
 }
 
-static unsigned __thread signal_nesting;
-
 extern "C"
 void call_signal_handler(arch::signal_frame* frame)
 {
-    if (signal_nesting) {
-        // Note: nested signals are legal, but rarely used, so they usually
-        // indicate trouble
-        abort("nested signals");
-    }
     // The user's signal handler might use the FPU, so save its current state.
     // FIXME: this fpu saving is not necessary if the callers already save the
     // FPU state. Currently, only divide_error() is missing FPU saving, and
@@ -60,7 +53,6 @@ void call_signal_handler(arch::signal_frame* frame)
     // divide_error(), we can probably get rid of the fpu saving here.
     sched::fpu_lock fpu;
     SCOPE_LOCK(fpu);
-    ++signal_nesting;
     if (frame->sa.sa_flags & SA_SIGINFO) {
         ucontext_t uc = {};
         auto& regs = uc.uc_mcontext.gregs;
@@ -103,7 +95,6 @@ void call_signal_handler(arch::signal_frame* frame)
     } else {
         frame->sa.sa_handler(frame->si.si_signo);
     }
-    --signal_nesting;
 }
 
 
-- 
2.9.3

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to