How to debug tombstone occurring in Android

Source: Internet
Author: User

How to debug tombstone occurring in Android

The following three types of problems are more likely to occur in Android: Force Close/anr/tombstone

The first two are mainly to look at the current process or system framework layer state and stack can be analyzed, this article mainly discusses the situation of Tombstone.

Tombstone is generally caused by Dalvik errors, State monitoring debuggers, C-layer code, and some libc problems.

When the system occurs tombstone, kernel first will report a serious warning signal (signal), the upper layer received, the process of debugging tools will be in the process of the call stack at the scene to save, and the system created a data/ Tombstones directory After the exception of the process information is written in this directory, developers need to use the call stack to analyze the entire call process to find the point of the problem.

Basic tools:

Prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin

Reading the assembly carefully at the time of analysis will get more useful information when the exception occurs.

1.arm-eabi-addr2line translation of Call stack 16 binary values similar to libxxx.so 0x00012345 into filenames and function names

ARM-EABI-ADDR2LINE-E libxxx.so 0x00012345

2.ARM-EABI-NM listing symbol information for a file

Arm-eabi-nm-l-c-n-S libdvm.so > Dvm.data

3.arm-eabi-objdump listing the details of a file

Arm-eabi-objdump-c-D libc.so > Libc.s

Through the analysis of the above tools, we can get a more complete call stack and call logic assembly code.

Then you need to combine the knowledge of ARM architecture with arm compilation (in some cases gdb may be required)

To analyze the causes of tombstone, the following are some of the tombstone I have encountered:

1. Invalid function pointer: null pointer or already re-assigned value

2.strlen crashes: Causes incomplete stack information, stack is destroyed

3.FILE operation: Because the stdio is not thread-safe, it is prone to exceptions when multithreaded operations occur.

The main logic of the tombstone processing involved in this article is the following file:
Bootreceiver.java--Frameworks\base\services\java\com\android\server
DEBUGGERD.C--System\core\debuggerd
Threadlocal.java--Libcore\luni\src\main\java\java\lang

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.