blob: b662d36805aa50b9e02a2f213501d6ca27c950a4 [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;
Florian Mayerf2474372024-05-31 22:35:25 +000021
22 reserved 3 to 999;
Florian Mayer5fa66632024-02-07 16:42:23 -080023}
24
Josh Gao76e1e302021-01-26 15:53:11 -080025message Tombstone {
26 Architecture arch = 1;
Sijie Chenc8027932024-05-10 18:40:48 +000027 Architecture guest_arch = 24;
Josh Gao76e1e302021-01-26 15:53:11 -080028 string build_fingerprint = 2;
29 string revision = 3;
30 string timestamp = 4;
31
32 uint32 pid = 5;
33 uint32 tid = 6;
34 uint32 uid = 7;
35 string selinux_label = 8;
36
Josh Gao31348a72021-03-29 21:53:42 -070037 repeated string command_line = 9;
Josh Gao76e1e302021-01-26 15:53:11 -080038
Josh Gaodbb83de2021-03-01 23:13:13 -080039 // Process uptime in seconds.
40 uint32 process_uptime = 20;
41
Josh Gao76e1e302021-01-26 15:53:11 -080042 Signal signal_info = 10;
43 string abort_message = 14;
Florian Mayer5fa66632024-02-07 16:42:23 -080044 repeated CrashDetail crash_details = 21;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080045 repeated Cause causes = 15;
Josh Gao76e1e302021-01-26 15:53:11 -080046
47 map<uint32, Thread> threads = 16;
Sijie Chenc8027932024-05-10 18:40:48 +000048 map<uint32, Thread> guest_threads = 25;
Josh Gao76e1e302021-01-26 15:53:11 -080049 repeated MemoryMapping memory_mappings = 17;
50 repeated LogBuffer log_buffers = 18;
51 repeated FD open_fds = 19;
Josh Gaofc4fb212021-02-10 16:59:50 -080052
Devin Moore4647b6b2024-05-03 00:02:24 +000053 uint32 page_size = 22;
54 bool has_been_16kb_mode = 23;
55
Sijie Chenc8027932024-05-10 18:40:48 +000056 reserved 26 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080057}
58
59enum Architecture {
60 ARM32 = 0;
61 ARM64 = 1;
62 X86 = 2;
63 X86_64 = 3;
Liu Cunyuan8c0101b2022-10-12 22:35:51 +080064 RISCV64 = 4;
Sijie Chenc8027932024-05-10 18:40:48 +000065 NONE = 5;
Josh Gaofc4fb212021-02-10 16:59:50 -080066
Sijie Chenc8027932024-05-10 18:40:48 +000067 reserved 6 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080068}
69
70message Signal {
71 int32 number = 1;
72 string name = 2;
73
74 int32 code = 3;
75 string code_name = 4;
76
77 bool has_sender = 5;
78 int32 sender_uid = 6;
79 int32 sender_pid = 7;
80
81 bool has_fault_address = 8;
82 uint64 fault_address = 9;
Mitch Phillips5ddcea22021-04-19 09:59:17 -070083 // Note, may or may not contain the dump of the actual memory contents. Currently, on arm64, we
84 // only include metadata, and not the contents.
85 MemoryDump fault_adjacent_metadata = 10;
Josh Gaofc4fb212021-02-10 16:59:50 -080086
Mitch Phillips5ddcea22021-04-19 09:59:17 -070087 reserved 11 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080088}
89
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080090message HeapObject {
91 uint64 address = 1;
92 uint64 size = 2;
93
94 uint64 allocation_tid = 3;
95 repeated BacktraceFrame allocation_backtrace = 4;
96
97 uint64 deallocation_tid = 5;
98 repeated BacktraceFrame deallocation_backtrace = 6;
99}
100
101message MemoryError {
102 enum Tool {
103 GWP_ASAN = 0;
104 SCUDO = 1;
105
106 reserved 2 to 999;
107 }
108 Tool tool = 1;
109
110 enum Type {
111 UNKNOWN = 0;
112 USE_AFTER_FREE = 1;
113 DOUBLE_FREE = 2;
114 INVALID_FREE = 3;
115 BUFFER_OVERFLOW = 4;
116 BUFFER_UNDERFLOW = 5;
117
118 reserved 6 to 999;
119 }
120 Type type = 2;
121
122 oneof location {
123 HeapObject heap = 3;
124 }
125
126 reserved 4 to 999;
127}
128
Josh Gao76e1e302021-01-26 15:53:11 -0800129message Cause {
130 string human_readable = 1;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800131 oneof details {
132 MemoryError memory_error = 2;
133 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800134
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800135 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800136}
137
138message Register {
139 string name = 1;
140 uint64 u64 = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800141
142 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800143}
144
145message Thread {
146 int32 id = 1;
147 string name = 2;
148 repeated Register registers = 3;
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700149 repeated string backtrace_note = 7;
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700150 repeated string unreadable_elf_files = 9;
Josh Gao76e1e302021-01-26 15:53:11 -0800151 repeated BacktraceFrame current_backtrace = 4;
152 repeated MemoryDump memory_dump = 5;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800153 int64 tagged_addr_ctrl = 6;
Elliott Hughesd13ea522022-01-13 09:20:26 -0800154 int64 pac_enabled_keys = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800155
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700156 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800157}
158
159message BacktraceFrame {
160 uint64 rel_pc = 1;
161 uint64 pc = 2;
162 uint64 sp = 3;
163
164 string function_name = 4;
165 uint64 function_offset = 5;
166
167 string file_name = 6;
168 uint64 file_map_offset = 7;
169 string build_id = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800170
171 reserved 9 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800172}
173
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700174message ArmMTEMetadata {
175 // One memory tag per granule (e.g. every 16 bytes) of regular memory.
176 bytes memory_tags = 1;
177 reserved 2 to 999;
178}
179
Josh Gao76e1e302021-01-26 15:53:11 -0800180message MemoryDump {
181 string register_name = 1;
182 string mapping_name = 2;
183 uint64 begin_address = 3;
184 bytes memory = 4;
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700185 oneof metadata {
186 ArmMTEMetadata arm_mte_metadata = 6;
187 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800188
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700189 reserved 5, 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800190}
191
192message MemoryMapping {
193 uint64 begin_address = 1;
194 uint64 end_address = 2;
195 uint64 offset = 3;
196
197 bool read = 4;
198 bool write = 5;
199 bool execute = 6;
200
201 string mapping_name = 7;
202 string build_id = 8;
203 uint64 load_bias = 9;
Josh Gaofc4fb212021-02-10 16:59:50 -0800204
205 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800206}
207
208message FD {
209 int32 fd = 1;
210 string path = 2;
211 string owner = 3;
212 uint64 tag = 4;
Josh Gaofc4fb212021-02-10 16:59:50 -0800213
214 reserved 5 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800215}
216
217message LogBuffer {
218 string name = 1;
219 repeated LogMessage logs = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800220
221 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800222}
223
224message LogMessage {
225 string timestamp = 1;
226 uint32 pid = 2;
227 uint32 tid = 3;
228 uint32 priority = 4;
229 string tag = 5;
230 string message = 6;
Josh Gaofc4fb212021-02-10 16:59:50 -0800231
232 reserved 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800233}