changeset 2066:4f750b8d0127 trunk

[svn] Do not install signal handler for SIGSEGV if environmental variable AUD_ENSURE_BACKTRACE is defined. In particular environment (maybe with glibc 2.5), core file through signal handler does not contain application's backtrace but signal handler's backtrace. :(
author yaz
date Thu, 07 Dec 2006 22:42:22 -0800
parents 598564ddc4e9
children 0b0a12ea9dd9
files ChangeLog audacious/main.c
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Dec 07 00:22:55 2006 -0800
+++ b/ChangeLog	Thu Dec 07 22:42:22 2006 -0800
@@ -1,3 +1,10 @@
+2006-12-07 08:22:55 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [3133]
+  - no, this is not going to work
+  
+  0 files changed
+
+
 2006-12-07 08:12:31 +0000  William Pitcock <nenolod@nenolod.net>
   revision [3131]
   - add work in progress TagLib::TagVFSFile class.
--- a/audacious/main.c	Thu Dec 07 00:22:55 2006 -0800
+++ b/audacious/main.c	Thu Dec 07 22:42:22 2006 -0800
@@ -1076,7 +1076,15 @@
         bmp_setup_logger();
 
     signal(SIGPIPE, SIG_IGN);   /* for controlsocket.c */
-    signal(SIGSEGV, segfault_handler);
+
+    /* in particular environment (maybe with glibc 2.5), core file
+       through signal handler doesn't contain useful back trace. */
+    {
+        char *magic;
+        magic = getenv("AUD_ENSURE_BACKTRACE");
+        if(magic == NULL)
+            signal(SIGSEGV, segfault_handler);
+    }
 
     g_random_set_seed(time(NULL));