blob: e70d525ee914c2617d233940268a5a93e293b371 [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;
25 string build_fingerprint = 2;
26 string revision = 3;
27 string timestamp = 4;
28
29 uint32 pid = 5;
30 uint32 tid = 6;
31 uint32 uid = 7;
32 string selinux_label = 8;
33
Josh Gao31348a72021-03-29 21:53:42 -070034 repeated string command_line = 9;
Josh Gao76e1e302021-01-26 15:53:11 -080035
Josh Gaodbb83de2021-03-01 23:13:13 -080036 // Process uptime in seconds.
37 uint32 process_uptime = 20;
38
Josh Gao76e1e302021-01-26 15:53:11 -080039 Signal signal_info = 10;
40 string abort_message = 14;
Florian Mayer5fa66632024-02-07 16:42:23 -080041 repeated CrashDetail crash_details = 21;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080042 repeated Cause causes = 15;
Josh Gao76e1e302021-01-26 15:53:11 -080043
44 map<uint32, Thread> threads = 16;
45 repeated MemoryMapping memory_mappings = 17;
46 repeated LogBuffer log_buffers = 18;
47 repeated FD open_fds = 19;
Josh Gaofc4fb212021-02-10 16:59:50 -080048
Devin Moore4647b6b2024-05-03 00:02:24 +000049 uint32 page_size = 22;
50 bool has_been_16kb_mode = 23;
51
52 reserved 24 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080053}
54
55enum Architecture {
56 ARM32 = 0;
57 ARM64 = 1;
58 X86 = 2;
59 X86_64 = 3;
Liu Cunyuan8c0101b2022-10-12 22:35:51 +080060 RISCV64 = 4;
Josh Gaofc4fb212021-02-10 16:59:50 -080061
Liu Cunyuan8c0101b2022-10-12 22:35:51 +080062 reserved 5 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080063}
64
65message Signal {
66 int32 number = 1;
67 string name = 2;
68
69 int32 code = 3;
70 string code_name = 4;
71
72 bool has_sender = 5;
73 int32 sender_uid = 6;
74 int32 sender_pid = 7;
75
76 bool has_fault_address = 8;
77 uint64 fault_address = 9;
Mitch Phillips5ddcea22021-04-19 09:59:17 -070078 // Note, may or may not contain the dump of the actual memory contents. Currently, on arm64, we
79 // only include metadata, and not the contents.
80 MemoryDump fault_adjacent_metadata = 10;
Josh Gaofc4fb212021-02-10 16:59:50 -080081
Mitch Phillips5ddcea22021-04-19 09:59:17 -070082 reserved 11 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080083}
84
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080085message HeapObject {
86 uint64 address = 1;
87 uint64 size = 2;
88
89 uint64 allocation_tid = 3;
90 repeated BacktraceFrame allocation_backtrace = 4;
91
92 uint64 deallocation_tid = 5;
93 repeated BacktraceFrame deallocation_backtrace = 6;
94}
95
96message MemoryError {
97 enum Tool {
98 GWP_ASAN = 0;
99 SCUDO = 1;
100
101 reserved 2 to 999;
102 }
103 Tool tool = 1;
104
105 enum Type {
106 UNKNOWN = 0;
107 USE_AFTER_FREE = 1;
108 DOUBLE_FREE = 2;
109 INVALID_FREE = 3;
110 BUFFER_OVERFLOW = 4;
111 BUFFER_UNDERFLOW = 5;
112
113 reserved 6 to 999;
114 }
115 Type type = 2;
116
117 oneof location {
118 HeapObject heap = 3;
119 }
120
121 reserved 4 to 999;
122}
123
Josh Gao76e1e302021-01-26 15:53:11 -0800124message Cause {
125 string human_readable = 1;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800126 oneof details {
127 MemoryError memory_error = 2;
128 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800129
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800130 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800131}
132
133message Register {
134 string name = 1;
135 uint64 u64 = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800136
137 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800138}
139
140message Thread {
141 int32 id = 1;
142 string name = 2;
143 repeated Register registers = 3;
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700144 repeated string backtrace_note = 7;
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700145 repeated string unreadable_elf_files = 9;
Josh Gao76e1e302021-01-26 15:53:11 -0800146 repeated BacktraceFrame current_backtrace = 4;
147 repeated MemoryDump memory_dump = 5;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800148 int64 tagged_addr_ctrl = 6;
Elliott Hughesd13ea522022-01-13 09:20:26 -0800149 int64 pac_enabled_keys = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800150
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700151 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800152}
153
154message BacktraceFrame {
155 uint64 rel_pc = 1;
156 uint64 pc = 2;
157 uint64 sp = 3;
158
159 string function_name = 4;
160 uint64 function_offset = 5;
161
162 string file_name = 6;
163 uint64 file_map_offset = 7;
164 string build_id = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800165
166 reserved 9 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800167}
168
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700169message ArmMTEMetadata {
170 // One memory tag per granule (e.g. every 16 bytes) of regular memory.
171 bytes memory_tags = 1;
172 reserved 2 to 999;
173}
174
Josh Gao76e1e302021-01-26 15:53:11 -0800175message MemoryDump {
176 string register_name = 1;
177 string mapping_name = 2;
178 uint64 begin_address = 3;
179 bytes memory = 4;
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700180 oneof metadata {
181 ArmMTEMetadata arm_mte_metadata = 6;
182 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800183
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700184 reserved 5, 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800185}
186
187message MemoryMapping {
188 uint64 begin_address = 1;
189 uint64 end_address = 2;
190 uint64 offset = 3;
191
192 bool read = 4;
193 bool write = 5;
194 bool execute = 6;
195
196 string mapping_name = 7;
197 string build_id = 8;
198 uint64 load_bias = 9;
Josh Gaofc4fb212021-02-10 16:59:50 -0800199
200 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800201}
202
203message FD {
204 int32 fd = 1;
205 string path = 2;
206 string owner = 3;
207 uint64 tag = 4;
Josh Gaofc4fb212021-02-10 16:59:50 -0800208
209 reserved 5 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800210}
211
212message LogBuffer {
213 string name = 1;
214 repeated LogMessage logs = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800215
216 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800217}
218
219message LogMessage {
220 string timestamp = 1;
221 uint32 pid = 2;
222 uint32 tid = 3;
223 uint32 priority = 4;
224 string tag = 5;
225 string message = 6;
Josh Gaofc4fb212021-02-10 16:59:50 -0800226
227 reserved 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800228}