diff options
| author | Not Zed <NotZed@Ximian.com> | 2004-08-02 18:26:18 +0000 |
|---|---|---|
| committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-08-02 18:26:18 +0000 |
| commit | 8aa18d8eddea742ccee89cde5b97baed2acd7c9c (patch) | |
| tree | 9aaa9ac9603bb778a17d8666f0f9d2bf3b8dd368 | |
| parent | 9f5f687ce455f84100fd9a0c8a0a3314dd222b98 (diff) | |
| download | evolution-data-server-8aa18d8eddea742ccee89cde5b97baed2acd7c9c.tar.gz | |
deadlock in non-main threads so we only run once, and increment our
2004-08-02 Not Zed <NotZed@Ximian.com>
* src/server.c (gnome_segv_handler): deadlock in non-main threads
so we only run once, and increment our recursive-call code
properly, and actually exit anyway. should fix infinite crash
loop crap.
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | src/server.c | 18 |
2 files changed, 24 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2004-08-02 Not Zed <NotZed@Ximian.com> + + * src/server.c (gnome_segv_handler): deadlock in non-main threads + so we only run once, and increment our recursive-call code + properly, and actually exit anyway. should fix infinite crash + loop crap. + 2004-07-29 Rodney Dawes <dobey@novell.com> * configure.in: Check for libgnomeui_serverdir with pkgconfig, and diff --git a/src/server.c b/src/server.c index c1f9156df..813cfc123 100644 --- a/src/server.c +++ b/src/server.c @@ -30,6 +30,8 @@ #include <stdlib.h> #include <sys/signal.h> +#include <unistd.h> +#include <pthread.h> #include <glib.h> #include <libgnome/gnome-init.h> @@ -83,6 +85,8 @@ static guint termination_handler_id; static GStaticMutex termination_lock = G_STATIC_MUTEX_INIT; +static pthread_mutex_t segv_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_t main_thread; static void gnome_segv_handler (int signo) @@ -90,7 +94,14 @@ gnome_segv_handler (int signo) const char *gnome_segv_path; static int in_segv = 0; char *exec; - + + if (pthread_self() != main_thread) { + /* deadlock intentionally in the sub-threads */ + pthread_kill(main_thread, signo); + pthread_mutex_lock(&segv_mutex); + } + + in_segv++; if (in_segv > 2) { /* The fprintf() was segfaulting, we are just totally hosed */ _exit (1); @@ -105,6 +116,8 @@ gnome_segv_handler (int signo) exec = g_strdup_printf ("%s \"" PACKAGE "\" %d \"" VERSION "\"", gnome_segv_path, signo); system (exec); g_free (exec); + + _exit(1); } static void @@ -118,6 +131,9 @@ setup_segv_handler (void) sigaction (SIGSEGV, &sa, NULL); sigaction (SIGBUS, &sa, NULL); sigaction (SIGFPE, &sa, NULL); + + main_thread = pthread_self(); + pthread_mutex_lock(&segv_mutex); } |
