Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default tombstones location in android

I am writing an app to capture tombstones logs.

How to get the default location of tombstones logs in any Android device? Even if the tombstones logs are not available yet, where do they get stored when any crash or something happen? AFAIK these logs get saved in '/data/tombstones/' but is this path universal across all devices? Do I need to read some property from "adb shell getprop" etc in the code dynamically?

like image 383
darthvading Avatar asked Jan 23 '15 07:01

darthvading


3 Answers

If you haven't rooted you device, you should use bugreport adb command:

adb bugreport ./bugreport.zip

Inside the zip you will have everything you need to analyse.

In order to disassembly the tombstone:

  1. get the AOSP source code and follow the instructions of the https://source.android.com/setup/start until the lunch command.

  2. Run the command (replace tombstone_01 by the interest file):

disassemble_tombstone.py ./bugreport/FS/data/tombstones/tombstone_01

More tools do debug the bugreport.zip in https://source.android.com/devices/tech/debug

like image 64
André Berenguel Avatar answered Sep 19 '22 12:09

André Berenguel


You may run below command at "/" directory from "adb shell" to locate tombstones location for a specific device.

find . |grep tombs
like image 22
AADProgramming Avatar answered Sep 19 '22 12:09

AADProgramming


Not to say this can't change in the future (and of course, being open source any vendor could modify this if they choose), but tombstone files are written by debuggerd in the engrave_tombstone() function implemented in tombstone.cpp (formerly tombstone.c):

  • https://android.googlesource.com/platform/system/core/+/master/debuggerd/tombstone.cpp

This uses a hardcoded path using the macro:

#define TOMBSTONE_DIR "/data/tombstones"

Even the Java side of Android uses the hardcoded path:

  • https://android.googlesource.com/platform/frameworks/base/+/master/core/java/com/android/server/BootReceiver.java

And it appears that using /data/tombstones goes at least back to Android 1.6 Donut's debuggerd

like image 38
Michael Burr Avatar answered Sep 18 '22 12:09

Michael Burr