Bug 824224: Make mozalloc_abort() not MOZ_NORETURN and log errors to logcat. r=glandium
authorChris Jones <jones.chris.g@gmail.com>
Fri, 04 Jan 2013 13:28:37 -0800
changeset 126779 496d7707ded1946539caabf2b60539e1325b242d
parent 126778 4fd475c2a94ad084162fd6ea82a95c3796fc8dbe
child 126780 5a7b468178a28e1bd2b761f8781414f9b7c0c940
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs824224
milestone20.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 824224: Make mozalloc_abort() not MOZ_NORETURN and log errors to logcat. r=glandium
memory/mozalloc/mozalloc_abort.cpp
memory/mozalloc/mozalloc_abort.h
--- a/memory/mozalloc/mozalloc_abort.cpp
+++ b/memory/mozalloc/mozalloc_abort.cpp
@@ -4,27 +4,34 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #if defined(XP_WIN) || defined(XP_OS2)
 #  define MOZALLOC_EXPORT __declspec(dllexport)
 #endif
 
-#include "mozilla/Assertions.h"
+#include "mozilla/mozalloc_abort.h"
 
+#ifdef ANDROID
+# include <android/log.h>
+#endif
 #include <stdio.h>
 
-#include "mozilla/mozalloc_abort.h"
+#include "mozilla/Assertions.h"
 
 void
 mozalloc_abort(const char* const msg)
 {
+#ifndef ANDROID
     fputs(msg, stderr);
     fputs("\n", stderr);
+#else
+    __android_log_print(ANDROID_LOG_ERROR, "Gecko", "mozalloc_abort: %s", msg);
+#endif
     MOZ_CRASH();
 }
 
 #if defined(XP_UNIX)
 // Define abort() here, so that it is used instead of the system abort(). This
 // lets us control the behavior when aborting, in order to get better results
 // on *NIX platforms. See mozalloc_abort for details.
 void abort(void)
--- a/memory/mozalloc/mozalloc_abort.h
+++ b/memory/mozalloc/mozalloc_abort.h
@@ -22,12 +22,12 @@
 #else
 #  define MOZALLOC_EXPORT
 #endif
 
 /**
  * Terminate this process in such a way that breakpad is triggered, if
  * at all possible.
  */
-MOZ_NORETURN MOZALLOC_EXPORT void mozalloc_abort(const char* const msg);
+MOZALLOC_EXPORT void mozalloc_abort(const char* const msg);
 
 
 #endif  /* ifndef mozilla_mozalloc_abort_h */