Bug 1450231 - Ignore MOZ_CRASH in FatalError() for --enable-fuzzing builds. r=jld
authorChristoph Diehl <cdiehl@mozilla.com>
Tue, 03 Apr 2018 09:51:21 +0200
changeset 471574 ee7a5b7274d8787ccfb3e073b4c10e5c9c0917c3
parent 471573 2692e7aaefbdb8d40612704abbe1422c60ce5b0d
child 471575 1e02fd7fa20cca193353c033b8e4cfb2027c5e0e
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld
bugs1450231
milestone61.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 1450231 - Ignore MOZ_CRASH in FatalError() for --enable-fuzzing builds. r=jld
ipc/glue/ProtocolUtils.cpp
--- a/ipc/glue/ProtocolUtils.cpp
+++ b/ipc/glue/ProtocolUtils.cpp
@@ -271,33 +271,39 @@ ProtocolErrorBreakpoint(const char* aMsg
     // reproduce.  Log always in the hope that someone finds the error
     // message.
     printf_stderr("IPDL protocol error: %s\n", aMsg);
 }
 
 void
 FatalError(const char* aMsg, bool aIsParent)
 {
+#ifndef FUZZING
   ProtocolErrorBreakpoint(aMsg);
+#endif
 
   nsAutoCString formattedMessage("IPDL error: \"");
   formattedMessage.AppendASCII(aMsg);
   if (aIsParent) {
     // We're going to crash the parent process because at this time
     // there's no other really nice way of getting a minidump out of
     // this process if we're off the main thread.
     formattedMessage.AppendLiteral("\". Intentionally crashing.");
     NS_ERROR(formattedMessage.get());
     CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCFatalErrorMsg"),
                                        nsDependentCString(aMsg));
     AnnotateSystemError();
+#ifndef FUZZING
     MOZ_CRASH("IPC FatalError in the parent process!");
+#endif
   } else {
     formattedMessage.AppendLiteral("\". abort()ing as a result.");
+#ifndef FUZZING
     MOZ_CRASH_UNSAFE_OOL(formattedMessage.get());
+#endif
   }
 }
 
 void
 LogicError(const char* aMsg)
 {
   MOZ_CRASH_UNSAFE_OOL(aMsg);
 }