Bug 1370609 - Avoid reading the version of dbghelp.dll on startup; r=ted
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 06 Jun 2017 16:20:29 -0400
changeset 413596 4da23071bc0ed686316d2dbb3a537439546ca04a
parent 413453 d2a4436a43499b7fbc2e47600cfbea3740b896a0
child 413597 d17ac655cc513f8d22c5b0f41fce966756b08bfd
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1370609
milestone55.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 1370609 - Avoid reading the version of dbghelp.dll on startup; r=ted We will do the same thing for all versions of this DLL that ship on the versions of Windows that we support, so this currently only serves as a way to slow down startup.
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -1494,49 +1494,25 @@ ChildFPEFilter(void* context, EXCEPTION_
   if (result) {
     PrepareChildExceptionTimeAnnotations();
   }
   return result;
 }
 
 MINIDUMP_TYPE GetMinidumpType()
 {
-  MINIDUMP_TYPE minidump_type = MiniDumpNormal;
-
-  // Try to determine what version of dbghelp.dll we're using.
-  // MinidumpWithFullMemoryInfo is only available in 6.1.x or newer.
-
-  DWORD version_size = GetFileVersionInfoSizeW(L"dbghelp.dll", nullptr);
-  if (version_size > 0) {
-    std::vector<BYTE> buffer(version_size);
-    if (GetFileVersionInfoW(L"dbghelp.dll",
-                            0,
-                            version_size,
-                            &buffer[0])) {
-      UINT len;
-      VS_FIXEDFILEINFO* file_info;
-      VerQueryValue(&buffer[0], L"\\", (void**)&file_info, &len);
-      WORD major = HIWORD(file_info->dwFileVersionMS),
-        minor = LOWORD(file_info->dwFileVersionMS),
-        revision = HIWORD(file_info->dwFileVersionLS);
-      if (major > 6 || (major == 6 && minor > 1) ||
-          (major == 6 && minor == 1 && revision >= 7600)) {
-        minidump_type = MiniDumpWithFullMemoryInfo;
-      }
+  MINIDUMP_TYPE minidump_type = MiniDumpWithFullMemoryInfo;
+
 #ifdef NIGHTLY_BUILD
-      // This is Nightly only because this doubles the size of minidumps based
-      // on the experimental data.
-      if (major > 5 || (major == 5 && minor > 1)) {
-        minidump_type = static_cast<MINIDUMP_TYPE>(minidump_type |
-            MiniDumpWithUnloadedModules |
-            MiniDumpWithProcessThreadData);
-      }
+  // 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);
 #endif
-    }
-  }
 
   const char* e = PR_GetEnv("MOZ_CRASHREPORTER_FULLDUMP");
   if (e && *e) {
     minidump_type = MiniDumpWithFullMemory;
   }
 
   return minidump_type;
 }