Created attachment 612953 [details] [diff] [review]
Android's stdio and stderr are directed to /dev/null. On Android, log MOZ_Assert message to adb logcat instead of fprintf(stderr).
Created attachment 612955 [details] [diff] [review]
On Android, segfault in MOZ_Crash because raise(SIGABRT) is handled asynchronously.
When MOZ_Crash raises SIGABRT, the process does not die immediately. MOZ_Crash returns and the thread continues running. When all threads in the process receives a SIBABRT, the current thread's call stack will not point to MOZ_Crash.
If we segfault in MOZ_Crash, we crash immediately and capture the current call stack pointing to MOZ_Crash. Android's dalvikvm and abort() segfault for the same reasons.