[compiler-rt] r204124 - tsan: add missing interceptor for embed symbolizer

Dmitry Vyukov dvyukov at google.com
Tue Mar 18 01:28:40 PDT 2014


Author: dvyukov
Date: Tue Mar 18 03:28:39 2014
New Revision: 204124

URL: http://llvm.org/viewvc/llvm-project?rev=204124&view=rev
Log:
tsan: add missing interceptor for embed symbolizer


Modified:
    compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc

Modified: compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc?rev=204124&r1=204123&r2=204124&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/dd/dd_interceptors.cc Tue Mar 18 03:28:39 2014
@@ -209,6 +209,19 @@ INTERCEPTOR(int, pthread_cond_destroy, p
   return res;
 }
 
+
+INTERCEPTOR(char*, realpath, const char *path, char *resolved_path) {
+  return REAL(realpath)(path, resolved_path);
+}
+
+INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) {
+  return REAL(read)(fd, ptr, count);
+}
+
+INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) {
+  return REAL(pread)(fd, ptr, count, offset);
+}
+
 namespace __dsan {
 
 void InitializeInterceptors() {
@@ -237,6 +250,11 @@ void InitializeInterceptors() {
   INTERCEPT_FUNCTION_VER(pthread_cond_wait, "GLIBC_2.3.2");
   INTERCEPT_FUNCTION_VER(pthread_cond_timedwait, "GLIBC_2.3.2");
   INTERCEPT_FUNCTION_VER(pthread_cond_destroy, "GLIBC_2.3.2");
+
+  // for symbolizer
+  INTERCEPT_FUNCTION(realpath);
+  INTERCEPT_FUNCTION(read);
+  INTERCEPT_FUNCTION(pread);
 }
 
 }  // namespace __dsan





More information about the llvm-commits mailing list