Bug 1507049 - Rename MOZ_CrashOOL MOZ_Crash. r=froydnj
authorChris Peterson <cpeterson@mozilla.com>
Sun, 03 Feb 2019 00:00:12 -0800
changeset 458216 70d80c4a3fa0b6a383298766f658e4a95ce15e99
parent 458215 57b1f35d3f9c57f372c54a0f26c3f8c57a781b96
child 458217 426f2e129858941cd1e19aab3695659c728af9e5
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1507049
milestone67.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 1507049 - Rename MOZ_CrashOOL MOZ_Crash. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D18513
js/src/devtools/rootAnalysis/analyzeHeapWrites.js
mfbt/Assertions.cpp
mfbt/Assertions.h
toolkit/library/rust/shared/lib.rs
toolkit/xre/nsAppRunner.cpp
--- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
+++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
@@ -419,18 +419,18 @@ function ignoreCallEdge(entry, callee)
 
 function ignoreContents(entry)
 {
     var whitelist = [
         // We don't care what happens when we're about to crash.
         "abort",
         /MOZ_ReportAssertionFailure/,
         /MOZ_ReportCrash/,
+        /MOZ_Crash/,
         /MOZ_CrashPrintf/,
-        /MOZ_CrashOOL/,
         /AnnotateMozCrashReason/,
         /InvalidArrayIndex_CRASH/,
         /NS_ABORT_OOM/,
 
         // These ought to be threadsafe.
         "NS_DebugBreak",
         /mozalloc_handle_oom/,
         /^NS_Log/, /log_print/, /LazyLogModule::operator/,
--- a/mfbt/Assertions.cpp
+++ b/mfbt/Assertions.cpp
@@ -45,15 +45,15 @@ MOZ_FORMAT_PRINTF(3, 4) void MOZ_CrashPr
   va_start(aArgs, aFormat);
   int ret =
       vsnprintf(sPrintfCrashReason, sPrintfCrashReasonSize, aFormat, aArgs);
   va_end(aArgs);
   MOZ_RELEASE_ASSERT(
       ret >= 0 && size_t(ret) < sPrintfCrashReasonSize,
       "Could not write the explanation string to the supplied buffer!");
 #ifdef DEBUG
-  MOZ_CrashOOL(aFilename, aLine, sPrintfCrashReason);
+  MOZ_Crash(aFilename, aLine, sPrintfCrashReason);
 #else
-  MOZ_CrashOOL(nullptr, aLine, sPrintfCrashReason);
+  MOZ_Crash(nullptr, aLine, sPrintfCrashReason);
 #endif
 }
 
 MOZ_END_EXTERN_C
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -299,26 +299,26 @@ MOZ_NoReturn(int aLine) {
  * arbitrary strings from a potentially compromised process is not without risk.
  * If the string being passed is the result of a printf-style function,
  * consider using MOZ_CRASH_UNSAFE_PRINTF instead.
  *
  * @note This macro causes data collection because crash strings are annotated
  * to crash-stats and are publicly visible. Firefox data stewards must do data
  * review on usages of this macro.
  */
-static inline MOZ_COLD MOZ_NORETURN void MOZ_CrashOOL(const char* aFilename,
-                                                      int aLine,
-                                                      const char* aReason) {
+static inline MOZ_COLD MOZ_NORETURN void MOZ_Crash(const char* aFilename,
+                                                   int aLine,
+                                                   const char* aReason) {
 #ifdef DEBUG
   MOZ_ReportCrash(aReason, aFilename, aLine);
 #endif
   MOZ_CRASH_ANNOTATE(aReason);
   MOZ_REALLY_CRASH(aLine);
 }
-#define MOZ_CRASH_UNSAFE_OOL(reason) MOZ_CrashOOL(__FILE__, __LINE__, reason)
+#define MOZ_CRASH_UNSAFE_OOL(reason) MOZ_Crash(__FILE__, __LINE__, reason)
 
 static const size_t sPrintfMaxArgs = 4;
 static const size_t sPrintfCrashReasonSize = 1024;
 
 #ifndef DEBUG
 MFBT_API MOZ_COLD MOZ_NORETURN MOZ_NEVER_INLINE MOZ_FORMAT_PRINTF(
     2, 3) void MOZ_CrashPrintf(int aLine, const char* aFormat, ...);
 #  define MOZ_CALL_CRASH_PRINTF(format, ...) \
--- a/toolkit/library/rust/shared/lib.rs
+++ b/toolkit/library/rust/shared/lib.rs
@@ -150,17 +150,17 @@ pub extern "C" fn GkRust_Shutdown() {
 
 /// Used to implement `nsIDebug2::RustPanic` for testing purposes.
 #[no_mangle]
 pub extern "C" fn intentional_panic(message: *const c_char) {
     panic!("{}", unsafe { CStr::from_ptr(message) }.to_string_lossy());
 }
 
 extern "C" {
-    // We can't use MOZ_CrashOOL directly because it may be weakly linked
+    // We can't use MOZ_Crash directly because it may be weakly linked
     // to libxul, and rust can't handle that.
     fn GeckoCrashOOL(filename: *const c_char, line: c_int, reason: *const c_char) -> !;
 }
 
 /// Truncate a string at the closest unicode character boundary
 /// ```
 /// assert_eq!(str_truncate_valid("éà", 3), "é");
 /// assert_eq!(str_truncate_valid("éà", 4), "éè");
@@ -230,17 +230,17 @@ fn panic_hook(info: &panic::PanicInfo) {
     let message = ArrayCString::<[_; 512]>::from(message);
     let filename = ArrayCString::<[_; 512]>::from(filename);
     unsafe {
         GeckoCrashOOL(filename.as_ptr() as *const c_char, line as c_int,
                       message.as_ptr() as *const c_char);
     }
 }
 
-/// Configure a panic hook to redirect rust panics to Gecko's MOZ_CrashOOL.
+/// Configure a panic hook to redirect rust panics to Gecko's MOZ_Crash.
 #[no_mangle]
 pub extern "C" fn install_rust_panic_hook() {
     panic::set_hook(Box::new(panic_hook));
 }
 
 #[cfg(feature = "oom_with_hook")]
 mod oom_hook {
     use std::alloc::{Layout, set_alloc_error_hook};
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -5188,20 +5188,20 @@ void XRE_EnableSameExecutableForContentP
     mozilla::ipc::GeckoChildProcessHost::EnableSameExecutableForContentProc();
   }
 }
 
 // Because rust doesn't handle weak symbols, this function wraps the weak
 // malloc_handle_oom for it.
 extern "C" void GeckoHandleOOM(size_t size) { mozalloc_handle_oom(size); }
 
-// Similarly, this wraps MOZ_CrashOOL
+// Similarly, this wraps MOZ_Crash
 extern "C" void GeckoCrashOOL(const char* aFilename, int aLine,
                               const char* aReason) {
-  MOZ_CrashOOL(aFilename, aLine, aReason);
+  MOZ_Crash(aFilename, aLine, aReason);
 }
 
 // From toolkit/library/rust/shared/lib.rs
 extern "C" void install_rust_panic_hook();
 extern "C" void install_rust_oom_hook();
 
 struct InstallRustHooks {
   InstallRustHooks() {