[PATCH] D11435: [sanitizer] Implement logging to syslog

Alexey Samsonov vonosmas at gmail.com
Wed Jul 22 16:02:16 PDT 2015


samsonov added inline comments.

================
Comment at: lib/safestack/CMakeLists.txt:16
@@ -15,2 +15,3 @@
             $<TARGET_OBJECTS:RTSanitizerCommon.osx>
+            $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.osx>
     CFLAGS ${SAFESTACK_CFLAGS})
----------------
There is no such thing on osx

================
Comment at: lib/sanitizer_common/CMakeLists.txt:36
@@ -35,1 +35,3 @@
 
+set(SANITIZER_NOLIBC_SOURCES
+  sanitizer_common_nolibc.cc)
----------------
Please clarify why/how these sources are used.

================
Comment at: lib/sanitizer_common/sanitizer_common.h:633
@@ -632,2 +632,3 @@
 // Initialize Android logging. Any writes before this are silently lost.
 void AndroidLogInit();
+void WriteToSyslog(const char *buffer);
----------------
Do you actually need `AndroidLogInit` on non-Android platforms?

================
Comment at: lib/sanitizer_common/sanitizer_posix_libcdep.cc:306
@@ +305,3 @@
+void WriteToSyslog(const char *buffer) {
+  char *copy = internal_strdup(buffer);
+  char *p = copy;
----------------
Hm, calling an internal allocator on every printf... I think that local or mmaped buffer would work better.

================
Comment at: lib/sanitizer_common/tests/CMakeLists.txt:176
@@ -176,1 +175,3 @@
+                               $<TARGET_OBJECTS:RTSanitizerCommon.x86_64>
+                               $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.x86_64>)
     endif()
----------------
You probably would need to add this library to dfsan.


http://reviews.llvm.org/D11435







More information about the llvm-commits mailing list