Android Call stack trace instance analysis _android

Source: Internet
Author: User
Tags stack trace

The example in this article describes the Android call stack trace method. Share to everyone for your reference. Specifically as follows:

Android development, we also often encounter a segment error, that is, SIGSEGV (11), this time libc's backtrace will print out the corresponding stack information, and you see just a pair of numbers, it seems impossible to check.

such as the following from a string fault:

Activitymanager (1105): Displayed activity com.android.browser/. 
browseractivity:2460 MS (total 2460 ms) I/debug (13002): * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * I/debug (13002): Build fingerprint: ' Unknown ' I/debug (13002): pid:20363, tid:20375 >>> com.android.browser <<< I/debug (13002): Signal (SIGSEGV), fault addr ffc00000 i/debug (13002): r0 059fc2a0 R1 4a3bcef8 R2 2A0 R3 4a3bcc58 I/debug (13002): R4 4a3bc101 R5 4ebe0a3c R6 4a3bc120 R7 012fff10 i/debug (13002): R8 500de101 R9 500ee12 D a87dfb20 FP 4ebe58e0 i/debug (13002): IP ffc00000 sp 4ebe0a30 lr 4a3bcc58 pc a862f3a0 CPSR 00000030 i/debug (13002) : D0 0000001100000011 d1 0000001100000011 i/debug (13002): D2 0000001100000011 D3 0000001100000011 I/DEBUG (13002): D4 0 000001100000011 d5 0000001100000011 I/debug (13002): D6 0000001100000011 D7 4060000000000080 I/DEBUG (13002): D8 41d3d17 62e40d70a D9 41d3d1762e440a3d I/debug (13002): D10 0000000000000000 D11 0000000000000000 I/debug (13002): D12 0000000000000000 d13 0000000000000000 i/debug (13002): D14 0000000000000000 D15 0000000000 000000 i/debug (13002) d16 3ff0000000000000 d17 3ff0000000000000 i/debug (13002): D18 40cd268000000000 D19 3F3B9CC1B0BA c000 I/debug (13002): d20 3ff0000000000000 d21 8000000000000000 i/debug (13002): D22 0000000000000000 D23 00000000000000 
I/debug (13002): d24 3ff0000000000000 d25 0000000000000000 i/debug (13002): d26 0000000000000000 d27 0000000000000000 I/debug (13002): D28 0000000000000000 d29 3ff0000000000000 i/debug (13002): D30 0000000000000000 d31 I  /debug (13002): SCR 60000013 i/debug (13002): I/debug (13002): #00 pc 0032f3a0/system/lib/libwebcore.so I/DEBUG (13002): #01 pc 003243b0/system/lib/libwebcore.so I/debug (13002): #02 pc 003167b2/system/lib/libwebcore.so I/D Ebug (13002): #03 pc 0038f2de/system/lib/libwebcore.so I/debug (13002): #04 pc 0038f416/system/lib/libwebcore.    So I/debug (13002): #05 pc 0030d392/system/lib/libwebcore.so I/debug (13002): #06 pc 003796e2/system/lib/libwebcore.so I/DEBUG (13002  ): #07 pc 0038e36a/system/lib/libwebcore.so I/debug (13002): #08 pc 003189f0/system/lib/libwebcore.so I/DEBUG (13002): #09 pc 00377f82/system/lib/libwebcore.so I/debug (13002): #10 pc 0037ae0c/system/lib/libwebcore.so I/D Ebug (13002): #11 pc 0038e254/system/lib/libwebcore.so I/debug (13002): #12 pc 003189f0/system/lib/libwebcore. So I/debug (13002): #13 pc 0031cf2c/system/lib/libwebcore.so I/debug (13002): #14 pc 0038e52a/system/lib/libwe Bcore.so I/debug (13002): #15 pc 0038c2d0/system/lib/libwebcore.so I/debug (13002): #16 pc 0031cf76/system/lib /libwebcore.so I/debug (13002): #17 pc 0038e546/system/lib/libwebcore.so I/debug (13002): #18 pc 003189f0/syst  Em/lib/libwebcore.so I/debug (13002): #19 pc 0031ca40/system/lib/libwebcore.so I/debug (13002): #20 pc 0038e3be /system/lib/libwebcore.So I/debug (13002): #21 pc 0038c2d0/system/lib/libwebcore.so I/debug (13002): #22 pc 0031cf76/system/lib/libwe Bcore.so I/debug (13002): #23 pc 0038e546/system/lib/libwebcore.so I/debug (13002): #24 pc 0038c2d0/system/lib /libwebcore.so I/debug (13002): #25 pc 00379054/system/lib/libwebcore.so I/debug (13002): #26 pc 0031d254/syst  Em/lib/libwebcore.so I/debug (13002): #27 pc 0030d5d6/system/lib/libwebcore.so I/debug (13002): #28 pc 0030d7d2 /system/lib/libwebcore.so I/debug (13002): #29 pc 0031e354/system/lib/libwebcore.so I/debug (13002): #30 pc 00 34ab3c/system/lib/libwebcore.so I/debug (13002): I/debug (13002): Code around Pc:i/debug (13002): a862f380 469e4694 cc04f853 0e04f1a3 510cea4f I/debug (13002): a862f390 f41c0d09 bf080f00 44714249 c008f8d1 I/DEBUG (13002): a862f3a0 e00 0F8DC 0c1ff10e bf0842b8 2d04f853 i/debug (13002): a862f3b0 0d010510 0f00f412 4249bf08 f8c2185a I/DEBUG (13002): a862f3 C0 e006c008 d1042b0c 99019b05 18426818 I/debug (13002): I/debug (13002): Code around Lr:i/debug (13002): 4a3bcc38 e58d0000 e49d0004 e598200b e582002f I/debug (13002): 4a3bcc48 e52d0004 e3100001 0a000018 e3a03030 i/debug (13002): 4a3bcc58 e59fc2a0 e002100c e5 9fc29c e151000c I/debug (13002): 4a3bcc68 0a000012 e59fc294 e002100c e0813003 i/debug (13002): 4a3bcc78 e1a03123 00c e3530b02 ba000004 I/debug (13002): I/debug (13002): Stack:i/debug (13002): 4ebe09f0 50bfd848 (13002) : 4ebe09f4 50bfd858 I/debug (13002): 4ebe09f8, 50bfd834 i/debug (13002): 4EBE09FC afd19a05/system/lib/libc.so I/ DEBUG (13002): 4ebe0a00 50bd3264 i/debug (13002): 4ebe0a04 a86510ef/system/lib/libwebcore.so (13002): 4   Ebe0a08 00000004 I/debug (13002): 4ebe0a0c 50bfd854 (i/debug): 13002 4ebe0a10 [002ece20] Heap (13002): 4ebe0a14 4a3ba000 I/debug (13002): 4ebe0a18 4ebe0a3c (i/debug): 13002 4ebe0a1c (4ebe0a3c): I/debug A20 4a3bc101 I/debug (13002): 4ebe0a24 4ebe0a3c i/debug (13002): 4ebe0a28, df002777 i/debug (13002): 4ebe0a2c E3A070AD i/debug (13002 ): #00 4ebe0a30 002ece20 [heap] I/debug (13002): 4ebe0a34 49f627d0 (i/debug): 13002 4ebe0a38 Ibwebcore.so I/debug (13002): 4ebe0a3c 4a3bd0e7 i/debug (13002): 4ebe0a40 4a3bd0b8 (i/debug): 13002 4a 3BCC58 I/debug (13002): 4ebe0a48 00000003 i/debug (13002): 4ebe0a4c 00000000 (i/debug): 13002 0000110 0 I/debug (13002): 4ebe0a54 0000001f i/debug (13002): 4ebe0a58, 00001074 i/debug (13002): 4ebe0a5c 4ebe0b04 I/ DEBUG (13002): 4ebe0a60 a87d63c0/system/lib/libwebcore.so i/debug (13002): 4ebe0a64 4EBE0ACC (13002): 4 
Ebe0a68 4a3bc101 I/debug (13002): 4ebe0a6c a86243b5/system/lib/libwebcore.so (i/debug): #01 13002 4ebe0a70  
I/debug (13002): 4ebe0a74 00000064 i/debug (13002): 4ebe0a78 003f0914 [Heap] I/debug (13002): 4ebe0a7c fffffc00 I/debug (13002): 4eBE0A80 50bfd834 I/debug (13002): 4ebe0a84, a87d63c0/system/lib/libwebcore.so i/debug (13002): 4ebe0a88 4ebe0b38 I/ DEBUG (13002): 4ebe0a8c 4ebe0b04 i/debug (13002): 4ebe0a90 4EBE0ACC (i/debug): 13002 4ebe0a94 Lib/libwebcore.so

Lib on our board is often strip over, without symbolic information. However, we can obtain the corresponding symbolic information through the library generated at compile time. The compiler also provides us with the appropriate tools: Addr2line Full Name: Arm-eabi-addr2line, can be found in the corresponding board source directory.

Through the above fault analysis, located in system/lib/libwebcore.so This library has a fault, you can pull it down is a row-by-line analysis. Command is: arm-eabi-addr2line-f-e ~/desktop/libwebcore.so 0038f2de

This method of analysis also applies to libraries developed using JNI.

I hope this article will help you with your Android program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.