blob: 451cb8caf3e201ee044069698acaa9aaa0bbf318 [file] [log] [blame]
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <assert.h>
30#include <ctype.h>
31#include <errno.h>
32#include <fcntl.h>
Josh Gaod3711332020-08-20 16:27:01 -070033#include <linux/net.h>
Christopher Ferris7a3681e2017-04-24 17:48:32 -070034#include <pthread.h>
35#include <stdarg.h>
36#include <stddef.h>
37#include <stdlib.h>
38#include <string.h>
39#include <sys/mman.h>
40#include <sys/socket.h>
Josh Gaof6e5b582018-06-01 15:30:54 -070041#include <sys/syscall.h>
Christopher Ferris7a3681e2017-04-24 17:48:32 -070042#include <sys/types.h>
43#include <sys/uio.h>
44#include <sys/un.h>
45#include <time.h>
46#include <unistd.h>
47
48#include <android/set_abort_message.h>
49#include <async_safe/log.h>
50
51#include "private/CachedProperty.h"
Elliott Hughes8aecba72017-10-17 15:34:41 -070052#include "private/ErrnoRestorer.h"
Christopher Ferris7a3681e2017-04-24 17:48:32 -070053#include "private/ScopedPthreadMutexLocker.h"
54
Josh Gaod3711332020-08-20 16:27:01 -070055// Don't call libc's close or socket, since it might call back into us as a result of fdsan/fdtrack.
Josh Gaof6e5b582018-06-01 15:30:54 -070056#pragma GCC poison close
57static int __close(int fd) {
58 return syscall(__NR_close, fd);
59}
60
Josh Gaod3711332020-08-20 16:27:01 -070061static int __socket(int domain, int type, int protocol) {
62#if defined(__i386__)
63 unsigned long args[3] = {static_cast<unsigned long>(domain), static_cast<unsigned long>(type),
64 static_cast<unsigned long>(protocol)};
65 return syscall(__NR_socketcall, SYS_SOCKET, &args);
66#else
67 return syscall(__NR_socket, domain, type, protocol);
68#endif
69}
70
Christopher Ferris7a3681e2017-04-24 17:48:32 -070071// Must be kept in sync with frameworks/base/core/java/android/util/EventLog.java.
72enum AndroidEventLogType {
73 EVENT_TYPE_INT = 0,
74 EVENT_TYPE_LONG = 1,
75 EVENT_TYPE_STRING = 2,
76 EVENT_TYPE_LIST = 3,
77 EVENT_TYPE_FLOAT = 4,
78};
79
80struct BufferOutputStream {
81 public:
Christopher Ferris92476402017-08-22 11:24:09 -070082 BufferOutputStream(char* buffer, size_t size) : total(0), pos_(buffer), avail_(size) {
83 if (avail_ > 0) pos_[0] = '\0';
Christopher Ferris7a3681e2017-04-24 17:48:32 -070084 }
Christopher Ferris92476402017-08-22 11:24:09 -070085 ~BufferOutputStream() = default;
Christopher Ferris7a3681e2017-04-24 17:48:32 -070086
87 void Send(const char* data, int len) {
88 if (len < 0) {
89 len = strlen(data);
90 }
Christopher Ferris7a3681e2017-04-24 17:48:32 -070091 total += len;
92
Christopher Ferris92476402017-08-22 11:24:09 -070093 if (avail_ <= 1) {
94 // No space to put anything else.
95 return;
Christopher Ferris7a3681e2017-04-24 17:48:32 -070096 }
Christopher Ferris92476402017-08-22 11:24:09 -070097
98 if (static_cast<size_t>(len) >= avail_) {
99 len = avail_ - 1;
100 }
101 memcpy(pos_, data, len);
102 pos_ += len;
103 pos_[0] = '\0';
104 avail_ -= len;
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700105 }
106
107 size_t total;
108
109 private:
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700110 char* pos_;
Christopher Ferris92476402017-08-22 11:24:09 -0700111 size_t avail_;
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700112};
113
114struct FdOutputStream {
115 public:
116 explicit FdOutputStream(int fd) : total(0), fd_(fd) {}
117
118 void Send(const char* data, int len) {
119 if (len < 0) {
120 len = strlen(data);
121 }
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700122 total += len;
123
124 while (len > 0) {
Christopher Ferris92476402017-08-22 11:24:09 -0700125 ssize_t bytes = TEMP_FAILURE_RETRY(write(fd_, data, len));
126 if (bytes == -1) {
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700127 return;
128 }
Christopher Ferris92476402017-08-22 11:24:09 -0700129 data += bytes;
130 len -= bytes;
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700131 }
132 }
133
134 size_t total;
135
136 private:
137 int fd_;
138};
139
140/*** formatted output implementation
141 ***/
142
143/* Parse a decimal string from 'format + *ppos',
144 * return the value, and writes the new position past
145 * the decimal string in '*ppos' on exit.
146 *
147 * NOTE: Does *not* handle a sign prefix.
148 */
149static unsigned parse_decimal(const char* format, int* ppos) {
150 const char* p = format + *ppos;
151 unsigned result = 0;
152
153 for (;;) {
154 int ch = *p;
155 unsigned d = static_cast<unsigned>(ch - '0');
156
157 if (d >= 10U) {
158 break;
159 }
160
161 result = result * 10 + d;
162 p++;
163 }
164 *ppos = p - format;
165 return result;
166}
167
168// Writes number 'value' in base 'base' into buffer 'buf' of size 'buf_size' bytes.
169// Assumes that buf_size > 0.
170static void format_unsigned(char* buf, size_t buf_size, uint64_t value, int base, bool caps) {
171 char* p = buf;
172 char* end = buf + buf_size - 1;
173
174 // Generate digit string in reverse order.
175 while (value) {
176 unsigned d = value % base;
177 value /= base;
178 if (p != end) {
179 char ch;
180 if (d < 10) {
181 ch = '0' + d;
182 } else {
183 ch = (caps ? 'A' : 'a') + (d - 10);
184 }
185 *p++ = ch;
186 }
187 }
188
189 // Special case for 0.
190 if (p == buf) {
191 if (p != end) {
192 *p++ = '0';
193 }
194 }
195 *p = '\0';
196
197 // Reverse digit string in-place.
198 size_t length = p - buf;
199 for (size_t i = 0, j = length - 1; i < j; ++i, --j) {
200 char ch = buf[i];
201 buf[i] = buf[j];
202 buf[j] = ch;
203 }
204}
205
206static void format_integer(char* buf, size_t buf_size, uint64_t value, char conversion) {
207 // Decode the conversion specifier.
208 int is_signed = (conversion == 'd' || conversion == 'i' || conversion == 'o');
209 int base = 10;
Elliott Hughesf5b4e3c2023-08-22 13:50:39 -0700210 if (tolower(conversion) == 'x') {
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700211 base = 16;
212 } else if (conversion == 'o') {
213 base = 8;
Elliott Hughesf5b4e3c2023-08-22 13:50:39 -0700214 } else if (tolower(conversion) == 'b') {
215 base = 2;
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700216 }
217 bool caps = (conversion == 'X');
218
219 if (is_signed && static_cast<int64_t>(value) < 0) {
220 buf[0] = '-';
221 buf += 1;
222 buf_size -= 1;
223 value = static_cast<uint64_t>(-static_cast<int64_t>(value));
224 }
225 format_unsigned(buf, buf_size, value, base, caps);
226}
227
228template <typename Out>
229static void SendRepeat(Out& o, char ch, int count) {
230 char pad[8];
231 memset(pad, ch, sizeof(pad));
232
233 const int pad_size = static_cast<int>(sizeof(pad));
234 while (count > 0) {
235 int avail = count;
236 if (avail > pad_size) {
237 avail = pad_size;
238 }
239 o.Send(pad, avail);
240 count -= avail;
241 }
242}
243
244/* Perform formatted output to an output target 'o' */
245template <typename Out>
246static void out_vformat(Out& o, const char* format, va_list args) {
247 int nn = 0;
248
249 for (;;) {
250 int mm;
251 int padZero = 0;
252 int padLeft = 0;
253 char sign = '\0';
254 int width = -1;
255 int prec = -1;
zijunzhao75c36fe2022-01-28 19:22:24 +0000256 bool alternate = false;
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700257 size_t bytelen = sizeof(int);
258 int slen;
Christopher Ferris35759fa2023-03-20 16:31:18 -0700259 char buffer[64]; // temporary buffer used to format numbers/format errno string
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700260
261 char c;
262
263 /* first, find all characters that are not 0 or '%' */
264 /* then send them to the output directly */
265 mm = nn;
266 do {
267 c = format[mm];
268 if (c == '\0' || c == '%') break;
269 mm++;
270 } while (1);
271
272 if (mm > nn) {
273 o.Send(format + nn, mm - nn);
274 nn = mm;
275 }
276
277 /* is this it ? then exit */
278 if (c == '\0') break;
279
280 /* nope, we are at a '%' modifier */
281 nn++; // skip it
282
283 /* parse flags */
284 for (;;) {
285 c = format[nn++];
286 if (c == '\0') { /* single trailing '%' ? */
287 c = '%';
288 o.Send(&c, 1);
289 return;
290 } else if (c == '0') {
291 padZero = 1;
292 continue;
293 } else if (c == '-') {
294 padLeft = 1;
295 continue;
296 } else if (c == ' ' || c == '+') {
297 sign = c;
298 continue;
zijunzhao75c36fe2022-01-28 19:22:24 +0000299 } else if (c == '#') {
300 alternate = true;
301 continue;
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700302 }
303 break;
304 }
305
306 /* parse field width */
307 if ((c >= '0' && c <= '9')) {
308 nn--;
309 width = static_cast<int>(parse_decimal(format, &nn));
310 c = format[nn++];
311 }
312
313 /* parse precision */
314 if (c == '.') {
315 prec = static_cast<int>(parse_decimal(format, &nn));
316 c = format[nn++];
317 }
318
319 /* length modifier */
320 switch (c) {
321 case 'h':
322 bytelen = sizeof(short);
323 if (format[nn] == 'h') {
324 bytelen = sizeof(char);
325 nn += 1;
326 }
327 c = format[nn++];
328 break;
329 case 'l':
330 bytelen = sizeof(long);
331 if (format[nn] == 'l') {
332 bytelen = sizeof(long long);
333 nn += 1;
334 }
335 c = format[nn++];
336 break;
337 case 'z':
338 bytelen = sizeof(size_t);
339 c = format[nn++];
340 break;
341 case 't':
342 bytelen = sizeof(ptrdiff_t);
343 c = format[nn++];
344 break;
345 default:;
346 }
347
348 /* conversion specifier */
349 const char* str = buffer;
350 if (c == 's') {
351 /* string */
352 str = va_arg(args, const char*);
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700353 } else if (c == 'c') {
354 /* character */
355 /* NOTE: char is promoted to int when passed through the stack */
356 buffer[0] = static_cast<char>(va_arg(args, int));
357 buffer[1] = '\0';
358 } else if (c == 'p') {
359 uint64_t value = reinterpret_cast<uintptr_t>(va_arg(args, void*));
360 buffer[0] = '0';
361 buffer[1] = 'x';
362 format_integer(buffer + 2, sizeof(buffer) - 2, value, 'x');
zijunzhao75c36fe2022-01-28 19:22:24 +0000363 } else if (c == 'm') {
Elliott Hughes2109f122023-09-21 18:32:39 -0700364#if __ANDROID_API_LEVEL__ >= 35 // This library is used in mainline modules.
365 if (alternate) {
366 const char* name = strerrorname_np(errno);
367 if (name) {
368 strcpy(buffer, name);
369 } else {
370 format_integer(buffer, sizeof(buffer), errno, 'd');
371 }
372 } else
373#endif
374 {
375 strerror_r(errno, buffer, sizeof(buffer));
376 }
Elliott Hughesf5b4e3c2023-08-22 13:50:39 -0700377 } else if (tolower(c) == 'b' || c == 'd' || c == 'i' || c == 'o' || c == 'u' ||
378 tolower(c) == 'x') {
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700379 /* integers - first read value from stack */
380 uint64_t value;
381 int is_signed = (c == 'd' || c == 'i' || c == 'o');
382
383 /* NOTE: int8_t and int16_t are promoted to int when passed
384 * through the stack
385 */
386 switch (bytelen) {
387 case 1:
388 value = static_cast<uint8_t>(va_arg(args, int));
389 break;
390 case 2:
391 value = static_cast<uint16_t>(va_arg(args, int));
392 break;
393 case 4:
394 value = va_arg(args, uint32_t);
395 break;
396 case 8:
397 value = va_arg(args, uint64_t);
398 break;
399 default:
400 return; /* should not happen */
401 }
402
403 /* sign extension, if needed */
404 if (is_signed) {
405 int shift = 64 - 8 * bytelen;
406 value = static_cast<uint64_t>((static_cast<int64_t>(value << shift)) >> shift);
407 }
408
Elliott Hughesf5b4e3c2023-08-22 13:50:39 -0700409 if (alternate && value != 0 && (tolower(c) == 'x' || c == 'o' || tolower(c) == 'b')) {
410 if (tolower(c) == 'x' || tolower(c) == 'b') {
zijunzhao75c36fe2022-01-28 19:22:24 +0000411 buffer[0] = '0';
Elliott Hughesf5b4e3c2023-08-22 13:50:39 -0700412 buffer[1] = c;
zijunzhao75c36fe2022-01-28 19:22:24 +0000413 format_integer(buffer + 2, sizeof(buffer) - 2, value, c);
414 } else {
415 buffer[0] = '0';
416 format_integer(buffer + 1, sizeof(buffer) - 1, value, c);
417 }
418 } else {
419 /* format the number properly into our buffer */
420 format_integer(buffer, sizeof(buffer), value, c);
421 }
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700422 } else if (c == '%') {
423 buffer[0] = '%';
424 buffer[1] = '\0';
425 } else {
426 __assert(__FILE__, __LINE__, "conversion specifier unsupported");
427 }
428
zijunzhao75c36fe2022-01-28 19:22:24 +0000429 if (str == nullptr) {
430 str = "(null)";
431 }
432
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700433 /* if we are here, 'str' points to the content that must be
434 * outputted. handle padding and alignment now */
435
436 slen = strlen(str);
437
438 if (sign != '\0' || prec != -1) {
439 __assert(__FILE__, __LINE__, "sign/precision unsupported");
440 }
441
442 if (slen < width && !padLeft) {
443 char padChar = padZero ? '0' : ' ';
444 SendRepeat(o, padChar, width - slen);
445 }
446
447 o.Send(str, slen);
448
449 if (slen < width && padLeft) {
450 char padChar = padZero ? '0' : ' ';
451 SendRepeat(o, padChar, width - slen);
452 }
453 }
454}
455
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700456int async_safe_format_buffer_va_list(char* buffer, size_t buffer_size, const char* format,
457 va_list args) {
458 BufferOutputStream os(buffer, buffer_size);
459 out_vformat(os, format, args);
460 return os.total;
461}
462
Christopher Ferris92476402017-08-22 11:24:09 -0700463int async_safe_format_buffer(char* buffer, size_t buffer_size, const char* format, ...) {
464 va_list args;
465 va_start(args, format);
466 int buffer_len = async_safe_format_buffer_va_list(buffer, buffer_size, format, args);
467 va_end(args);
468 return buffer_len;
469}
470
Ryan Prichard5de9a31c2018-10-02 18:13:28 -0700471int async_safe_format_fd_va_list(int fd, const char* format, va_list args) {
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700472 FdOutputStream os(fd);
Ryan Prichard5de9a31c2018-10-02 18:13:28 -0700473 out_vformat(os, format, args);
474 return os.total;
475}
476
477int async_safe_format_fd(int fd, const char* format, ...) {
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700478 va_list args;
479 va_start(args, format);
Ryan Prichard5de9a31c2018-10-02 18:13:28 -0700480 int result = async_safe_format_fd_va_list(fd, format, args);
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700481 va_end(args);
Ryan Prichard5de9a31c2018-10-02 18:13:28 -0700482 return result;
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700483}
484
485static int write_stderr(const char* tag, const char* msg) {
486 iovec vec[4];
487 vec[0].iov_base = const_cast<char*>(tag);
488 vec[0].iov_len = strlen(tag);
489 vec[1].iov_base = const_cast<char*>(": ");
490 vec[1].iov_len = 2;
491 vec[2].iov_base = const_cast<char*>(msg);
492 vec[2].iov_len = strlen(msg);
493 vec[3].iov_base = const_cast<char*>("\n");
494 vec[3].iov_len = 1;
495
496 int result = TEMP_FAILURE_RETRY(writev(STDERR_FILENO, vec, 4));
497 return result;
498}
499
500static int open_log_socket() {
501 // ToDo: Ideally we want this to fail if the gid of the current
502 // process is AID_LOGD, but will have to wait until we have
503 // registered this in private/android_filesystem_config.h. We have
504 // found that all logd crashes thus far have had no problem stuffing
505 // the UNIX domain socket and moving on so not critical *today*.
506
Josh Gaod3711332020-08-20 16:27:01 -0700507 int log_fd = TEMP_FAILURE_RETRY(__socket(PF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0));
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700508 if (log_fd == -1) {
509 return -1;
510 }
511
512 union {
513 struct sockaddr addr;
514 struct sockaddr_un addrUn;
515 } u;
516 memset(&u, 0, sizeof(u));
517 u.addrUn.sun_family = AF_UNIX;
518 strlcpy(u.addrUn.sun_path, "/dev/socket/logdw", sizeof(u.addrUn.sun_path));
519
520 if (TEMP_FAILURE_RETRY(connect(log_fd, &u.addr, sizeof(u.addrUn))) != 0) {
Josh Gaof6e5b582018-06-01 15:30:54 -0700521 __close(log_fd);
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700522 return -1;
523 }
524
525 return log_fd;
526}
527
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700528struct log_time { // Wire format
529 uint32_t tv_sec;
530 uint32_t tv_nsec;
531};
532
533int async_safe_write_log(int priority, const char* tag, const char* msg) {
534 int main_log_fd = open_log_socket();
535 if (main_log_fd == -1) {
536 // Try stderr instead.
537 return write_stderr(tag, msg);
538 }
539
540 iovec vec[6];
541 char log_id = (priority == ANDROID_LOG_FATAL) ? LOG_ID_CRASH : LOG_ID_MAIN;
542 vec[0].iov_base = &log_id;
543 vec[0].iov_len = sizeof(log_id);
544 uint16_t tid = gettid();
545 vec[1].iov_base = &tid;
546 vec[1].iov_len = sizeof(tid);
547 timespec ts;
Elliott Hughes53dc9dd2017-09-19 14:02:50 -0700548 clock_gettime(CLOCK_REALTIME, &ts);
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700549 log_time realtime_ts;
550 realtime_ts.tv_sec = ts.tv_sec;
551 realtime_ts.tv_nsec = ts.tv_nsec;
552 vec[2].iov_base = &realtime_ts;
553 vec[2].iov_len = sizeof(realtime_ts);
554
555 vec[3].iov_base = &priority;
556 vec[3].iov_len = 1;
557 vec[4].iov_base = const_cast<char*>(tag);
558 vec[4].iov_len = strlen(tag) + 1;
559 vec[5].iov_base = const_cast<char*>(msg);
560 vec[5].iov_len = strlen(msg) + 1;
561
562 int result = TEMP_FAILURE_RETRY(writev(main_log_fd, vec, sizeof(vec) / sizeof(vec[0])));
Josh Gaof6e5b582018-06-01 15:30:54 -0700563 __close(main_log_fd);
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700564 return result;
565}
566
567int async_safe_format_log_va_list(int priority, const char* tag, const char* format, va_list args) {
Elliott Hughes8aecba72017-10-17 15:34:41 -0700568 ErrnoRestorer errno_restorer;
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700569 char buffer[1024];
570 BufferOutputStream os(buffer, sizeof(buffer));
571 out_vformat(os, format, args);
572 return async_safe_write_log(priority, tag, buffer);
573}
574
575int async_safe_format_log(int priority, const char* tag, const char* format, ...) {
576 va_list args;
577 va_start(args, format);
578 int result = async_safe_format_log_va_list(priority, tag, format, args);
579 va_end(args);
580 return result;
581}
582
583void async_safe_fatal_va_list(const char* prefix, const char* format, va_list args) {
584 char msg[1024];
585 BufferOutputStream os(msg, sizeof(msg));
586
587 if (prefix) {
588 os.Send(prefix, strlen(prefix));
589 os.Send(": ", 2);
590 }
591
592 out_vformat(os, format, args);
593
594 // Log to stderr for the benefit of "adb shell" users and gtests.
595 struct iovec iov[2] = {
Ryan Prichard5258c252018-05-01 17:59:59 -0700596 {msg, strlen(msg)}, {const_cast<char*>("\n"), 1},
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700597 };
598 TEMP_FAILURE_RETRY(writev(2, iov, 2));
599
600 // Log to the log for the benefit of regular app developers (whose stdout and stderr are closed).
601 async_safe_write_log(ANDROID_LOG_FATAL, "libc", msg);
602
603 android_set_abort_message(msg);
604}
605
Elliott Hughes695713e2017-06-20 17:28:42 -0700606void async_safe_fatal_no_abort(const char* fmt, ...) {
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700607 va_list args;
608 va_start(args, fmt);
609 async_safe_fatal_va_list(nullptr, fmt, args);
610 va_end(args);
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700611}