Bug 1499465 - Don't collect KillHard crashes on Beta or Release. r=jld,gsvelto
authorMike Conley <mconley@mozilla.com>
Tue, 20 Nov 2018 21:34:36 +0000
changeset 503853 b4754021fc2dbeb9a96fc85cacc52ec1c63d1453
parent 503830 8540104bb0bd811f9fd45b160dbe38a67c9aa5cd
child 503854 f425ff2bab2dcfd4a2db80822709244b5a35d8ed
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld, gsvelto
bugs1499465
milestone65.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 1499465 - Don't collect KillHard crashes on Beta or Release. r=jld,gsvelto Differential Revision: https://phabricator.services.mozilla.com/D10968
dom/ipc/ContentParent.cpp
modules/libpref/init/all.js
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -3433,17 +3433,19 @@ ContentParent::ForceKillTimerCallback(ns
 
 void
 ContentParent::GeneratePairedMinidump(const char* aReason)
 {
   // We're about to kill the child process associated with this content.
   // Something has gone wrong to get us here, so we generate a minidump
   // of the parent and child for submission to the crash server unless we're
   // already shutting down.
-  if (mCrashReporter && !mShuttingDown) {
+  if (mCrashReporter &&
+      !mShuttingDown &&
+      Preferences::GetBool("dom.ipc.tabs.createKillHardCrashReports", false)) {
     // GeneratePairedMinidump creates two minidumps for us - the main
     // one is for the content process we're about to kill, and the other
     // one is for the main browser process. That second one is the extra
     // minidump tagging along, so we have to tell the crash reporter that
     // it exists and is being appended.
     nsAutoCString additionalDumps("browser");
     mCrashReporter->AddAnnotation(
       CrashReporter::Annotation::additional_minidumps, additionalDumps);
@@ -3453,18 +3455,16 @@ ContentParent::GeneratePairedMinidump(co
 
     // Generate the report and insert into the queue for submittal.
     if (mCrashReporter->GenerateMinidumpAndPair(this,
                                                 nullptr,
                                                 NS_LITERAL_CSTRING("browser")))
     {
       mCreatedPairedMinidumps = mCrashReporter->FinalizeCrashReport();
     }
-
-    Telemetry::Accumulate(Telemetry::SUBPROCESS_KILL_HARD, reason, 1);
   }
 }
 
 // WARNING: aReason appears in telemetry, so any new value passed in requires
 // data review.
 void
 ContentParent::KillHard(const char* aReason)
 {
@@ -3476,16 +3476,19 @@ ContentParent::KillHard(const char* aRea
   if (mCalledKillHard) {
     return;
   }
   mCalledKillHard = true;
   mForceKillTimer = nullptr;
 
   GeneratePairedMinidump(aReason);
 
+  nsDependentCString reason(aReason);
+  Telemetry::Accumulate(Telemetry::SUBPROCESS_KILL_HARD, reason, 1);
+
   ProcessHandle otherProcessHandle;
   if (!base::OpenProcessHandle(OtherPid(), &otherProcessHandle)) {
     NS_ERROR("Failed to open child process when attempting kill.");
     return;
   }
 
   if (!KillProcess(otherProcessHandle, base::PROCESS_END_KILLED_BY_USER,
            false)) {
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3307,16 +3307,24 @@ pref("dom.ipc.plugins.contentTimeoutSecs
 pref("dom.ipc.plugins.processLaunchTimeoutSecs", 0);
 pref("dom.ipc.plugins.parentTimeoutSecs", 0);
 #ifdef XP_WIN
 pref("dom.ipc.plugins.hangUITimeoutSecs", 0);
 pref("dom.ipc.plugins.hangUIMinDisplaySecs", 0);
 #endif
 #endif
 
+// Whether or not to collect a paired minidump when force-killing a
+// content process.
+#ifdef RELEASE_OR_BETA
+pref("dom.ipc.tabs.createKillHardCrashReports", false);
+#else
+pref("dom.ipc.tabs.createKillHardCrashReports", true);
+#endif
+
 pref("dom.ipc.plugins.flash.disable-protected-mode", false);
 
 pref("dom.ipc.plugins.flash.subprocess.crashreporter.enabled", true);
 pref("dom.ipc.plugins.reportCrashURL", true);
 
 // How long we wait before unloading an idle plugin process.
 // Defaults to 30 seconds.
 pref("dom.ipc.plugins.unloadTimeoutSecs", 30);