blob: 6f9cd9612507a5a64bc79e56e9e425e711a340ab [file] [log] [blame]
Elliott Hughesdf2e7eb2022-09-12 22:24:18 +00001//
2// Protobuf definition for Android tombstones.
3//
4// An app can get hold of these for any `REASON_CRASH_NATIVE` instance of
5// `android.app.ApplicationExitInfo`.
6//
7// https://developer.android.com/reference/android/app/ApplicationExitInfo#getTraceInputStream()
8//
9
Josh Gao76e1e302021-01-26 15:53:11 -080010syntax = "proto3";
11
Josh Gaod3df0ae2021-02-01 14:35:30 -080012option java_package = "com.android.server.os";
13option java_outer_classname = "TombstoneProtos";
14
Josh Gaofc4fb212021-02-10 16:59:50 -080015// NOTE TO OEMS:
16// If you add custom fields to this proto, do not use numbers in the reserved range.
17
Florian Mayer5fa66632024-02-07 16:42:23 -080018message CrashDetail {
19 bytes name = 1;
20 bytes data = 2;
21}
22
Josh Gao76e1e302021-01-26 15:53:11 -080023message Tombstone {
24 Architecture arch = 1;
Sijie Chenc8027932024-05-10 18:40:48 +000025 Architecture guest_arch = 24;
Josh Gao76e1e302021-01-26 15:53:11 -080026 string build_fingerprint = 2;
27 string revision = 3;
28 string timestamp = 4;
29
30 uint32 pid = 5;
31 uint32 tid = 6;
32 uint32 uid = 7;
33 string selinux_label = 8;
34
Josh Gao31348a72021-03-29 21:53:42 -070035 repeated string command_line = 9;
Josh Gao76e1e302021-01-26 15:53:11 -080036
Josh Gaodbb83de2021-03-01 23:13:13 -080037 // Process uptime in seconds.
38 uint32 process_uptime = 20;
39
Josh Gao76e1e302021-01-26 15:53:11 -080040 Signal signal_info = 10;
41 string abort_message = 14;
Florian Mayer5fa66632024-02-07 16:42:23 -080042 repeated CrashDetail crash_details = 21;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080043 repeated Cause causes = 15;
Josh Gao76e1e302021-01-26 15:53:11 -080044
45 map<uint32, Thread> threads = 16;
Sijie Chenc8027932024-05-10 18:40:48 +000046 map<uint32, Thread> guest_threads = 25;
Josh Gao76e1e302021-01-26 15:53:11 -080047 repeated MemoryMapping memory_mappings = 17;
48 repeated LogBuffer log_buffers = 18;
49 repeated FD open_fds = 19;
Josh Gaofc4fb212021-02-10 16:59:50 -080050
Devin Moore4647b6b2024-05-03 00:02:24 +000051 uint32 page_size = 22;
52 bool has_been_16kb_mode = 23;
53
Sijie Chenc8027932024-05-10 18:40:48 +000054 reserved 26 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080055}
56
57enum Architecture {
58 ARM32 = 0;
59 ARM64 = 1;
60 X86 = 2;
61 X86_64 = 3;
Liu Cunyuan8c0101b2022-10-12 22:35:51 +080062 RISCV64 = 4;
Sijie Chenc8027932024-05-10 18:40:48 +000063 NONE = 5;
Josh Gaofc4fb212021-02-10 16:59:50 -080064
Sijie Chenc8027932024-05-10 18:40:48 +000065 reserved 6 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080066}
67
68message Signal {
69 int32 number = 1;
70 string name = 2;
71
72 int32 code = 3;
73 string code_name = 4;
74
75 bool has_sender = 5;
76 int32 sender_uid = 6;
77 int32 sender_pid = 7;
78
79 bool has_fault_address = 8;
80 uint64 fault_address = 9;
Mitch Phillips5ddcea22021-04-19 09:59:17 -070081 // Note, may or may not contain the dump of the actual memory contents. Currently, on arm64, we
82 // only include metadata, and not the contents.
83 MemoryDump fault_adjacent_metadata = 10;
Josh Gaofc4fb212021-02-10 16:59:50 -080084
Mitch Phillips5ddcea22021-04-19 09:59:17 -070085 reserved 11 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080086}
87
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080088message HeapObject {
89 uint64 address = 1;
90 uint64 size = 2;
91
92 uint64 allocation_tid = 3;
93 repeated BacktraceFrame allocation_backtrace = 4;
94
95 uint64 deallocation_tid = 5;
96 repeated BacktraceFrame deallocation_backtrace = 6;
97}
98
99message MemoryError {
100 enum Tool {
101 GWP_ASAN = 0;
102 SCUDO = 1;
103
104 reserved 2 to 999;
105 }
106 Tool tool = 1;
107
108 enum Type {
109 UNKNOWN = 0;
110 USE_AFTER_FREE = 1;
111 DOUBLE_FREE = 2;
112 INVALID_FREE = 3;
113 BUFFER_OVERFLOW = 4;
114 BUFFER_UNDERFLOW = 5;
115
116 reserved 6 to 999;
117 }
118 Type type = 2;
119
120 oneof location {
121 HeapObject heap = 3;
122 }
123
124 reserved 4 to 999;
125}
126
Josh Gao76e1e302021-01-26 15:53:11 -0800127message Cause {
128 string human_readable = 1;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800129 oneof details {
130 MemoryError memory_error = 2;
131 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800132
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800133 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800134}
135
136message Register {
137 string name = 1;
138 uint64 u64 = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800139
140 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800141}
142
143message Thread {
144 int32 id = 1;
145 string name = 2;
146 repeated Register registers = 3;
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700147 repeated string backtrace_note = 7;
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700148 repeated string unreadable_elf_files = 9;
Josh Gao76e1e302021-01-26 15:53:11 -0800149 repeated BacktraceFrame current_backtrace = 4;
150 repeated MemoryDump memory_dump = 5;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800151 int64 tagged_addr_ctrl = 6;
Elliott Hughesd13ea522022-01-13 09:20:26 -0800152 int64 pac_enabled_keys = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800153
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700154 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800155}
156
157message BacktraceFrame {
158 uint64 rel_pc = 1;
159 uint64 pc = 2;
160 uint64 sp = 3;
161
162 string function_name = 4;
163 uint64 function_offset = 5;
164
165 string file_name = 6;
166 uint64 file_map_offset = 7;
167 string build_id = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800168
169 reserved 9 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800170}
171
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700172message ArmMTEMetadata {
173 // One memory tag per granule (e.g. every 16 bytes) of regular memory.
174 bytes memory_tags = 1;
175 reserved 2 to 999;
176}
177
Josh Gao76e1e302021-01-26 15:53:11 -0800178message MemoryDump {
179 string register_name = 1;
180 string mapping_name = 2;
181 uint64 begin_address = 3;
182 bytes memory = 4;
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700183 oneof metadata {
184 ArmMTEMetadata arm_mte_metadata = 6;
185 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800186
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700187 reserved 5, 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800188}
189
190message MemoryMapping {
191 uint64 begin_address = 1;
192 uint64 end_address = 2;
193 uint64 offset = 3;
194
195 bool read = 4;
196 bool write = 5;
197 bool execute = 6;
198
199 string mapping_name = 7;
200 string build_id = 8;
201 uint64 load_bias = 9;
Josh Gaofc4fb212021-02-10 16:59:50 -0800202
203 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800204}
205
206message FD {
207 int32 fd = 1;
208 string path = 2;
209 string owner = 3;
210 uint64 tag = 4;
Josh Gaofc4fb212021-02-10 16:59:50 -0800211
212 reserved 5 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800213}
214
215message LogBuffer {
216 string name = 1;
217 repeated LogMessage logs = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800218
219 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800220}
221
222message LogMessage {
223 string timestamp = 1;
224 uint32 pid = 2;
225 uint32 tid = 3;
226 uint32 priority = 4;
227 string tag = 5;
228 string message = 6;
Josh Gaofc4fb212021-02-10 16:59:50 -0800229
230 reserved 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800231}