bug 1410143 - Whitelist ipc_channel_error for crash pings data-r?rweiss r?gsvelto draft
authorChris H-C <chutten@mozilla.com>
Fri, 20 Oct 2017 14:49:14 -0400
changeset 690249 aa3d003417aad76200202130fb31696b5adfcee8
parent 690034 cd7217cf05a2332a8fd7b498767a07b2c31ea657
child 738529 22aed612f90b87d2008bbad16018c0f7d43832fe
push id87252
push userbmo:chutten@mozilla.com
push dateWed, 01 Nov 2017 19:32:06 +0000
reviewersgsvelto
bugs1410143
milestone58.0a1
bug 1410143 - Whitelist ipc_channel_error for crash pings data-r?rweiss r?gsvelto At present it is difficult to determine whether a crash ping is from a shutdownkill or not. By including ipc_channel_error we will be able to figure that out. We also as a bonus get additional insight into ipc channel error types that lead to crashes. MozReview-Commit-ID: FepLsSS2tAI
toolkit/components/crashes/CrashManager.jsm
toolkit/components/crashes/tests/xpcshell/test_crash_manager.js
toolkit/components/telemetry/docs/data/crash-ping.rst
toolkit/crashreporter/client/ping.cpp
--- a/toolkit/components/crashes/CrashManager.jsm
+++ b/toolkit/components/crashes/CrashManager.jsm
@@ -222,16 +222,17 @@ this.CrashManager.prototype = Object.fre
   // The type of event is unknown.
   EVENT_FILE_ERROR_UNKNOWN_EVENT: "unknown-event",
 
   // A whitelist of crash annotations which do not contain sensitive data
   // and are saved in the crash record and sent with Firefox Health Report.
   ANNOTATION_WHITELIST: [
     "AsyncShutdownTimeout",
     "BuildID",
+    "ipc_channel_error",
     "ProductID",
     "ProductName",
     "ReleaseChannel",
     "RemoteType",
     "SecondsSinceLastCrash",
     "ShutdownProgress",
     "StartupCrash",
     "TelemetryEnvironment",
--- a/toolkit/components/crashes/tests/xpcshell/test_crash_manager.js
+++ b/toolkit/components/crashes/tests/xpcshell/test_crash_manager.js
@@ -482,16 +482,17 @@ add_task(async function test_child_proce
   for (let p of EXPECTED_PROCESSES) {
     // Generate a ping.
     const remoteType = (p === m.PROCESS_TYPE_CONTENT) ? "web" : undefined;
     let id = await m.createDummyDump();
     await m.addCrash(p, m.CRASH_TYPE_CRASH, id, DUMMY_DATE, {
       RemoteType: remoteType,
       StackTraces: stackTraces,
       MinidumpSha256Hash: sha256Hash,
+      ipc_channel_error: "ShutDownKill",
       ThisShouldNot: "end-up-in-the-ping"
     });
     await m._pingPromise;
 
     let found = await ac.promiseFindPing("crash", [
       [["payload", "crashId"], id],
       [["payload", "minidumpSha256Hash"], sha256Hash],
       [["payload", "processType"], p],
@@ -503,16 +504,18 @@ add_task(async function test_child_proce
     hoursOnly.setSeconds(0);
     hoursOnly.setMinutes(0);
     Assert.equal(new Date(found.payload.crashTime).getTime(), hoursOnly.getTime());
 
     Assert.equal(found.payload.metadata.ThisShouldNot, undefined,
                  "Non-whitelisted fields should be filtered out");
     Assert.equal(found.payload.metadata.RemoteType, remoteType,
                  "RemoteType should be whitelisted for content crashes");
+    Assert.equal(found.payload.metadata.ipc_channel_error, "ShutDownKill",
+                 "ipc_channel_error should be whitelisted for content crashes");
   }
 
   // Check that we don't generate a crash ping for invalid/unexpected process
   // types.
   for (let p of UNEXPECTED_PROCESSES) {
     let id = await m.createDummyDump();
     await m.addCrash(p, m.CRASH_TYPE_CRASH, id, DUMMY_DATE, {
       StackTraces: stackTraces,
--- a/toolkit/components/telemetry/docs/data/crash-ping.rst
+++ b/toolkit/components/telemetry/docs/data/crash-ping.rst
@@ -49,16 +49,17 @@ Structure:
           AvailablePageFile: <size>, // Windows-only, available paging file
           AvailablePhysicalMemory: <size>, // Windows-only, available physical memory
           AvailableVirtualMemory: <size>, // Windows-only, available virtual memory
           BlockedDllList: <list>, // Windows-only, see WindowsDllBlocklist.cpp for details
           BlocklistInitFailed: 1, // Windows-only, present only if the DLL blocklist initialization failed
           CrashTime: <time>, // Seconds since the Epoch
           ContainsMemoryReport: 1, // Optional
           EventLoopNestingLevel: <levels>, // Optional, present only if >0
+          ipc_channel_error: <error string>, // Optional, contains the string processing error reason for an ipc-based content crash
           IsGarbageCollecting: 1, // Optional, present only if set to 1
           MozCrashReason: <reason>, // Optional, contains the string passed to MOZ_CRASH()
           OOMAllocationSize: <size>, // Size of the allocation that caused an OOM
           RemoteType: <type>, // Optional, type of content process, see below for a list of types
           SecondsSinceLastCrash: <duration>, // Seconds elapsed since the last crash occurred
           ShutdownProgress: <phase>, // Optional, contains the shutdown phase in which the crash occurred
           SystemMemoryUsePercentage: <percentage>, // Windows-only, percent of memory in use
           TelemetrySessionId: <id>, // Active telemetry session ID when the crash was recorded
@@ -196,8 +197,13 @@ The trust levels are (from least trusted
 | scan          | Scanned the stack, found this                     |
 +---------------+---------------------------------------------------+
 | none          | Unknown, this is most likely not a valid frame    |
 +---------------+---------------------------------------------------+
 
 The ``code_id`` field holds a unique ID used to distinguish between different
 versions and builds of the same module. See `breakpad <https://chromium.googlesource.com/breakpad/breakpad/+/24f5931c5e0120982c0cbf1896641e3ef2bdd52f/src/google_breakpad/processor/code_module.h#60>`__'s
 description for further information. This field is populated only on Windows.
+
+Version History
+===============
+
+- Firefox 58: Added ipc_channel_error (`bug 1410143 <https://bugzilla.mozilla.org/show_bug.cgi?id=1410143>`_).
--- a/toolkit/crashreporter/client/ping.cpp
+++ b/toolkit/crashreporter/client/ping.cpp
@@ -127,16 +127,17 @@ CreateMetadataNode(StringTable& strings)
     "AvailablePhysicalMemory",
     "AvailableVirtualMemory",
     "BlockedDllList",
     "BlocklistInitFailed",
     "BuildID",
     "ContainsMemoryReport",
     "CrashTime",
     "EventLoopNestingLevel",
+    "ipc_channel_error",
     "IsGarbageCollecting",
     "MozCrashReason",
     "OOMAllocationSize",
     "ProductID",
     "ProductName",
     "ReleaseChannel",
     "RemoteType",
     "SecondsSinceLastCrash",