Bug 743306 - Part 2: On Android, segfault in MOZ_Crash because SIGABRT is handled asynchronously. r=glandium
authorChris Peterson <cpeterson@mozilla.com>
Mon, 09 Apr 2012 12:45:25 -0700
changeset 94577 42870fe1a4a34183768b7f1a186872b4592ec2b3
parent 94576 8a7965116a330f482644390ad5477d85d9fc85e4
child 94578 308fedc536c1675a4dbe1404d14e5c037ed982a5
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs743306
milestone14.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 743306 - Part 2: On Android, segfault in MOZ_Crash because SIGABRT is handled asynchronously. r=glandium
mfbt/Assertions.cpp
--- a/mfbt/Assertions.cpp
+++ b/mfbt/Assertions.cpp
@@ -67,16 +67,23 @@ MOZ_Crash()
 
 #if defined(WIN32)
   /*
    * We used to call DebugBreak() on Windows, but amazingly, it causes
    * the MSVS 2010 debugger not to be able to recover a call stack.
    */
   *((volatile int *) NULL) = 123;
   exit(3);
+#elif defined(ANDROID)
+  /*
+   * On Android, raise(SIGABRT) is handled asynchronously. Seg fault now
+   * so we crash immediately and capture the current call stack.
+   */
+  *((volatile int *) NULL) = 123;
+  abort();
 #elif defined(__APPLE__)
   /*
    * On Mac OS X, Breakpad ignores signals. Only real Mach exceptions are
    * trapped.
    */
   *((volatile int *) NULL) = 123;  /* To continue from here in GDB: "return" then "continue". */
   raise(SIGABRT);  /* In case above statement gets nixed by the optimizer. */
 #else