Bug 1012912 - Killing plugin-container with SIGABRT doesn't trigger the crash reporter on Mac. r=ted a=sylvestre
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Tue, 29 Jul 2014 16:58:34 +0200
changeset 217314 35c982e10670d9e192c9f6a7f343a34b52a02d75
parent 217313 34878f489703fd7feb731be99893409a2cc432be
child 217315 103b6ab5b984ea64ba5e9328d2f1adebdfc13480
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, sylvestre
bugs1012912
milestone33.0a2
Bug 1012912 - Killing plugin-container with SIGABRT doesn't trigger the crash reporter on Mac. r=ted a=sylvestre
toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
@@ -621,35 +621,34 @@ void ExceptionHandler::SignalHandler(int
 #endif
 }
 
 bool ExceptionHandler::InstallHandler() {
   // If a handler is already installed, something is really wrong.
   if (gProtectedData.handler != NULL) {
     return false;
   }
-  if (!IsOutOfProcess()) {
-    struct sigaction sa;
-    memset(&sa, 0, sizeof(sa));
-    sigemptyset(&sa.sa_mask);
-    sigaddset(&sa.sa_mask, SIGABRT);
-    sa.sa_sigaction = ExceptionHandler::SignalHandler;
-    sa.sa_flags = SA_SIGINFO;
+
+  struct sigaction sa;
+  memset(&sa, 0, sizeof(sa));
+  sigemptyset(&sa.sa_mask);
+  sigaddset(&sa.sa_mask, SIGABRT);
+  sa.sa_sigaction = ExceptionHandler::SignalHandler;
+  sa.sa_flags = SA_SIGINFO;
 
-    scoped_ptr<struct sigaction> old(new struct sigaction);
-    if (sigaction(SIGABRT, &sa, old.get()) == -1) {
-      return false;
-    }
-    old_handler_.swap(old);
-    gProtectedData.handler = this;
+  scoped_ptr<struct sigaction> old(new struct sigaction);
+  if (sigaction(SIGABRT, &sa, old.get()) == -1) {
+    return false;
+  }
+  old_handler_.swap(old);
+  gProtectedData.handler = this;
 #if USE_PROTECTED_ALLOCATIONS
-    assert(((size_t)(gProtectedData.protected_buffer) & PAGE_MASK) == 0);
-    mprotect(gProtectedData.protected_buffer, PAGE_SIZE, PROT_READ);
+  assert(((size_t)(gProtectedData.protected_buffer) & PAGE_MASK) == 0);
+  mprotect(gProtectedData.protected_buffer, PAGE_SIZE, PROT_READ);
 #endif
-  }
 
   try {
 #if USE_PROTECTED_ALLOCATIONS
     previous_ = new (gBreakpadAllocator->Allocate(sizeof(ExceptionParameters)) )
       ExceptionParameters();
 #else
     previous_ = new ExceptionParameters();
 #endif