Explorar el Código

main: Don't ask libqb to handle segv, it doesn't work

segv should be handled by corosync, libqb is not the
place to be handling emergency signals.

This currently requires the head of libqb git tree to
generate a blackbox & coredump in the event of a segfault,
but it's better than the write() spin that currently happens.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
(cherry picked from commit 30771a39a81d0cf126864e3eb8b166ae85537f47)
Christine Caulfield hace 9 años
padre
commit
c0da36a6c0
Se han modificado 1 ficheros con 3 adiciones y 37 borrados
  1. 3 37
      exec/main.c

+ 3 - 37
exec/main.c

@@ -252,40 +252,10 @@ static int32_t sig_exit_handler (int num, void *data)
 
 static void sigsegv_handler (int num)
 {
-	(void)signal (SIGSEGV, SIG_DFL);
+	(void)signal (num, SIG_DFL);
 	corosync_blackbox_write_to_file ();
 	qb_log_fini();
-	raise (SIGSEGV);
-}
-
-/*
- * QB wrapper for real signal handler
- */
-static int32_t sig_segv_handler (int num, void *data)
-{
-
-	sigsegv_handler(num);
-
-	return 0;
-}
-
-static void sigabrt_handler (int num)
-{
-	(void)signal (SIGABRT, SIG_DFL);
-	corosync_blackbox_write_to_file ();
-	qb_log_fini();
-	raise (SIGABRT);
-}
-
-/*
- * QB wrapper for real signal handler
- */
-static int32_t sig_abrt_handler (int num, void *data)
-{
-
-	sigabrt_handler(num);
-
-	return 0;
+	raise (num);
 }
 
 #define LOCALHOST_IP inet_addr("127.0.0.1")
@@ -1213,7 +1183,7 @@ int main (int argc, char **argv, char **envp)
 	 * Other signals are registered later via qb_loop_signal_add
 	 */
 	(void)signal (SIGSEGV, sigsegv_handler);
-	(void)signal (SIGABRT, sigabrt_handler);
+	(void)signal (SIGABRT, sigsegv_handler);
 #if MSG_NOSIGNAL != 0
 	(void)signal (SIGPIPE, SIG_IGN);
 #endif
@@ -1345,10 +1315,6 @@ int main (int argc, char **argv, char **envp)
 		SIGUSR2, NULL, sig_diag_handler, NULL);
 	qb_loop_signal_add(corosync_poll_handle, QB_LOOP_HIGH,
 		SIGINT, NULL, sig_exit_handler, NULL);
-	qb_loop_signal_add(corosync_poll_handle, QB_LOOP_HIGH,
-		SIGSEGV, NULL, sig_segv_handler, NULL);
-	qb_loop_signal_add(corosync_poll_handle, QB_LOOP_HIGH,
-		SIGABRT, NULL, sig_abrt_handler, NULL);
 	qb_loop_signal_add(corosync_poll_handle, QB_LOOP_HIGH,
 		SIGQUIT, NULL, sig_exit_handler, NULL);
 	qb_loop_signal_add(corosync_poll_handle, QB_LOOP_HIGH,