Default tombstones location in android

16,429

Solution 1

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):

This uses a hardcoded path using the macro:

#define TOMBSTONE_DIR "/data/tombstones"

Even the Java side of Android uses the hardcoded path:

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

Solution 2

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

Solution 3

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

find . |grep tombs
Share:
16,429
darthvading
Author by

darthvading

Code Read > code written > code written in meetings

Updated on August 15, 2022

Comments

  • darthvading
    darthvading over 1 year

    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?

  • Eugen Pechanec
    Eugen Pechanec about 6 years
    Hi, can you list some other variants you've encountered?