From f3c0b07212be3d3e5bcc7e1f9b904c675d488aab Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 21 May 2011 17:26:46 -0400 Subject: Bug 650525 - Don't install a SEGV handler Assume the operating system ships with a system-wide crash catching service like ABRT or Apport. --- shell/main.c | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index e6ba19a3e4..94064034fa 100644 --- a/shell/main.c +++ b/shell/main.c @@ -266,55 +266,6 @@ idle_cb (gchar **uris) #ifndef G_OS_WIN32 -/* SIGSEGV handling. - - The GNOME SEGV handler will lose if it's not run from the main Gtk - thread. So if we have to redirect the signal if the crash happens in another - thread. */ - -static void (*gnome_segv_handler) (gint); -static GStaticMutex segv_mutex = G_STATIC_MUTEX_INIT; -static GThread *main_thread = NULL; - -static void -segv_redirect (gint sig) -{ - gnome_segv_handler (sig); - - if (g_thread_self () != main_thread) { - /* We can't return from the signal handler or the thread may - SEGV again. But we can't g_thread_exit, because then the - thread may get cleaned up before bug-buddy can get a stack - trace. So we block by trying to lock a mutex we know is - already locked. */ - g_static_mutex_lock (&segv_mutex); - } -} - -static void -setup_segv_redirect (void) -{ - struct sigaction sa, osa; - - sigaction (SIGSEGV, NULL, &osa); - if (osa.sa_handler == SIG_DFL) - return; - - main_thread = g_thread_self (); - - sa.sa_flags = 0; - sigemptyset (&sa.sa_mask); - sa.sa_handler = segv_redirect; - sigaction (SIGSEGV, &sa, NULL); - sigaction (SIGBUS, &sa, NULL); - sigaction (SIGFPE, &sa, NULL); - - sa.sa_handler = SIG_IGN; - sigaction (SIGXFSZ, &sa, NULL); - gnome_segv_handler = osa.sa_handler; - g_static_mutex_lock (&segv_mutex); -} - static void quit_signal (gint sig) { @@ -344,7 +295,6 @@ setup_quit_signal (void) } #else -#define setup_segv_redirect() (void)0 #define setup_quit_signal() (void)0 #endif @@ -671,7 +621,6 @@ main (gint argc, gchar **argv) gconf_client_set_bool (client, key, FALSE, NULL); } - setup_segv_redirect (); setup_quit_signal (); if (evolution_debug_log) { -- cgit v1.2.3