This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Support syslog logging on Android and in dieWithMessage
AbandonedPublic

Authored by cryptoad on Nov 7 2017, 11:53 AM.

Details

Reviewers
alekseyshl
Summary

This is controlled by the common option log_to_syslog, which is enabled by
default on Android.

There is a side effect to this as syslog can use malloc or the like. This
is not ideal as this could be called in a failure path while the heap is
corrupted, but it's pretty much compulsory to have that for Android.

The plan is to change WriteOneLineToSyslog to use async_safe_write_log if
available, which doesn't do dynamic memory allocation (added to the Bionic libc
somewhat recently).

Event Timeline

cryptoad created this revision.Nov 7 2017, 11:53 AM
cryptoad added inline comments.Nov 7 2017, 11:54 AM
lib/scudo/scudo_allocator.cpp
209

I forgot to say that this was removed because the background thread will be coming back, but in another form.

alekseyshl accepted this revision.Nov 7 2017, 12:50 PM
This revision is now accepted and ready to land.Nov 7 2017, 12:50 PM
cryptoad planned changes to this revision.Nov 7 2017, 2:04 PM

The plan still didn't work on a freshly flashed device. There are still issues with logging with the init process.

cryptoad abandoned this revision.Nov 10 2017, 9:25 AM