Bug 721843 - Add just-in-time debugging by using CRAWL_STACK_ON_SIGSEGV on non official builds for mac/linux. r=ted
☠☠ backed out by c1ac587a1ccb ☠ ☠
authorBenoit Girard <b56girard@gmail.com>
Mon, 01 Oct 2012 22:09:20 -0400
changeset 108848 63105f3adf347e4bf82385ac9a83addeb6514397
parent 108847 1b0fd0ddbfecfd1f85a58855d3d6c8d249589694
child 108849 932204a65b9c0edb9dfd940172280890423d7926
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-esr52@2704e441363f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs721843
milestone18.0a1
Bug 721843 - Add just-in-time debugging by using CRAWL_STACK_ON_SIGSEGV on non official builds for mac/linux. r=ted
toolkit/xre/nsSigHandlers.cpp
--- a/toolkit/xre/nsSigHandlers.cpp
+++ b/toolkit/xre/nsSigHandlers.cpp
@@ -38,17 +38,17 @@
 
 static char _progname[1024] = "huh?";
 static unsigned int _gdb_sleep_duration = 300;
 
 // NB: keep me up to date with the same variable in
 // ipc/chromium/chrome/common/ipc_channel_posix.cc
 static const int kClientChannelFd = 3;
 
-#if defined(LINUX) && defined(DEBUG) && \
+#if (defined(LINUX) || defined(XP_MACOSX)) && \
       (defined(__i386) || defined(__x86_64) || defined(PPC))
 #define CRAWL_STACK_ON_SIGSEGV
 #endif
 
 #if defined(CRAWL_STACK_ON_SIGSEGV)
 
 #include <unistd.h>
 #include "nsISupportsUtils.h"
@@ -220,17 +220,18 @@ void InstallSignalHandlers(const char *P
   {
     unsigned int s;
     if (1 == sscanf(gdbSleep, "%u", &s)) {
       _gdb_sleep_duration = s;
     }
   }
 
 #if defined(CRAWL_STACK_ON_SIGSEGV)
-  if (!getenv("XRE_NO_WINDOWS_CRASH_DIALOG")) {
+  if (!getenv("XRE_NO_WINDOWS_CRASH_DIALOG") &&
+      !getenv("MOZ_CRASHREPORTER")) {
     void (*crap_handler)(int) =
       GeckoProcessType_Default != XRE_GetProcessType() ?
           child_ah_crap_handler :
           ah_crap_handler;
     signal(SIGSEGV, crap_handler);
     signal(SIGILL, crap_handler);
     signal(SIGABRT, crap_handler);
   }