aboutsummaryrefslogtreecommitdiff
path: root/en/devices/tech/debug/native-crash.html
diff options
context:
space:
mode:
Diffstat (limited to 'en/devices/tech/debug/native-crash.html')
-rw-r--r--en/devices/tech/debug/native-crash.html59
1 files changed, 31 insertions, 28 deletions
diff --git a/en/devices/tech/debug/native-crash.html b/en/devices/tech/debug/native-crash.html
index 00f72cd0..686af070 100644
--- a/en/devices/tech/debug/native-crash.html
+++ b/en/devices/tech/debug/native-crash.html
@@ -49,15 +49,40 @@ plus SIGABRT are the things to look for in the <code>debuggerd</code> output to
recognize this case.</p>
<p>
-As mentioned above, there may be an explicit "abort message" line. But you
+As mentioned above, there may be an explicit "abort message" line. You
should also look in the <code>logcat</code> output to see what this thread logged before
-deliberately killing itself, because the basic abort primitive doesn't accept a
-message.
+deliberately killing itself, because unlike assert(3) or high level fatal logging
+facilities, abort(3) doesn't accept a message.
</p>
+
+<p>
+Current versions of Android inline the <code><a
+href="http://man7.org/linux/man-pages/man2/tgkill.2.html">tgkill(2)</a></code>
+system call, so their stacks are the easiest to read, with the call to abort(3)
+at the very top:
+</p>
+<pre class="devsite-click-to-copy">
+pid: 4637, tid: 4637, name: crasher >>> crasher <<<
+signal 6 (<i style="color:Orange">SIGABRT</i>), code -6 (SI_TKILL), fault addr --------
+<i style="color:Orange">Abort message</i>: 'some_file.c:123: some_function: assertion "false" failed'
+ r0 00000000 r1 0000121d r2 00000006 r3 00000008
+ r4 0000121d r5 0000121d r6 ffb44a1c r7 0000010c
+ r8 00000000 r9 00000000 r10 00000000 r11 00000000
+ ip ffb44c20 sp ffb44a08 lr eace2b0b pc eace2b16
+backtrace:
+ #00 pc 0001cb16 /system/lib/<i style="color:Orange">libc.so</i> (<i style="color:Orange">abort</i>+57)
+ #01 pc 0001cd8f /system/lib/libc.so (__assert2+22)
+ #02 pc 00001531 /system/bin/crasher (do_action+764)
+ #03 pc 00002301 /system/bin/crasher (main+68)
+ #04 pc 0008a809 /system/lib/libc.so (__libc_init+48)
+ #05 pc 00001097 /system/bin/crasher (_start_main+38)
+</pre>
+
<p>
-Older versions of Android (especially on 32-bit ARM) followed a convoluted path
-between the original abort call (frame 4 here) and the actual sending of the
-signal (frame 0 here):
+Older versions of Android followed a convoluted path between the original abort call (frame 4 here)
+and the actual sending of the signal (frame 0 here). This was especially true on 32-bit ARM,
+which added <code>__libc_android_abort</code> (frame 3 here) to the other platforms' sequence of
+<code>raise</code>/<code>pthread_kill</code>/<code>tgkill</code>:
</p>
<pre class="devsite-click-to-copy">
pid: 1656, tid: 1656, name: crasher >>> crasher <<<
@@ -80,28 +105,6 @@ backtrace:
#09 pc 00000abc /system/xbin/crasher
</pre>
<p>
-More recent versions call <code><a
-href="http://man7.org/linux/man-pages/man2/tgkill.2.html">tgkill(2)</a></code>
-directly from <code>abort</code>, so there are fewer stack frames for you to
-skip over before you get to the interesting frames:</p>
-
-<pre class="devsite-click-to-copy">
-pid: 25301, tid: 25301, name: crasher >>> crasher <<<
-signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
- r0 00000000 r1 000062d5 r2 00000006 r3 00000008
- r4 ffa09dd8 r5 000062d5 r6 000062d5 r7 0000010c
- r8 00000000 r9 00000000 sl 00000000 fp ffa09f0c
- ip 00000000 sp ffa09dc8 lr eac63ce3 pc eac93f0c cpsr 000d0010
-backtrace:
- #00 pc 00049f0c /system/lib/libc.so (tgkill+12)
- #01 pc 00019cdf /system/lib/libc.so (abort+50)
- #02 pc 000012db /system/xbin/crasher (maybe_abort+26)
- #03 pc 000015b7 /system/xbin/crasher (do_action+414)
- #04 pc 000020d5 /system/xbin/crasher (main+100)
- #05 pc 000177a1 /system/lib/libc.so (__libc_init+48)
- #06 pc 000010e4 /system/xbin/crasher (_start+96)
-</pre>
-<p>
You can reproduce an instance of this type of crash using: <code>crasher
abort</code>
</p>