Bug 1424304 - Workaround to allow the crashreporter to launch correctly on Fennec; r=ted.mielczarek a=lizzard
authorGabriele Svelto <gsvelto@mozilla.com>
Fri, 08 Dec 2017 18:25:40 +0100
changeset 445352 734cd1dab1a3f0d845a9e9e6c40ac575548a4b41
parent 445351 32bb2e9efd3484064565dab8aa36fb5657db75c1
child 445353 e1b8647ff08e1b9529d146efb2134c6171c4cdae
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, lizzard
bugs1424304
milestone58.0
Bug 1424304 - Workaround to allow the crashreporter to launch correctly on Fennec; r=ted.mielczarek a=lizzard MozReview-Commit-ID: EELVnTZF4Tv
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -541,17 +541,21 @@ static size_t gTexturesSize = 0;
 
 void AnnotateTexturesSize(size_t size)
 {
   gTexturesSize = size;
 }
 
 #ifndef XP_WIN
 // Like Windows CopyFile for *nix
-static bool
+//
+// This function is not declared static even though it's not used outside of
+// this file because of an issue in Fennec which prevents breakpad's exception
+// handler from invoking the MinidumpCallback function. See bug 1424304.
+bool
 copy_file(const char* from, const char* to)
 {
   const int kBufSize = 4096;
   int fdfrom = sys_open(from, O_RDONLY, 0);
   if (fdfrom < 0) {
     return false;
   }
 
@@ -919,17 +923,23 @@ LaunchCrashReporterActivity(XP_CHAR* aPr
     Unused << HANDLE_EINTR(sys_waitpid(pid, &status, __WALL));
   }
 
   return true;
 }
 
 #endif
 
-static bool
+// Callback invoked from breakpad's exception handler, this writes out the
+// last annotations after a crash occurs and launches the crash reporter client.
+//
+// This function is not declared static even though it's not used outside of
+// this file because of an issue in Fennec which prevents breakpad's exception
+// handler from invoking it. See bug 1424304.
+bool
 MinidumpCallback(
 #ifdef XP_LINUX
                       const MinidumpDescriptor& descriptor,
 #else
                       const XP_CHAR* dump_path,
                       const XP_CHAR* minidump_id,
 #endif
                       void* context,