Summary:
Zygote & children's stderr is lost, so use Bionic's provided allocation
free syslog function for `outputRaw`. Get rid of the mutex as it's not
vital and could cause issues with `fork`.
Reviewers: cferris, pcc, eugenis, hctim, morehouse
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D73561
return (ReadBytes == static_cast<ssize_t>(Length));
}
+// Allocation free syslog-like API.
+extern "C" WEAK int async_safe_write_log(int pri, const char *tag,
+ const char *msg);
+
void outputRaw(const char *Buffer) {
- static HybridMutex Mutex;
- ScopedLock L(Mutex);
- write(2, Buffer, strlen(Buffer));
+ if (&async_safe_write_log) {
+ constexpr s32 AndroidLogInfo = 4;
+ async_safe_write_log(AndroidLogInfo, "scudo", Buffer);
+ } else {
+ write(2, Buffer, strlen(Buffer));
+ }
}
extern "C" WEAK void android_set_abort_message(const char *);