Native_crash

Updated at: 2022-02-28 08:42

Problem description

Native crash refers to a case where a process exits because a Linux error signal is generated from a C or C++ error. You can use the logcat of the system to analyze crash logs.

Solution

A process exits when a C or C++ error occurs and the system generates a Linux error signal. We recommend that you use the ndk-stack tool for analysis and troubleshooting.

In Android development, crash logs can be caught at the Java layer, but crash logs at the native layer cannot be directly obtained. The logcat of the system can be used to analyze crash logs. We recommend that you use the NDK tool ndk-stack for analysis and troubleshooting.

  1. Download the latest version of NDK. The ndk-stack tool is in the NDK home directory.

  2. Find the test that has a native crash in the Mobile Testing module and download the log entries.

  3. Find the CPU information ro.product.cpu.abi based on the failed model. For example, the CPU type of Samsung N7100 is armeabi-v7a.The CPU type of all simulators in the Mobile Testing module is x86_64.

  4. Run the following command in the ndk-stack tool to locate the error:

    $NDK/ndk-stack -sym $PROJECT_PATH/obj/local/$cpu.abi -dump $LOGCAT_PATH

    The following command is used in this example:

    ndk-stack -sym ./workspace2/testNdkStack/obj/local/armeabi-v7a/ -dump ./logcat.log > result.log

    By analyzing the result log, you can check the code file and locate the specific row in which the crash appears.

  • On this page (T)
  • Problem description
  • Solution
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare