Last Comment Bug 743306 - Fix MOZ_Assert and MOZ_Crash for Android
: Fix MOZ_Assert and MOZ_Crash for Android
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: MFBT (show other bugs)
: Trunk
: ARM Android
: -- normal (vote)
: mozilla14
Assigned To: Chris Peterson [:cpeterson]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-06 11:31 PDT by Chris Peterson [:cpeterson]
Modified: 2012-04-10 08:34 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
bug-743306-part-1-MOZ_Assert-logcat.patch (1.18 KB, patch)
2012-04-06 11:35 PDT, Chris Peterson [:cpeterson]
mh+mozilla: review+
Details | Diff | Splinter Review
bug-743306-part-2-MOZ_Crash-segfault.patch (1.17 KB, patch)
2012-04-06 11:36 PDT, Chris Peterson [:cpeterson]
mh+mozilla: review+
Details | Diff | Splinter Review

Description Chris Peterson [:cpeterson] 2012-04-06 11:31:51 PDT

    
Comment 1 Chris Peterson [:cpeterson] 2012-04-06 11:35:01 PDT
Created attachment 612953 [details] [diff] [review]
bug-743306-part-1-MOZ_Assert-logcat.patch

Android's stdio and stderr are directed to /dev/null. On Android, log MOZ_Assert message to adb logcat instead of fprintf(stderr).
Comment 2 Chris Peterson [:cpeterson] 2012-04-06 11:36:58 PDT
Created attachment 612955 [details] [diff] [review]
bug-743306-part-2-MOZ_Crash-segfault.patch

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.

Note You need to log in before you can comment on or make changes to this bug.