Bug 1402519 - Remove MOZ_CRASHREPORTER directives from security; r?ttaubert draft
authorGabriele Svelto <gsvelto@mozilla.com>
Tue, 10 Oct 2017 15:25:39 +0200
changeset 688683 a109b74734cad30c12452c282aae0d81c09516e0
parent 688682 f370ab7b0ceadecbca5d152e16ce2b598349e061
child 688684 fd320db922f9eddf426f17bb7c941176a48caa9f
push id86821
push usergsvelto@mozilla.com
push dateMon, 30 Oct 2017 14:19:43 +0000
reviewersttaubert
bugs1402519
milestone58.0a1
Bug 1402519 - Remove MOZ_CRASHREPORTER directives from security; r?ttaubert MozReview-Commit-ID: CfPBvffjEhq
security/sandbox/linux/glue/SandboxCrash.cpp
--- a/security/sandbox/linux/glue/SandboxCrash.cpp
+++ b/security/sandbox/linux/glue/SandboxCrash.cpp
@@ -13,19 +13,17 @@
 #include "SandboxLogging.h"
 
 #include <unistd.h>
 #include <sys/syscall.h>
 
 #include "mozilla/Unused.h"
 #include "mozilla/dom/Exceptions.h"
 #include "nsContentUtils.h"
-#ifdef MOZ_CRASHREPORTER
 #include "nsExceptionHandler.h"
-#endif
 #include "mozilla/StackWalk.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 
 namespace mozilla {
 
 // Log JS stack info in the same place as the sandbox violation
 // message.  Useful in case the responsible code is JS and all we have
@@ -101,21 +99,18 @@ SandboxLogCStack()
   MozStackWalk(SandboxPrintStackFrame, /* skip */ 3, /* max */ 0, nullptr);
   SANDBOX_LOG_ERROR("end of stack.");
 }
 
 static void
 SandboxCrash(int nr, siginfo_t *info, void *void_context)
 {
   pid_t pid = getpid(), tid = syscall(__NR_gettid);
-  bool dumped = false;
+  bool dumped = CrashReporter::WriteMinidumpForSigInfo(nr, info, void_context);
 
-#ifdef MOZ_CRASHREPORTER
-  dumped = CrashReporter::WriteMinidumpForSigInfo(nr, info, void_context);
-#endif
   if (!dumped) {
     SANDBOX_LOG_ERROR("crash reporter is disabled (or failed);"
                       " trying stack trace:");
     SandboxLogCStack();
   }
 
   // Do this last, in case it crashes or deadlocks.
   SandboxLogJSStack();