platform_bionic/libc/async_safe
Peter Collingbourne 84979776d0 Fix stack use-after-scope in async_safe_log.
The buffer filled in by strerror_r needs to stay in scope while
it is pointed to by str.

Bug: 273807460
Change-Id: I494ca8b8aca2b28ec2f0f3da72d845db99633553
2023-03-15 15:21:58 -07:00
..
include/async_safe linker: CHECK() or async_safe_fatal() rather than abort(). 2020-06-10 14:49:28 -07:00
Android.bp Open libasync_safe to any APEX 2022-09-02 22:43:56 +00:00
async_safe_log.cpp Fix stack use-after-scope in async_safe_log. 2023-03-15 15:21:58 -07:00
README.md Add a README.md for async_safe 2020-01-17 12:12:26 -08:00

async_safe logging

This library provides an async_safe implementation for formatting and writing log messages to logd.

Note that the liblog implementation connects a single socket to logd and uses a RWLock to manage it among threads, whereas these functions connect to liblog for each log message. While it's beneficial to have this lock-free and therefore async_safe mechanism to write to logd, connecting a socket for each message does not scale well under load. It was also determined to be too costly to connect a socket for each thread as some processes, such as system_server, have over 100 threads. Therefore, we maintain these two separate mechanisms.