Default tombstones location in android
Asked Answered
A

4

15

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?

Aschim answered 23/1, 2015 at 7:35 Comment(0)
H
10

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

Hopeh answered 23/1, 2015 at 8:1 Comment(0)
G
14

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

Glomerulus answered 7/4, 2021 at 10:52 Comment(1)
Also, if the device is Android < 7.0, only a plaintext bug report dump is available, so your first command would become something like adb bugreport > ./bugreport.txtTantalate
H
10

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

Hopeh answered 23/1, 2015 at 8:1 Comment(0)
E
4

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

find . |grep tombs
Enwind answered 23/1, 2015 at 7:42 Comment(0)
B
-3

The path is NOT universal, in fact that isn't one I've seen in a long time. Generally when a tombstone occurs you get a line in logcat saying where the logs are. Otherwise you need to poke around.

Backcourt answered 23/1, 2015 at 7:40 Comment(1)
Hi, can you list some other variants you've encountered?Effervesce

© 2022 - 2024 — McMap. All rights reserved.