Bug 1426090 - Use minidump type 'MiniDumpWithIndirectlyReferencedMemory' for nightly on Windows. r=ted
authorCervantes Yu <cyu@mozilla.com>
Wed, 03 Jan 2018 16:06:11 +0800
changeset 397566 ea35726ecdf874f09ddff50b0fec140d05ebad7c
parent 397565 ca70091cdc76eead763e92eda4dcb939a277f62d
child 397581 c5775459d6155087687af9db401abce865d7a287
push id98554
push usercyu@mozilla.com
push dateWed, 03 Jan 2018 08:07:11 +0000
treeherdermozilla-inbound@ea35726ecdf8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1426090
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1426090 - Use minidump type 'MiniDumpWithIndirectlyReferencedMemory' for nightly on Windows. r=ted This makes heap objects directly referenced from stack objects accessbile when debugging minidumps with a debugger, with the cost of doubling the size of minidumps. MozReview-Commit-ID: 52ox1lFcaAz
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -37,16 +37,17 @@
 #include "breakpad-client/windows/crash_generation/client_info.h"
 #include "breakpad-client/windows/crash_generation/crash_generation_server.h"
 #include "breakpad-client/windows/handler/exception_handler.h"
 #include <dbghelp.h>
 #include <string.h>
 #include "nsDirectoryServiceUtils.h"
 
 #include "nsWindowsDllInterceptor.h"
+#include "mozilla/WindowsVersion.h"
 #elif defined(XP_MACOSX)
 #include "breakpad-client/mac/crash_generation/client_info.h"
 #include "breakpad-client/mac/crash_generation/crash_generation_server.h"
 #include "breakpad-client/mac/handler/exception_handler.h"
 #include <string>
 #include <Carbon/Carbon.h>
 #include <CoreFoundation/CoreFoundation.h>
 #include <crt_externs.h>
@@ -1405,16 +1406,25 @@ GetMinidumpType()
   MINIDUMP_TYPE minidump_type = MiniDumpWithFullMemoryInfo;
 
 #ifdef NIGHTLY_BUILD
   // This is Nightly only because this doubles the size of minidumps based
   // on the experimental data.
   minidump_type = static_cast<MINIDUMP_TYPE>(minidump_type |
       MiniDumpWithUnloadedModules |
       MiniDumpWithProcessThreadData);
+
+  // dbghelp.dll on Win7 can't handle overlapping memory regions so we only
+  // enable this feature on Win8 or later.
+  if (IsWin8OrLater()) {
+    minidump_type = static_cast<MINIDUMP_TYPE>(minidump_type |
+      // This allows us to examine heap objects referenced from stack objects
+      // at the cost of further doubling the size of minidumps.
+      MiniDumpWithIndirectlyReferencedMemory);
+  }
 #endif
 
   const char* e = PR_GetEnv("MOZ_CRASHREPORTER_FULLDUMP");
   if (e && *e) {
     minidump_type = MiniDumpWithFullMemory;
   }
 
   return minidump_type;