• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
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
10syntax = "proto3";
11
12option java_package = "com.android.server.os";
13option java_outer_classname = "TombstoneProtos";
14
15// NOTE TO OEMS:
16// If you add custom fields to this proto, do not use numbers in the reserved range.
17
18message CrashDetail {
19  bytes name = 1;
20  bytes data = 2;
21
22  reserved 3 to 999;
23}
24
25message Tombstone {
26  Architecture arch = 1;
27  Architecture guest_arch = 24;
28  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
37  repeated string command_line = 9;
38
39  // Process uptime in seconds.
40  uint32 process_uptime = 20;
41
42  Signal signal_info = 10;
43  string abort_message = 14;
44  repeated CrashDetail crash_details = 21;
45  repeated Cause causes = 15;
46
47  map<uint32, Thread> threads = 16;
48  map<uint32, Thread> guest_threads = 25;
49  repeated MemoryMapping memory_mappings = 17;
50  repeated LogBuffer log_buffers = 18;
51  repeated FD open_fds = 19;
52
53  uint32 page_size = 22;
54  bool has_been_16kb_mode = 23;
55
56  reserved 26 to 999;
57}
58
59enum Architecture {
60  ARM32 = 0;
61  ARM64 = 1;
62  X86 = 2;
63  X86_64 = 3;
64  RISCV64 = 4;
65  NONE = 5;
66
67  reserved 6 to 999;
68}
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;
83  // 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;
86
87  reserved 11 to 999;
88}
89
90message 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
129message Cause {
130  string human_readable = 1;
131  oneof details {
132    MemoryError memory_error = 2;
133  }
134
135  reserved 3 to 999;
136}
137
138message Register {
139  string name = 1;
140  uint64 u64 = 2;
141
142  reserved 3 to 999;
143}
144
145message Thread {
146  int32 id = 1;
147  string name = 2;
148  repeated Register registers = 3;
149  repeated string backtrace_note = 7;
150  repeated string unreadable_elf_files = 9;
151  repeated BacktraceFrame current_backtrace = 4;
152  repeated MemoryDump memory_dump = 5;
153  int64 tagged_addr_ctrl = 6;
154  int64 pac_enabled_keys = 8;
155
156  reserved 10 to 999;
157}
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;
170
171  reserved 9 to 999;
172}
173
174message 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
180message MemoryDump {
181  string register_name = 1;
182  string mapping_name = 2;
183  uint64 begin_address = 3;
184  bytes memory = 4;
185  oneof metadata {
186    ArmMTEMetadata arm_mte_metadata = 6;
187  }
188
189  reserved 5, 7 to 999;
190}
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;
204
205  reserved 10 to 999;
206}
207
208message FD {
209  int32 fd = 1;
210  string path = 2;
211  string owner = 3;
212  uint64 tag = 4;
213
214  reserved 5 to 999;
215}
216
217message LogBuffer {
218  string name = 1;
219  repeated LogMessage logs = 2;
220
221  reserved 3 to 999;
222}
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;
231
232  reserved 7 to 999;
233}
234