aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-11-15 04:26:00 +0800
committerDan Winship <danw@src.gnome.org>2001-11-15 04:26:00 +0800
commit417af815269ebb26ea9768fa69e970111a47224b (patch)
tree8c192c4e52ed85a86ab905f162c290f8740fc9bd /mail
parent4647e0c39c4c131a9e4fa04e2ebb2fe7383366fb (diff)
downloadgsoc2013-evolution-417af815269ebb26ea9768fa69e970111a47224b.tar
gsoc2013-evolution-417af815269ebb26ea9768fa69e970111a47224b.tar.gz
gsoc2013-evolution-417af815269ebb26ea9768fa69e970111a47224b.tar.bz2
gsoc2013-evolution-417af815269ebb26ea9768fa69e970111a47224b.tar.lz
gsoc2013-evolution-417af815269ebb26ea9768fa69e970111a47224b.tar.xz
gsoc2013-evolution-417af815269ebb26ea9768fa69e970111a47224b.tar.zst
gsoc2013-evolution-417af815269ebb26ea9768fa69e970111a47224b.zip
Instead of doing pthread_exit() after redirecting the SEGV, try to lock a
* main.c (segv_redirect): Instead of doing pthread_exit() after redirecting the SEGV, try to lock a mutex we know is already locked. This will hopefully help debug a bunch of bugs where the crashed thread seems to be missing from the bug-buddy report. svn path=/trunk/; revision=14699
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/main.c11
2 files changed, 17 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index a2e8eadb14..76e3a63141 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2001-11-14 Dan Winship <danw@ximian.com>
+
+ * main.c (segv_redirect): Instead of doing pthread_exit() after
+ redirecting the SEGV, try to lock a mutex we know is already
+ locked. This will hopefully help debug a bunch of bugs where the
+ crashed thread seems to be missing from the bug-buddy report.
+
2001-11-13 Jeffrey Stedfast <fejj@ximian.com>
* mail-session.c (pass_got): Call e_passwords_remember_password()
diff --git a/mail/main.c b/mail/main.c
index af3bd93e7c..ef3f7f0ab4 100644
--- a/mail/main.c
+++ b/mail/main.c
@@ -62,6 +62,8 @@ static int blowup(int status)
*/
static void (*gnome_segv_handler) (int);
+static GStaticMutex segv_mutex = G_STATIC_MUTEX_INIT;
+
static void
segv_redirect (int sig)
{
@@ -69,7 +71,13 @@ segv_redirect (int sig)
gnome_segv_handler (sig);
else {
pthread_kill (mail_gui_thread, sig);
- pthread_exit (NULL);
+ /* We can't return from the signal handler or the
+ * thread may SEGV again. But we can't pthread_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);
}
}
@@ -105,6 +113,7 @@ main (int argc, char *argv [])
sigaction (SIGBUS, &sa, NULL);
sigaction (SIGFPE, &sa, NULL);
gnome_segv_handler = osa.sa_handler;
+ g_static_mutex_lock (&segv_mutex);
}
orb = oaf_init (argc, argv);