Bug 1130842 - Prior to aborting the child process due to an ipc processing error, annotate the child's crash report with the ipc failure reason text. r=billm
authorJim Mathies <jmathies@mozilla.com>
Sun, 08 Feb 2015 12:37:21 -0600
changeset 228056 603b98af7463f9435eca3216814e690f544230af
parent 228055 ee3bc49e9cf5680bce2d1fdaae81ace16fa64377
child 228057 bc48a81f3f7b70d5a893db0de5dddcc5247099e1
push id28256
push userphilringnalda@gmail.com
push dateMon, 09 Feb 2015 01:41:15 +0000
treeherdermozilla-central@3436787a82d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1130842
milestone38.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 1130842 - Prior to aborting the child process due to an ipc processing error, annotate the child's crash report with the ipc failure reason text. r=billm
dom/ipc/ContentChild.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1803,35 +1803,43 @@ ContentChild::ActorDestroy(ActorDestroyR
 
     XRE_ShutdownChildProcess();
 }
 
 void
 ContentChild::ProcessingError(Result aCode, const char* aReason)
 {
     switch (aCode) {
-    case MsgDropped:
-        NS_WARNING("MsgDropped in ContentChild");
-        return;
-    case MsgNotKnown:
-        NS_RUNTIMEABORT("aborting because of MsgNotKnown");
-    case MsgNotAllowed:
-        NS_RUNTIMEABORT("aborting because of MsgNotAllowed");
-    case MsgPayloadError:
-        NS_RUNTIMEABORT("aborting because of MsgPayloadError");
-    case MsgProcessingError:
-        NS_RUNTIMEABORT("aborting because of MsgProcessingError");
-    case MsgRouteError:
-        NS_RUNTIMEABORT("aborting because of MsgRouteError");
-    case MsgValueError:
-        NS_RUNTIMEABORT("aborting because of MsgValueError");
-
-    default:
-        NS_RUNTIMEABORT("not reached");
+        case MsgDropped:
+            NS_WARNING("MsgDropped in ContentChild");
+            return;
+
+        case MsgNotKnown:
+        case MsgNotAllowed:
+        case MsgPayloadError:
+        case MsgProcessingError:
+        case MsgRouteError:
+        case MsgValueError:
+            break;
+
+        default:
+            NS_RUNTIMEABORT("not reached");
     }
+
+#if defined(MOZ_CRASHREPORTER) && !defined(MOZ_B2G)
+    if (ManagedPCrashReporterChild().Length() > 0) {
+        CrashReporterChild* crashReporter =
+            static_cast<CrashReporterChild*>(ManagedPCrashReporterChild()[0]);
+            nsDependentCString reason(aReason);
+            crashReporter->SendAnnotateCrashReport(
+                NS_LITERAL_CSTRING("ipc_channel_error"),
+                reason);
+    }
+#endif
+    NS_RUNTIMEABORT("Content child abort due to IPC error");
 }
 
 void
 ContentChild::QuickExit()
 {
     NS_WARNING("content process _exit()ing");
     _exit(0);
 }