Bug 1488181: Preload psapi.dll to prevent hangs in the exception handler;r=ted
authorCarl Corcoran <ccorcoran@mozilla.com>
Thu, 20 Sep 2018 09:53:26 +0000
changeset 437428 9d400e7fa5e6e48cde2f7927e05bcdb8295cb933
parent 437427 261d22d6d396d542f1745d6bcf2222188948c6ac
child 437429 705f3c3d5d60ed20c255fbe33d79e0fc8f1e4526
push id34683
push userapavel@mozilla.com
push dateThu, 20 Sep 2018 21:54:05 +0000
treeherdermozilla-central@4d3cd0ab7277 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1488181
milestone64.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 1488181: Preload psapi.dll to prevent hangs in the exception handler;r=ted Differential Revision: https://phabricator.services.mozilla.com/D6361
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -1580,16 +1580,19 @@ nsresult SetExceptionHandler(nsIFile* aX
   nsCString tempPath;
 #endif
   if (!BuildTempPath(tempPath)) {
     return NS_ERROR_FAILURE;
   }
 
 #ifdef XP_WIN32
   ReserveBreakpadVM();
+
+  // Pre-load psapi.dll to prevent it from being loaded during exception handling.
+  ::LoadLibraryW(L"psapi.dll");
 #endif // XP_WIN32
 
 #ifdef MOZ_WIDGET_ANDROID
   androidUserSerial = getenv("MOZ_ANDROID_USER_SERIAL_NUMBER");
 #endif
 
   // Initialize the flag and mutex used to avoid dump processing
   // once browser termination has begun.