blob: 49865a2bb75f98b907278e04a5cd0e03f1d0c53f [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
Josh Gao76e1e302021-01-26 15:53:11 -080018message Tombstone {
19 Architecture arch = 1;
20 string build_fingerprint = 2;
21 string revision = 3;
22 string timestamp = 4;
23
24 uint32 pid = 5;
25 uint32 tid = 6;
26 uint32 uid = 7;
27 string selinux_label = 8;
28
Josh Gao31348a72021-03-29 21:53:42 -070029 repeated string command_line = 9;
Josh Gao76e1e302021-01-26 15:53:11 -080030
Josh Gaodbb83de2021-03-01 23:13:13 -080031 // Process uptime in seconds.
32 uint32 process_uptime = 20;
33
Josh Gao76e1e302021-01-26 15:53:11 -080034 Signal signal_info = 10;
35 string abort_message = 14;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080036 repeated Cause causes = 15;
Josh Gao76e1e302021-01-26 15:53:11 -080037
38 map<uint32, Thread> threads = 16;
39 repeated MemoryMapping memory_mappings = 17;
40 repeated LogBuffer log_buffers = 18;
41 repeated FD open_fds = 19;
Josh Gaofc4fb212021-02-10 16:59:50 -080042
Josh Gaodbb83de2021-03-01 23:13:13 -080043 reserved 21 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080044}
45
46enum Architecture {
47 ARM32 = 0;
48 ARM64 = 1;
49 X86 = 2;
50 X86_64 = 3;
Liu Cunyuan8c0101b2022-10-12 22:35:51 +080051 RISCV64 = 4;
Josh Gaofc4fb212021-02-10 16:59:50 -080052
Liu Cunyuan8c0101b2022-10-12 22:35:51 +080053 reserved 5 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080054}
55
56message Signal {
57 int32 number = 1;
58 string name = 2;
59
60 int32 code = 3;
61 string code_name = 4;
62
63 bool has_sender = 5;
64 int32 sender_uid = 6;
65 int32 sender_pid = 7;
66
67 bool has_fault_address = 8;
68 uint64 fault_address = 9;
Mitch Phillips5ddcea22021-04-19 09:59:17 -070069 // Note, may or may not contain the dump of the actual memory contents. Currently, on arm64, we
70 // only include metadata, and not the contents.
71 MemoryDump fault_adjacent_metadata = 10;
Josh Gaofc4fb212021-02-10 16:59:50 -080072
Mitch Phillips5ddcea22021-04-19 09:59:17 -070073 reserved 11 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080074}
75
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080076message HeapObject {
77 uint64 address = 1;
78 uint64 size = 2;
79
80 uint64 allocation_tid = 3;
81 repeated BacktraceFrame allocation_backtrace = 4;
82
83 uint64 deallocation_tid = 5;
84 repeated BacktraceFrame deallocation_backtrace = 6;
85}
86
87message MemoryError {
88 enum Tool {
89 GWP_ASAN = 0;
90 SCUDO = 1;
91
92 reserved 2 to 999;
93 }
94 Tool tool = 1;
95
96 enum Type {
97 UNKNOWN = 0;
98 USE_AFTER_FREE = 1;
99 DOUBLE_FREE = 2;
100 INVALID_FREE = 3;
101 BUFFER_OVERFLOW = 4;
102 BUFFER_UNDERFLOW = 5;
103
104 reserved 6 to 999;
105 }
106 Type type = 2;
107
108 oneof location {
109 HeapObject heap = 3;
110 }
111
112 reserved 4 to 999;
113}
114
Josh Gao76e1e302021-01-26 15:53:11 -0800115message Cause {
116 string human_readable = 1;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800117 oneof details {
118 MemoryError memory_error = 2;
119 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800120
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800121 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800122}
123
124message Register {
125 string name = 1;
126 uint64 u64 = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800127
128 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800129}
130
131message Thread {
132 int32 id = 1;
133 string name = 2;
134 repeated Register registers = 3;
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700135 repeated string backtrace_note = 7;
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700136 repeated string unreadable_elf_files = 9;
Josh Gao76e1e302021-01-26 15:53:11 -0800137 repeated BacktraceFrame current_backtrace = 4;
138 repeated MemoryDump memory_dump = 5;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800139 int64 tagged_addr_ctrl = 6;
Elliott Hughesd13ea522022-01-13 09:20:26 -0800140 int64 pac_enabled_keys = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800141
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700142 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800143}
144
145message BacktraceFrame {
146 uint64 rel_pc = 1;
147 uint64 pc = 2;
148 uint64 sp = 3;
149
150 string function_name = 4;
151 uint64 function_offset = 5;
152
153 string file_name = 6;
154 uint64 file_map_offset = 7;
155 string build_id = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800156
157 reserved 9 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800158}
159
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700160message ArmMTEMetadata {
161 // One memory tag per granule (e.g. every 16 bytes) of regular memory.
162 bytes memory_tags = 1;
163 reserved 2 to 999;
164}
165
Josh Gao76e1e302021-01-26 15:53:11 -0800166message MemoryDump {
167 string register_name = 1;
168 string mapping_name = 2;
169 uint64 begin_address = 3;
170 bytes memory = 4;
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700171 oneof metadata {
172 ArmMTEMetadata arm_mte_metadata = 6;
173 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800174
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700175 reserved 5, 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800176}
177
178message MemoryMapping {
179 uint64 begin_address = 1;
180 uint64 end_address = 2;
181 uint64 offset = 3;
182
183 bool read = 4;
184 bool write = 5;
185 bool execute = 6;
186
187 string mapping_name = 7;
188 string build_id = 8;
189 uint64 load_bias = 9;
Josh Gaofc4fb212021-02-10 16:59:50 -0800190
191 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800192}
193
194message FD {
195 int32 fd = 1;
196 string path = 2;
197 string owner = 3;
198 uint64 tag = 4;
Josh Gaofc4fb212021-02-10 16:59:50 -0800199
200 reserved 5 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800201}
202
203message LogBuffer {
204 string name = 1;
205 repeated LogMessage logs = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800206
207 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800208}
209
210message LogMessage {
211 string timestamp = 1;
212 uint32 pid = 2;
213 uint32 tid = 3;
214 uint32 priority = 4;
215 string tag = 5;
216 string message = 6;
Josh Gaofc4fb212021-02-10 16:59:50 -0800217
218 reserved 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800219}