This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Support log_to_syslog in dieWithMessage
AbandonedPublic

Authored by cryptoad on Jul 14 2017, 9:58 AM.

Details

Reviewers
alekseyshl
Summary

log_to_syslog is a sanitizer common option, that had no effect in Scudo's
dieWithMessage. It turns out to be quite useful on Android, so add the few
lines needed to support it.

Event Timeline

cryptoad created this revision.Jul 14 2017, 9:58 AM
alekseyshl accepted this revision.Jul 14 2017, 11:54 AM
This revision is now accepted and ready to land.Jul 14 2017, 11:54 AM
cryptoad abandoned this revision.Jul 16 2017, 10:58 AM

As it turns out, Android's syslog does malloc(), so it can lead to hairy behaviors in init (and probably others).
Explore the following as an alternative:

#define error_log(format, ...)  \
    async_safe_format_log(ANDROID_LOG_ERROR, "libc", (format), ##__VA_ARGS__ )
#define info_log(format, ...)  \
    async_safe_format_log(ANDROID_LOG_INFO, "libc", (format), ##__VA_ARGS__ )