Backed out changeset e50da0289f45 (bug 791784) for Mutex leaks.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 13 Jan 2014 10:25:24 -0500
changeset 163195 5ed3e52d91e27c5659c6cfc653c4db15477534bf
parent 163194 f0811650f2f74cb3148616dd8547849ec45aab99
child 163196 d9107f528b8095dbe04bed052aeddd6b1ba5cf21
push id25984
push userryanvm@gmail.com
push dateMon, 13 Jan 2014 22:44:31 +0000
treeherdermozilla-central@425579efbac3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs791784
milestone29.0a1
backs oute50da0289f45c5eeae3a00f413c8a3ac38135095
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
Backed out changeset e50da0289f45 (bug 791784) for Mutex leaks.
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -234,20 +234,16 @@ static const int kBreakpadReserveSizePar
 // this holds additional data sent via the API
 static Mutex* crashReporterAPILock;
 static Mutex* notesFieldLock;
 static AnnotationTable* crashReporterAPIData_Hash;
 static nsCString* crashReporterAPIData = nullptr;
 static nsCString* notesField = nullptr;
 static bool isGarbageCollecting;
 
-// Avoid a race during application termination.
-static Mutex* dumpSafetyLock;
-static bool isSafeToDump = false;
-
 // OOP crash reporting
 static CrashGenerationServer* crashServer; // chrome process has this
 
 #  if defined(XP_WIN) || defined(XP_MACOSX)
 // If crash reporting is disabled, we hand out this "null" pipe to the
 // child process and don't attempt to connect to a parent server.
 static const char kNullNotifyPipe[] = "-";
 static char* childCrashNotifyPipe;
@@ -999,25 +995,16 @@ nsresult SetExceptionHandler(nsIFile* aX
     minidump_type = MiniDumpWithFullMemory;
   }
 #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.
-  NS_ASSERTION(!dumpSafetyLock, "Shouldn't have a lock yet");
-  // Do not deallocate this lock while it is still possible for
-  // isSafeToDump to be tested on another thread.
-  dumpSafetyLock = new Mutex("dumpSafetyLock");
-  MutexAutoLock lock(*dumpSafetyLock);
-  isSafeToDump = true;
-
   // now set the exception handler
 #ifdef XP_LINUX
   MinidumpDescriptor descriptor(tempPath.get());
 #endif
 
   gExceptionHandler = new google_breakpad::
     ExceptionHandler(
 #ifdef XP_LINUX
@@ -1353,21 +1340,16 @@ nsresult SetupExtraData(nsIFile* aAppDat
 
   return NS_OK;
 }
 
 static void OOPDeinit();
 
 nsresult UnsetExceptionHandler()
 {
-  if (isSafeToDump) {
-    MutexAutoLock lock(*dumpSafetyLock);
-    isSafeToDump = false;
-  }
-
 #ifdef XP_WIN
   // allow SetUnhandledExceptionFilter
   gBlockUnhandledExceptionFilter = false;
 #endif
 
   delete gExceptionHandler;
 
   // do this here in the unlikely case that we succeeded in allocating
@@ -2217,23 +2199,16 @@ OnChildProcessDumpRequested(void* aConte
                             const ClientInfo* aClientInfo,
                             const xpstring* aFilePath
 #endif
                             )
 {
   nsCOMPtr<nsIFile> minidump;
   nsCOMPtr<nsIFile> extraFile;
 
-  // Hold the mutex until the current dump request is complete, to
-  // prevent UnsetExceptionHandler() from pulling the rug out from
-  // under us.
-  MutexAutoLock lock(*dumpSafetyLock);
-  if (!isSafeToDump)
-    return;
-
   CreateFileFromPath(
 #ifdef XP_MACOSX
                      aFilePath,
 #else
                      *aFilePath,
 #endif
                      getter_AddRefs(minidump));