All Projects → SummerOak → Crashsdk

SummerOak / Crashsdk

Licence: gpl-2.0
catch crash on Android(arm/x86)

Projects that are alternatives of or similar to Crashsdk

Bugsnag Android
Bugsnag crash monitoring and reporting tool for Android apps
Stars: ✭ 990 (+825.23%)
Mutual labels:  ndk, crash
Android Luajit Launcher
Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
Stars: ✭ 87 (-18.69%)
Mutual labels:  ndk
Crashanalyse
iOS crash log analyse,One click to complete.
Stars: ✭ 34 (-68.22%)
Mutual labels:  crash
Androidlearn
Android Custom Views
Stars: ✭ 66 (-38.32%)
Mutual labels:  ndk
Lldebugtoolswift
LLDebugTool is a debugging tool for developers and testers that can help you analyze and manipulate data in non-xcode situations.
Stars: ✭ 40 (-62.62%)
Mutual labels:  crash
Anti Debug
Android detect debugger
Stars: ✭ 68 (-36.45%)
Mutual labels:  ndk
Android Demo
Hipacc demo project for Renderscript and Filterscript
Stars: ✭ 7 (-93.46%)
Mutual labels:  ndk
Crashreporter
Lightweight macOS Crash Reporter Setup
Stars: ✭ 100 (-6.54%)
Mutual labels:  crash
Csgo Crash Exploit
Allows you to crash any Windows user
Stars: ✭ 87 (-18.69%)
Mutual labels:  crash
Deepc
Suite of Deep compositing tools for Foundry's Nuke.
Stars: ✭ 56 (-47.66%)
Mutual labels:  ndk
Android Hpe
Android native application to perform head pose estimation using images coming from the front camera.
Stars: ✭ 46 (-57.01%)
Mutual labels:  ndk
Vab
V Android Bootstrapper
Stars: ✭ 77 (-28.04%)
Mutual labels:  ndk
Sentry React Native
Official Sentry SDK for react-native
Stars: ✭ 1,032 (+864.49%)
Mutual labels:  crash
Anyndk
🔥 Android native library, make your development faster and easier. Android各种native库,让你的开发更快更简单
Stars: ✭ 35 (-67.29%)
Mutual labels:  ndk
Ndcrash
A powerful crash reporting library for Android NDK. Don't forget to run git submodule update --init --recursive after checking out.
Stars: ✭ 91 (-14.95%)
Mutual labels:  ndk
Planb Android
A crash recovery library for Android. It allows tracking and handling crashes with different rules for debugging and production.
Stars: ✭ 29 (-72.9%)
Mutual labels:  crash
Bugsnag Python
Official bugsnag error monitoring and error reporting for django, flask, tornado and other python apps.
Stars: ✭ 69 (-35.51%)
Mutual labels:  crash
Androiddevwithcpp
Android Develop With C++
Stars: ✭ 106 (-0.93%)
Mutual labels:  ndk
Termux Ndk
android-ndk for termux
Stars: ✭ 91 (-14.95%)
Mutual labels:  ndk
Jjexception
Protect the objective-c application(保护App不闪退)
Stars: ✭ 1,216 (+1036.45%)
Mutual labels:  crash

What it for

Catch crashes in Java & Native(arm/x86), and dump crash information to a file located in sdcard, crash information includes call stack, system version, architecture, and registers state for native crash, etc.

Structure of this project

This is an Android project created via Android Studio, the module 'crashsdk' is an aar library used by the demo app;

The c++ part in the crashsdk is not configured in gradle, so you need build it manually, go to jni directory and type 'ndk-build' to build the target native libs.

Implementation

  1. For crash in Java, we use Thread#setDefaultUncaughtExceptionHandler to handle it;

  2. For crash in Native, we need a signal handler to get a chance to handle signals such as SIGSEGV; In the handle, we unwind the call stack and dump infomation we interest. Since we are doing these in a signal handler, we should take signal safety into consideration.

Unwind Native Call Stack

When gcc generates code that handles exceptions, it produces tables that describe how to unwind the stack. These tables are found in the .eh_frame section; Read https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-Embedded/LSB-Embedded/ehframechpt.html for details of .eh_frame format. The definition of Call Frame Instructions in FDE can be found in DWARF(Debugging With Attributed Record Formats) specification , you can find it here: http://dwarfstd.org

The process of unwinding can be describe as below:

  1. Get IP(instruction pointer) where the program crashed(by parsing the third parameter of sa_handler callback);
  2. Find the target library in which the crash address located;
  3. Parse .eh_frame segment in the library and find the corresponding FDE, restore this call frame with instructions described in CIE&FDE;
  4. After restoring call frame we can find out the return address and CFA(call frame address) of previous call frame;
  5. With the return address and CFA we can unwind the previous call frame and repeat it until reach the root call frame ( (where the CFA&IP no more change);

In step 1, we may get a wrong crash IP if the crash is caused by wrong instruction pointer. In this case we need try to unwind this frame by calling convention;

Unfortunately, .eh_frame section not always exist, for ARM, a section .ARM.exidx exist and it is similar to .eh_frame. So, if unwind with eh_frame failed we can try .ARM.exidx; For more information of EXIDX , look here: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].