Backout "Bug 1183355 - Annotate crash reports triggered by MOZ_CRASH in release builds, r=froydnj" for OOM concerns
authorMichael Layzell <michael@thelayzells.com>
Thu, 24 Sep 2015 17:58:34 -0400
changeset 264324 50126e0f1d13f50f7db56030c075e8ecb6e48b77
parent 264323 be95d7340fb4fab62339cd6b147cc873b94409e2
child 264325 98398ef6d9872bf8b017a4fca0ca844441f16616
push id29436
push usercbook@mozilla.com
push dateFri, 25 Sep 2015 12:39:56 +0000
treeherdermozilla-central@543e1b3a2588 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1183355
milestone44.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
Backout "Bug 1183355 - Annotate crash reports triggered by MOZ_CRASH in release builds, r=froydnj" for OOM concerns This reverts commit 5ca16aeadfea27afc9939e39d8a6f0a39802c066.
mfbt/Assertions.h
toolkit/xre/nsAppRunner.cpp
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -16,26 +16,16 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/Compiler.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MacroArgs.h"
 #ifdef MOZ_DUMP_ASSERTION_STACK
 #include "nsTraceRefcnt.h"
 #endif
 
-// In libraries where the user wants to enable crash reporting when MOZ_CRASH is enabled,
-// MOZ_CRASH_CRASHREPORT must be defined, and the MOZ_ReportMozCrashToCrashReporter method
-// must be provided by the library. This ifdef defines the macro within libXUL, when
-// MOZ_CRASHREPORTER is enabled. The implementation of MOZ_ReportMozCrashToCrashReporter
-// for libXUL is defined in /toolkit/xre/nsAppRunner.cpp
-#if defined(MOZ_CRASHREPORTER) && defined(MOZILLA_INTERNAL_API) && \
-    !defined(MOZILLA_EXTERNAL_LINKAGE)
-#  define MOZ_CRASH_CRASHREPORT
-#endif
-
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef WIN32
    /*
     * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which
     * further depends on <windef.h>.  We hardcode these few definitions manually
     * because those headers clutter the global namespace with a significant
@@ -128,25 +118,16 @@ TerminateProcess(void* hProcess, unsigne
 #else
 #define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)
 #endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifdef MOZ_CRASH_CRASHREPORT
-/*
- * Associates the given string with a crash report. This function must be
- * provided by the library which mfbt is being used in if MOZ_CRASH_CRASHREPORT
- * is defined (by default, MOZ_CRASH_CRASHREPORT is only defined in libXUL).
- */
-void MOZ_ReportMozCrashToCrashReporter(const char* aStr);
-#endif // MOZ_CRASH_CRASHREPORT
-
 /*
  * Prints |aStr| as an assertion failure (using aFilename and aLine as the
  * location of the assertion) to the standard debug-output channel.
  *
  * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This
  * method is primarily for internal use in this header, and only secondarily
  * for use in implementing release-build assertions.
  */
@@ -263,25 +244,17 @@ MOZ_ReportCrash(const char* aStr, const 
  *
  * If we're a DEBUG build and we crash at a MOZ_CRASH which provides an
  * explanation-string, we print the string to stderr.  Otherwise, we don't
  * print anything; this is because we want MOZ_CRASH to be 100% safe in release
  * builds, and it's hard to print to stderr safely when memory might have been
  * corrupted.
  */
 #ifndef DEBUG
-#  ifdef MOZ_CRASH_CRASHREPORT
-#    define MOZ_CRASH(...) \
-       do { \
-         MOZ_ReportMozCrashToCrashReporter("" __VA_ARGS__); \
-         MOZ_REALLY_CRASH(); \
-       } while (0)
-#  else
-#    define MOZ_CRASH(...) MOZ_REALLY_CRASH()
-#  endif
+#  define MOZ_CRASH(...) MOZ_REALLY_CRASH()
 #else
 #  define MOZ_CRASH(...) \
      do { \
        MOZ_ReportCrash("" __VA_ARGS__, __FILE__, __LINE__); \
        MOZ_REALLY_CRASH(); \
      } while (0)
 #endif
 
@@ -531,11 +504,10 @@ struct AssertionConditionType
   do { \
     if ( ( expr ) ) {                       \
       /* Silence MOZ_WARN_UNUSED_RESULT. */ \
     } \
   } while (0)
 #endif
 
 #undef MOZ_DUMP_ASSERTION_STACK
-#undef MOZ_CRASH_CRASHREPORT
 
 #endif /* mozilla_Assertions_h */
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -188,27 +188,16 @@
 #endif
 
 #ifdef MOZ_CRASHREPORTER
 #include "nsExceptionHandler.h"
 #include "nsICrashReporter.h"
 #define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1"
 #include "nsIPrefService.h"
 #include "nsIMemoryInfoDumper.h"
-
-// Provide MOZ_ReportMozCrashToCrashReporter for reporting MOZ_CRASH errors
-// See /mfbt/Assertions.h for more information
-extern "C" {
-void
-MOZ_ReportMozCrashToCrashReporter(const char* aStr)
-{
-  nsDependentCString msg(aStr);
-  CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("MOZ_CRASH"), msg);
-}
-}
 #endif
 
 #include "base/command_line.h"
 #ifdef MOZ_ENABLE_TESTS
 #include "GTestRunner.h"
 #endif
 
 #ifdef MOZ_B2G_LOADER