Get rid of incomprehensible special-case treatment of SIGABRT.
Might have made sense once but it doesn't any more.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@141 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_kerneliface.h b/coregrind/vg_kerneliface.h
index 932f6c7..062f1e4 100644
--- a/coregrind/vg_kerneliface.h
+++ b/coregrind/vg_kerneliface.h
@@ -111,13 +111,11 @@
#define VKI_SA_RESTORER 0x04000000
#endif
-#define VKI_SIGABRT 6
#define VKI_SIGSEGV 11
#define VKI_SIGBUS 7
#define VKI_SIGILL 4
#define VKI_SIGFPE 8
#define VKI_SIGKILL 9
-#define VKI_SIGABRT 6
#define VKI_SIGSTOP 19
#define VKI_SIGTERM 15
diff --git a/coregrind/vg_signals.c b/coregrind/vg_signals.c
index d035976..7fc3b0b 100644
--- a/coregrind/vg_signals.c
+++ b/coregrind/vg_signals.c
@@ -393,19 +393,6 @@
vg_assert((Char*)(&(VG_(sigstack)[0])) <= (Char*)(&dummy_local));
vg_assert((Char*)(&dummy_local) < (Char*)(&(VG_(sigstack)[10000])));
- if (sigNo == VKI_SIGABRT && VG_(sighandler)[sigNo] == NULL) {
- /* We get here if SIGABRT is delivered and the client hasn't
- asked to catch it. The aim is to exit in a controlled
- manner. */
- if (VG_(clo_trace_signals)) {
- VG_(add_to_msg)("catching SIGABRT");
- VG_(end_msg)();
- }
- VG_(ksignal)(VKI_SIGABRT, VKI_SIG_DFL);
- VG_(longjmpd_on_signal) = VKI_SIGABRT;
- __builtin_longjmp(VG_(scheduler_jmpbuf),1);
- }
-
VG_(block_all_host_signals)( &saved_procmask );
if (VG_(sighandler)[sigNo] == NULL) {
@@ -555,8 +542,6 @@
}
}
- VG_(ksignal)(VKI_SIGABRT, &VG_(oursignalhandler));
-
/* Finally, restore the blocking mask. */
VG_(restore_host_signals)( &saved_procmask );
}
@@ -634,7 +619,7 @@
if ( (param1 == VKI_SIGKILL || param1 == VKI_SIGSTOP)
&& new_action
&& new_action->ksa_handler != VKI_SIG_DFL)
- goto bad_sigkill;
+ goto bad_sigkill_or_sigstop;
our_old_handler = VG_(sighandler)[param1];
/* VG_(printf)("old handler = 0x%x\n", our_old_handler); */
@@ -673,7 +658,7 @@
vg_assert(our_old_handler == NULL);
} else {
/* There's a handler. */
- if (param1 != VKI_SIGKILL && param1 != VKI_SIGABRT) {
+ if (param1 != VKI_SIGKILL && param1 != VKI_SIGSTOP) {
vg_assert(old_action->ksa_handler == &VG_(oursignalhandler));
vg_assert((old_action->ksa_flags & VKI_SA_ONSTACK) != 0);
}
@@ -689,8 +674,6 @@
old_action->ksa_flags &= ~VKI_SA_RESTART;
}
}
-
- VG_(ksignal)(VKI_SIGABRT, &VG_(oursignalhandler));
goto good;
good:
@@ -704,10 +687,11 @@
VG_(baseBlock)[VGOFF_(m_eax)] = (UInt)(-VKI_EINVAL);
return;
- bad_sigkill:
+ bad_sigkill_or_sigstop:
VG_(message)(Vg_UserMsg,
- "Warning: attempt to set SIGKILL handler in __NR_sigaction.",
- param1);
+ "Warning: attempt to set %s handler in __NR_sigaction.",
+ param1 == VKI_SIGKILL ? "SIGKILL" : "SIGSTOP" );
+
VG_(baseBlock)[VGOFF_(m_eax)] = (UInt)(-VKI_EINVAL);
return;
}
diff --git a/vg_kerneliface.h b/vg_kerneliface.h
index 932f6c7..062f1e4 100644
--- a/vg_kerneliface.h
+++ b/vg_kerneliface.h
@@ -111,13 +111,11 @@
#define VKI_SA_RESTORER 0x04000000
#endif
-#define VKI_SIGABRT 6
#define VKI_SIGSEGV 11
#define VKI_SIGBUS 7
#define VKI_SIGILL 4
#define VKI_SIGFPE 8
#define VKI_SIGKILL 9
-#define VKI_SIGABRT 6
#define VKI_SIGSTOP 19
#define VKI_SIGTERM 15
diff --git a/vg_signals.c b/vg_signals.c
index d035976..7fc3b0b 100644
--- a/vg_signals.c
+++ b/vg_signals.c
@@ -393,19 +393,6 @@
vg_assert((Char*)(&(VG_(sigstack)[0])) <= (Char*)(&dummy_local));
vg_assert((Char*)(&dummy_local) < (Char*)(&(VG_(sigstack)[10000])));
- if (sigNo == VKI_SIGABRT && VG_(sighandler)[sigNo] == NULL) {
- /* We get here if SIGABRT is delivered and the client hasn't
- asked to catch it. The aim is to exit in a controlled
- manner. */
- if (VG_(clo_trace_signals)) {
- VG_(add_to_msg)("catching SIGABRT");
- VG_(end_msg)();
- }
- VG_(ksignal)(VKI_SIGABRT, VKI_SIG_DFL);
- VG_(longjmpd_on_signal) = VKI_SIGABRT;
- __builtin_longjmp(VG_(scheduler_jmpbuf),1);
- }
-
VG_(block_all_host_signals)( &saved_procmask );
if (VG_(sighandler)[sigNo] == NULL) {
@@ -555,8 +542,6 @@
}
}
- VG_(ksignal)(VKI_SIGABRT, &VG_(oursignalhandler));
-
/* Finally, restore the blocking mask. */
VG_(restore_host_signals)( &saved_procmask );
}
@@ -634,7 +619,7 @@
if ( (param1 == VKI_SIGKILL || param1 == VKI_SIGSTOP)
&& new_action
&& new_action->ksa_handler != VKI_SIG_DFL)
- goto bad_sigkill;
+ goto bad_sigkill_or_sigstop;
our_old_handler = VG_(sighandler)[param1];
/* VG_(printf)("old handler = 0x%x\n", our_old_handler); */
@@ -673,7 +658,7 @@
vg_assert(our_old_handler == NULL);
} else {
/* There's a handler. */
- if (param1 != VKI_SIGKILL && param1 != VKI_SIGABRT) {
+ if (param1 != VKI_SIGKILL && param1 != VKI_SIGSTOP) {
vg_assert(old_action->ksa_handler == &VG_(oursignalhandler));
vg_assert((old_action->ksa_flags & VKI_SA_ONSTACK) != 0);
}
@@ -689,8 +674,6 @@
old_action->ksa_flags &= ~VKI_SA_RESTART;
}
}
-
- VG_(ksignal)(VKI_SIGABRT, &VG_(oursignalhandler));
goto good;
good:
@@ -704,10 +687,11 @@
VG_(baseBlock)[VGOFF_(m_eax)] = (UInt)(-VKI_EINVAL);
return;
- bad_sigkill:
+ bad_sigkill_or_sigstop:
VG_(message)(Vg_UserMsg,
- "Warning: attempt to set SIGKILL handler in __NR_sigaction.",
- param1);
+ "Warning: attempt to set %s handler in __NR_sigaction.",
+ param1 == VKI_SIGKILL ? "SIGKILL" : "SIGSTOP" );
+
VG_(baseBlock)[VGOFF_(m_eax)] = (UInt)(-VKI_EINVAL);
return;
}