Bug 910074 - Move crash reporter annotations added in bug 867530 after both SetExceptionHandler call and xpcom initialization. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 30 Aug 2013 11:11:42 +0900
changeset 153058 86f568d2d467bc1b670047be002aab7d1040bd8c
parent 153057 8a6ed3ef085ad242cd8b3eaf4c80e49e90b23b9f
child 153059 82379a4b40632a0469441fd0165582e474f677b6
push idunknown
push userunknown
push dateunknown
reviewersted
bugs910074, 867530
milestone26.0a1
Bug 910074 - Move crash reporter annotations added in bug 867530 after both SetExceptionHandler call and xpcom initialization. r=ted
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -920,20 +920,16 @@ nsXULAppInfo::SetEnabled(bool aEnabled)
       NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(greDir));
       if (!greDir)
         return NS_ERROR_FAILURE;
 
       xreDirectory = do_QueryInterface(greDir);
       if (!xreDirectory)
         return NS_ERROR_FAILURE;
     }
-    AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonBase"),
-                        nsPrintfCString("%.16llx", uint64_t(gMozillaPoisonBase)));
-    AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonSize"),
-                        nsPrintfCString("%lu", uint32_t(gMozillaPoisonSize)));
     return CrashReporter::SetExceptionHandler(xreDirectory, true);
   }
   else {
     if (!CrashReporter::GetEnabled())
       // no point in erroring for double-disabling
       return NS_OK;
 
     return CrashReporter::UnsetExceptionHandler();
@@ -3664,16 +3660,21 @@ XREMain::XRE_mainRun()
       nsXPIDLCString sval;
       rv = defaultPrefBranch->GetCharPref("app.update.channel", getter_Copies(sval));
       if (NS_SUCCEEDED(rv)) {
         CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ReleaseChannel"),
                                             sval);
       }
     }
   }
+  // Needs to be set after xpcom initialization.
+  CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonBase"),
+                                     nsPrintfCString("%.16llx", uint64_t(gMozillaPoisonBase)));
+  CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonSize"),
+                                     nsPrintfCString("%lu", uint32_t(gMozillaPoisonSize)));
 #endif
 
   if (mStartOffline) {
     nsCOMPtr<nsIIOService2> io (do_GetService("@mozilla.org/network/io-service;1"));
     NS_ENSURE_TRUE(io, NS_ERROR_FAILURE);
     io->SetManageOfflineStatus(false);
     io->SetOffline(true);
   }