Bug 825698: Log process-kill messages in all builds. r=jduell
authorChris Jones <jones.chris.g@gmail.com>
Wed, 02 Jan 2013 20:15:19 -0800
changeset 126518 fdc11970821514bc9040f202cc99650ee087b55c
parent 126517 b5c0b31b73bafe7bc21a671f8e3e2f1516e6225c
child 126519 c5e54ecc16014f06a78d4b5db889566f5e95b019
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs825698
milestone20.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 825698: Log process-kill messages in all builds. r=jduell
netwerk/ipc/NeckoParent.cpp
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -157,19 +157,19 @@ NeckoParent::CreateChannelLoadContext(PB
 PHttpChannelParent*
 NeckoParent::AllocPHttpChannel(PBrowserParent* aBrowser,
                                const SerializedLoadContext& aSerialized)
 {
   nsCOMPtr<nsILoadContext> loadContext;
   const char *error = CreateChannelLoadContext(aBrowser, aSerialized,
                                                loadContext);
   if (error) {
-    NS_WARNING(nsPrintfCString("NeckoParent::AllocPHttpChannel: "
-                               "FATAL error: %s: KILLING CHILD PROCESS\n",
-                               error).get());
+    printf_stderr("NeckoParent::AllocPHttpChannel: "
+                  "FATAL error: %s: KILLING CHILD PROCESS\n",
+                  error);
     return nullptr;
   }
   PBOverrideStatus overrideStatus = PBOverrideStatusFromLoadContext(aSerialized);
   HttpChannelParent *p = new HttpChannelParent(aBrowser, loadContext, overrideStatus);
   p->AddRef();
   return p;
 }
 
@@ -184,19 +184,19 @@ NeckoParent::DeallocPHttpChannel(PHttpCh
 PFTPChannelParent*
 NeckoParent::AllocPFTPChannel(PBrowserParent* aBrowser,
                               const SerializedLoadContext& aSerialized)
 {
   nsCOMPtr<nsILoadContext> loadContext;
   const char *error = CreateChannelLoadContext(aBrowser, aSerialized,
                                                loadContext);
   if (error) {
-    NS_WARNING(nsPrintfCString("NeckoParent::AllocPFTPChannel: "
-                               "FATAL error: %s: KILLING CHILD PROCESS\n",
-                               error).get());
+    printf_stderr("NeckoParent::AllocPFTPChannel: "
+                  "FATAL error: %s: KILLING CHILD PROCESS\n",
+                  error);
     return nullptr;
   }
   PBOverrideStatus overrideStatus = PBOverrideStatusFromLoadContext(aSerialized);
   FTPChannelParent *p = new FTPChannelParent(loadContext, overrideStatus);
   p->AddRef();
   return p;
 }
 
@@ -240,19 +240,19 @@ NeckoParent::DeallocPWyciwygChannel(PWyc
 PWebSocketParent*
 NeckoParent::AllocPWebSocket(PBrowserParent* browser,
                              const SerializedLoadContext& serialized)
 {
   nsCOMPtr<nsILoadContext> loadContext;
   const char *error = CreateChannelLoadContext(browser, serialized,
                                                loadContext);
   if (error) {
-    NS_WARNING(nsPrintfCString("NeckoParent::AllocPWebSocket: "
-                               "FATAL error: %s: KILLING CHILD PROCESS\n",
-                               error).get());
+    printf_stderr("NeckoParent::AllocPWebSocket: "
+                  "FATAL error: %s: KILLING CHILD PROCESS\n",
+                  error);
     return nullptr;
   }
 
   TabParent* tabParent = static_cast<TabParent*>(browser);
   PBOverrideStatus overrideStatus = PBOverrideStatusFromLoadContext(serialized);
   WebSocketChannelParent* p = new WebSocketChannelParent(tabParent, loadContext,
                                                          overrideStatus);
   p->AddRef();
@@ -307,18 +307,18 @@ NeckoParent::AllocPRemoteOpenFile(const 
   nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(uri);
   if (!fileURL) {
     return nullptr;
   }
 
   // security checks
   if (!gDisableIPCSecurity) {
     if (!aBrowser) {
-      NS_WARNING("NeckoParent::AllocPRemoteOpenFile: "
-                 "FATAL error: missing TabParent: KILLING CHILD PROCESS\n");
+      printf_stderr("NeckoParent::AllocPRemoteOpenFile: "
+                    "FATAL error: missing TabParent: KILLING CHILD PROCESS\n");
       return nullptr;
     }
     nsRefPtr<TabParent> tabParent = static_cast<TabParent*>(aBrowser);
     uint32_t appId = tabParent->OwnOrContainingAppId();
     nsCOMPtr<nsIAppsService> appsService =
       do_GetService(APPS_SERVICE_CONTRACTID);
     if (!appsService) {
       return nullptr;
@@ -364,19 +364,19 @@ NeckoParent::AllocPRemoteOpenFile(const 
         }
       }
       // Finally: make sure there are no "../" in URI.
       // Note: not checking for symlinks (would cause I/O for each path
       // component).  So it's up to us to avoid creating symlinks that could
       // provide attack vectors.
       if (PL_strnstr(requestedPath.BeginReading(), "/../",
                      requestedPath.Length())) {
-        NS_WARNING("NeckoParent::AllocPRemoteOpenFile: "
-                   "FATAL error: requested file URI contains '/../' "
-                   "KILLING CHILD PROCESS\n");
+        printf_stderr("NeckoParent::AllocPRemoteOpenFile: "
+                      "FATAL error: requested file URI contains '/../' "
+                      "KILLING CHILD PROCESS\n");
         return nullptr;
       }
     } else {
       // regular packaged apps can only access their own application.zip file
       nsAutoString basePath;
       rv = mozApp->GetBasePath(basePath);
       if (NS_FAILED(rv)) {
         return nullptr;
@@ -385,19 +385,19 @@ NeckoParent::AllocPRemoteOpenFile(const 
       rv = mozApp->GetId(uuid);
       if (NS_FAILED(rv)) {
         return nullptr;
       }
       nsPrintfCString mustMatch("%s/%s/application.zip",
                                 NS_LossyConvertUTF16toASCII(basePath).get(),
                                 NS_LossyConvertUTF16toASCII(uuid).get());
       if (!requestedPath.Equals(mustMatch)) {
-        NS_WARNING("NeckoParent::AllocPRemoteOpenFile: "
-                   "FATAL error: requesting file other than application.zip: "
-                   "KILLING CHILD PROCESS\n");
+        printf_stderr("NeckoParent::AllocPRemoteOpenFile: "
+                      "FATAL error: requesting file other than application.zip: "
+                      "KILLING CHILD PROCESS\n");
         return nullptr;
       }
     }
   }
 
   RemoteOpenFileParent* parent = new RemoteOpenFileParent(fileURL);
   return parent;
 }