blob: 214cbfb46bee0078bc188197e442b22060700d97 [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
Florian Mayer5fa66632024-02-07 16:42:23 -080049 reserved 22 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080050}
51
52enum Architecture {
53 ARM32 = 0;
54 ARM64 = 1;
55 X86 = 2;
56 X86_64 = 3;
Liu Cunyuan8c0101b2022-10-12 22:35:51 +080057 RISCV64 = 4;
Josh Gaofc4fb212021-02-10 16:59:50 -080058
Liu Cunyuan8c0101b2022-10-12 22:35:51 +080059 reserved 5 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080060}
61
62message Signal {
63 int32 number = 1;
64 string name = 2;
65
66 int32 code = 3;
67 string code_name = 4;
68
69 bool has_sender = 5;
70 int32 sender_uid = 6;
71 int32 sender_pid = 7;
72
73 bool has_fault_address = 8;
74 uint64 fault_address = 9;
Mitch Phillips5ddcea22021-04-19 09:59:17 -070075 // Note, may or may not contain the dump of the actual memory contents. Currently, on arm64, we
76 // only include metadata, and not the contents.
77 MemoryDump fault_adjacent_metadata = 10;
Josh Gaofc4fb212021-02-10 16:59:50 -080078
Mitch Phillips5ddcea22021-04-19 09:59:17 -070079 reserved 11 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -080080}
81
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -080082message HeapObject {
83 uint64 address = 1;
84 uint64 size = 2;
85
86 uint64 allocation_tid = 3;
87 repeated BacktraceFrame allocation_backtrace = 4;
88
89 uint64 deallocation_tid = 5;
90 repeated BacktraceFrame deallocation_backtrace = 6;
91}
92
93message MemoryError {
94 enum Tool {
95 GWP_ASAN = 0;
96 SCUDO = 1;
97
98 reserved 2 to 999;
99 }
100 Tool tool = 1;
101
102 enum Type {
103 UNKNOWN = 0;
104 USE_AFTER_FREE = 1;
105 DOUBLE_FREE = 2;
106 INVALID_FREE = 3;
107 BUFFER_OVERFLOW = 4;
108 BUFFER_UNDERFLOW = 5;
109
110 reserved 6 to 999;
111 }
112 Type type = 2;
113
114 oneof location {
115 HeapObject heap = 3;
116 }
117
118 reserved 4 to 999;
119}
120
Josh Gao76e1e302021-01-26 15:53:11 -0800121message Cause {
122 string human_readable = 1;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800123 oneof details {
124 MemoryError memory_error = 2;
125 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800126
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800127 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800128}
129
130message Register {
131 string name = 1;
132 uint64 u64 = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800133
134 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800135}
136
137message Thread {
138 int32 id = 1;
139 string name = 2;
140 repeated Register registers = 3;
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700141 repeated string backtrace_note = 7;
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700142 repeated string unreadable_elf_files = 9;
Josh Gao76e1e302021-01-26 15:53:11 -0800143 repeated BacktraceFrame current_backtrace = 4;
144 repeated MemoryDump memory_dump = 5;
Peter Collingbourne1a1f7d72021-03-08 16:53:54 -0800145 int64 tagged_addr_ctrl = 6;
Elliott Hughesd13ea522022-01-13 09:20:26 -0800146 int64 pac_enabled_keys = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800147
Christopher Ferrisc95047d2022-03-14 15:02:11 -0700148 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800149}
150
151message BacktraceFrame {
152 uint64 rel_pc = 1;
153 uint64 pc = 2;
154 uint64 sp = 3;
155
156 string function_name = 4;
157 uint64 function_offset = 5;
158
159 string file_name = 6;
160 uint64 file_map_offset = 7;
161 string build_id = 8;
Josh Gaofc4fb212021-02-10 16:59:50 -0800162
163 reserved 9 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800164}
165
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700166message ArmMTEMetadata {
167 // One memory tag per granule (e.g. every 16 bytes) of regular memory.
168 bytes memory_tags = 1;
169 reserved 2 to 999;
170}
171
Josh Gao76e1e302021-01-26 15:53:11 -0800172message MemoryDump {
173 string register_name = 1;
174 string mapping_name = 2;
175 uint64 begin_address = 3;
176 bytes memory = 4;
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700177 oneof metadata {
178 ArmMTEMetadata arm_mte_metadata = 6;
179 }
Josh Gaofc4fb212021-02-10 16:59:50 -0800180
Mitch Phillips5ddcea22021-04-19 09:59:17 -0700181 reserved 5, 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800182}
183
184message MemoryMapping {
185 uint64 begin_address = 1;
186 uint64 end_address = 2;
187 uint64 offset = 3;
188
189 bool read = 4;
190 bool write = 5;
191 bool execute = 6;
192
193 string mapping_name = 7;
194 string build_id = 8;
195 uint64 load_bias = 9;
Josh Gaofc4fb212021-02-10 16:59:50 -0800196
197 reserved 10 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800198}
199
200message FD {
201 int32 fd = 1;
202 string path = 2;
203 string owner = 3;
204 uint64 tag = 4;
Josh Gaofc4fb212021-02-10 16:59:50 -0800205
206 reserved 5 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800207}
208
209message LogBuffer {
210 string name = 1;
211 repeated LogMessage logs = 2;
Josh Gaofc4fb212021-02-10 16:59:50 -0800212
213 reserved 3 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800214}
215
216message LogMessage {
217 string timestamp = 1;
218 uint32 pid = 2;
219 uint32 tid = 3;
220 uint32 priority = 4;
221 string tag = 5;
222 string message = 6;
Josh Gaofc4fb212021-02-10 16:59:50 -0800223
224 reserved 7 to 999;
Josh Gao76e1e302021-01-26 15:53:11 -0800225}