From e66e5b55bb2fe9ee7646be3c50b4f145099bbb98 Mon Sep 17 00:00:00 2001 From: Bill McCloskey Date: Fri, 12 Sep 2014 11:44:38 -0700 Subject: [PATCH] Bug 1049275 - Don't use IPC for crash reporting after NS_ABORT (r=bsmedberg) --- xpcom/base/nsDebugImpl.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index ec08c0d3a0c..dbcf58f67d9 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -15,6 +15,7 @@ # include "nsExceptionHandler.h" #endif #include "nsString.h" +#include "nsXULAppAPI.h" #include "prprf.h" #include "prlog.h" #include "nsError.h" @@ -413,12 +414,17 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr, case NS_DEBUG_ABORT: { #if defined(MOZ_CRASHREPORTER) - nsCString note("xpcom_runtime_abort("); - note += buf.buffer; - note += ")"; - CrashReporter::AppendAppNotesToCrashReport(note); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AbortMessage"), - nsDependentCString(buf.buffer)); + // Updating crash annotations in the child causes us to do IPC. This can + // really cause trouble if we're asserting from within IPC code. So we + // have to do without the annotations in that case. + if (XRE_GetProcessType() == GeckoProcessType_Default) { + nsCString note("xpcom_runtime_abort("); + note += buf.buffer; + note += ")"; + CrashReporter::AppendAppNotesToCrashReport(note); + CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AbortMessage"), + nsDependentCString(buf.buffer)); + } #endif // MOZ_CRASHREPORTER #if defined(DEBUG) && defined(_WIN32)