[llvm-commits] [compiler-rt] r172763 - in /compiler-rt/trunk/lib: asan/asan_intercepted_functions.h asan/asan_interceptors.cc asan/tests/asan_test.cc msan/msan_interceptors.cc sanitizer_common/sanitizer_common_interceptors.h sanitizer_common/sanitizer_platform_interceptors.h tsan/lit_tests/race_on_write.cc tsan/lit_tests/thread_name.cc tsan/rtl/tsan_interceptors.cc tsan/rtl/tsan_stat.cc tsan/rtl/tsan_stat.h
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu Jan 17 14:51:56 PST 2013
Author: stoklund
Date: Thu Jan 17 16:51:56 2013
New Revision: 172763
URL: http://llvm.org/viewvc/llvm-project?rev=172763&view=rev
Log:
Revert r172719, r172721-172723, and r172725.
The r172719 patch broke the build on Mac, the others depended on it.
compiler-rt/lib/asan/asan_interceptors.cc:78:13: error: unused function
'SetThreadName' [-Werror,-Wunused-function]
static void SetThreadName(const char *name) {
Orignal headlines:
[asan] attempting to fix the Mac build
[asan] restructure read/pread/pread64 tests
[sanitizer] move write/pwrite/pwrite64 interceptors to common
[msan] start using common interceptors in msan
[tsan] move prctl interceptor from asan to common_interceptors thus enabling it for tsan too
Removed:
compiler-rt/trunk/lib/tsan/lit_tests/race_on_write.cc
Modified:
compiler-rt/trunk/lib/asan/asan_intercepted_functions.h
compiler-rt/trunk/lib/asan/asan_interceptors.cc
compiler-rt/trunk/lib/asan/tests/asan_test.cc
compiler-rt/trunk/lib/msan/msan_interceptors.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc
compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc
compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h
Modified: compiler-rt/trunk/lib/asan/asan_intercepted_functions.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_intercepted_functions.h?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_intercepted_functions.h (original)
+++ compiler-rt/trunk/lib/asan/asan_intercepted_functions.h Thu Jan 17 16:51:56 2013
@@ -42,8 +42,10 @@
#if defined(__linux__)
# define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 1
+# define ASAN_INTERCEPT_PRCTL 1
#else
# define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 0
+# define ASAN_INTERCEPT_PRCTL 0
#endif
#if !defined(__APPLE__)
@@ -165,13 +167,6 @@
SIZE_T count, OFF64_T offset);
# endif
-#if SANITIZER_INTERCEPT_WRITE
-DECLARE_FUNCTION_AND_WRAPPER(SSIZE_T, write, int fd, void *ptr, SIZE_T count);
-#endif
-#if SANITIZER_INTERCEPT_PWRITE
-DECLARE_FUNCTION_AND_WRAPPER(SSIZE_T, pwrite, int fd, void *ptr, SIZE_T count);
-#endif
-
# if ASAN_INTERCEPT_MLOCKX
// mlock/munlock
DECLARE_FUNCTION_AND_WRAPPER(int, mlock, const void *addr, SIZE_T len);
Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Thu Jan 17 16:51:56 2013
@@ -75,12 +75,6 @@
return internal_strnlen(s, maxlen);
}
-static void SetThreadName(const char *name) {
- AsanThread *t = asanThreadRegistry().GetCurrent();
- if (t)
- t->summary()->set_name(name);
-}
-
} // namespace __asan
// ---------------------- Wrappers ---------------- {{{1
@@ -89,9 +83,8 @@
#define COMMON_INTERCEPTOR_WRITE_RANGE(ptr, size) ASAN_WRITE_RANGE(ptr, size)
#define COMMON_INTERCEPTOR_READ_RANGE(ptr, size) ASAN_READ_RANGE(ptr, size)
#define COMMON_INTERCEPTOR_ENTER(func, ...) ENSURE_ASAN_INITED()
-#define COMMON_INTERCEPTOR_FD_ACQUIRE(fd) do { } while (false)
-#define COMMON_INTERCEPTOR_FD_RELEASE(fd) do { } while (false)
-#define COMMON_INTERCEPTOR_SET_THREAD_NAME(name) SetThreadName(name)
+#define COMMON_INTERCEPTOR_FD_ACQUIRE(fd)
+#define COMMON_INTERCEPTOR_FD_RELEASE(fd)
#include "sanitizer_common/sanitizer_common_interceptors.h"
static thread_return_t THREAD_CALLING_CONV asan_thread_start(void *arg) {
@@ -187,6 +180,25 @@
}
#endif
+#if ASAN_INTERCEPT_PRCTL
+#define PR_SET_NAME 15
+INTERCEPTOR(int, prctl, int option,
+ unsigned long arg2, unsigned long arg3, // NOLINT
+ unsigned long arg4, unsigned long arg5) { // NOLINT
+ int res = REAL(prctl(option, arg2, arg3, arg4, arg5));
+ if (option == PR_SET_NAME) {
+ AsanThread *t = asanThreadRegistry().GetCurrent();
+ if (t) {
+ char buff[17];
+ internal_strncpy(buff, (char*)arg2, 16);
+ buff[16] = 0;
+ t->summary()->set_name(buff);
+ }
+ }
+ return res;
+}
+#endif
+
#if ASAN_INTERCEPT___CXA_THROW
INTERCEPTOR(void, __cxa_throw, void *a, void *b, void *c) {
CHECK(REAL(__cxa_throw));
@@ -733,6 +745,9 @@
#if ASAN_INTERCEPT_SIGLONGJMP
ASAN_INTERCEPT_FUNC(siglongjmp);
#endif
+#if ASAN_INTERCEPT_PRCTL
+ ASAN_INTERCEPT_FUNC(prctl);
+#endif
// Intercept exception handling functions.
#if ASAN_INTERCEPT___CXA_THROW
Modified: compiler-rt/trunk/lib/asan/tests/asan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test.cc?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Thu Jan 17 16:51:56 2013
@@ -1667,30 +1667,44 @@
CallMemTransferByPointer(&memmove);
}
-#if defined(__linux__) && !defined(ANDROID)
-#define READ_TEST(READ_N_BYTES) \
- char *x = new char[10]; \
- int fd = open("/proc/self/stat", O_RDONLY); \
- ASSERT_GT(fd, 0); \
- EXPECT_DEATH(READ_N_BYTES, \
- ASAN_PCRE_DOTALL \
- "AddressSanitizer: heap-buffer-overflow" \
- ".* is located 0 bytes to the right of 10-byte region"); \
- close(fd); \
- delete [] x; \
-
+#if defined(__linux__) && !defined(ANDROID) && !defined(__ANDROID__)
TEST(AddressSanitizer, pread) {
- READ_TEST(pread(fd, x, 15, 0));
+ char *x = new char[10];
+ int fd = open("/proc/self/stat", O_RDONLY);
+ ASSERT_GT(fd, 0);
+ EXPECT_DEATH(pread(fd, x, 15, 0),
+ ASAN_PCRE_DOTALL
+ "AddressSanitizer: heap-buffer-overflow"
+ ".* is located 0 bytes to the right of 10-byte region");
+ close(fd);
+ delete [] x;
}
TEST(AddressSanitizer, pread64) {
- READ_TEST(pread64(fd, x, 15, 0));
+ char *x = new char[10];
+ int fd = open("/proc/self/stat", O_RDONLY);
+ ASSERT_GT(fd, 0);
+ EXPECT_DEATH(pread64(fd, x, 15, 0),
+ ASAN_PCRE_DOTALL
+ "AddressSanitizer: heap-buffer-overflow"
+ ".* is located 0 bytes to the right of 10-byte region");
+ close(fd);
+ delete [] x;
}
TEST(AddressSanitizer, read) {
- READ_TEST(read(fd, x, 15));
+ char *x = new char[10];
+ int fd = open("/proc/self/stat", O_RDONLY);
+ ASSERT_GT(fd, 0);
+ EXPECT_DEATH(read(fd, x, 15),
+ ASAN_PCRE_DOTALL
+ "AddressSanitizer: heap-buffer-overflow"
+ ".* is located 0 bytes to the right of 10-byte region");
+ close(fd);
+ delete [] x;
}
-#endif // defined(__linux__) && !defined(ANDROID)
+
+#endif // defined(__linux__) && !defined(ANDROID) && !defined(__ANDROID__)
// This test case fails
// Clang optimizes memcpy/memset calls which lead to unaligned access
Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Thu Jan 17 16:51:56 2013
@@ -67,6 +67,30 @@
return res;
}
+INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) {
+ ENSURE_MSAN_INITED();
+ SSIZE_T res = REAL(read)(fd, ptr, count);
+ if (res > 0)
+ __msan_unpoison(ptr, res);
+ return res;
+}
+
+INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) {
+ ENSURE_MSAN_INITED();
+ SSIZE_T res = REAL(pread)(fd, ptr, count, offset);
+ if (res > 0)
+ __msan_unpoison(ptr, res);
+ return res;
+}
+
+INTERCEPTOR(SSIZE_T, pread64, int fd, void *ptr, SIZE_T count, OFF64_T offset) {
+ ENSURE_MSAN_INITED();
+ SSIZE_T res = REAL(pread64)(fd, ptr, count, offset);
+ if (res > 0)
+ __msan_unpoison(ptr, res);
+ return res;
+}
+
INTERCEPTOR(SSIZE_T, readlink, const char *path, char *buf, SIZE_T bufsiz) {
ENSURE_MSAN_INITED();
SSIZE_T res = REAL(readlink)(path, buf, bufsiz);
@@ -735,15 +759,6 @@
return res;
}
-#define COMMON_INTERCEPTOR_WRITE_RANGE(ptr, size) \
- __msan_unpoison(ptr, size)
-#define COMMON_INTERCEPTOR_READ_RANGE(ptr, size) do { } while (false)
-#define COMMON_INTERCEPTOR_ENTER(func, ...) ENSURE_MSAN_INITED()
-#define COMMON_INTERCEPTOR_FD_ACQUIRE(fd) do { } while (false)
-#define COMMON_INTERCEPTOR_FD_RELEASE(fd) do { } while (false)
-#define COMMON_INTERCEPTOR_SET_THREAD_NAME(name) do { } while (false) // FIXME
-#include "sanitizer_common/sanitizer_common_interceptors.h"
-
// static
void *fast_memset(void *ptr, int c, SIZE_T n) {
// hack until we have a really fast internal_memset
@@ -853,8 +868,6 @@
void InitializeInterceptors() {
static int inited = 0;
CHECK_EQ(inited, 0);
- SANITIZER_COMMON_INTERCEPTORS_INIT;
-
INTERCEPT_FUNCTION(mmap);
INTERCEPT_FUNCTION(mmap64);
INTERCEPT_FUNCTION(posix_memalign);
@@ -864,6 +877,9 @@
INTERCEPT_FUNCTION(free);
INTERCEPT_FUNCTION(fread);
INTERCEPT_FUNCTION(fread_unlocked);
+ INTERCEPT_FUNCTION(read);
+ INTERCEPT_FUNCTION(pread);
+ INTERCEPT_FUNCTION(pread64);
INTERCEPT_FUNCTION(readlink);
INTERCEPT_FUNCTION(readdir);
INTERCEPT_FUNCTION(memcpy);
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.h Thu Jan 17 16:51:56 2013
@@ -17,7 +17,6 @@
// COMMON_INTERCEPTOR_WRITE_RANGE
// COMMON_INTERCEPTOR_FD_ACQUIRE
// COMMON_INTERCEPTOR_FD_RELEASE
-// COMMON_INTERCEPTOR_SET_THREAD_NAME
//===----------------------------------------------------------------------===//
#ifndef SANITIZER_COMMON_INTERCEPTORS_H
#define SANITIZER_COMMON_INTERCEPTORS_H
@@ -35,9 +34,6 @@
COMMON_INTERCEPTOR_FD_ACQUIRE(fd);
return res;
}
-# define INIT_READ INTERCEPT_FUNCTION(read)
-#else
-# define INIT_READ
#endif
#if SANITIZER_INTERCEPT_PREAD
@@ -50,9 +46,6 @@
COMMON_INTERCEPTOR_FD_ACQUIRE(fd);
return res;
}
-# define INIT_PREAD INTERCEPT_FUNCTION(pread)
-#else
-# define INIT_PREAD
#endif
#if SANITIZER_INTERCEPT_PREAD64
@@ -65,81 +58,29 @@
COMMON_INTERCEPTOR_FD_ACQUIRE(fd);
return res;
}
-# define INIT_PREAD64 INTERCEPT_FUNCTION(pread64)
-#else
-# define INIT_PREAD64
#endif
-#if SANITIZER_INTERCEPT_WRITE
-INTERCEPTOR(SSIZE_T, write, int fd, void *ptr, SIZE_T count) {
- COMMON_INTERCEPTOR_ENTER(write, fd, ptr, count);
- if (fd >= 0)
- COMMON_INTERCEPTOR_FD_RELEASE(fd);
- SSIZE_T res = REAL(write)(fd, ptr, count);
- if (res > 0)
- COMMON_INTERCEPTOR_READ_RANGE(ptr, res);
- return res;
-}
-# define INIT_WRITE INTERCEPT_FUNCTION(write)
+#if SANITIZER_INTERCEPT_READ
+# define INIT_READ INTERCEPT_FUNCTION(read)
#else
-# define INIT_WRITE
+# define INIT_READ
#endif
-#if SANITIZER_INTERCEPT_PWRITE
-INTERCEPTOR(SSIZE_T, pwrite, int fd, void *ptr, SIZE_T count) {
- COMMON_INTERCEPTOR_ENTER(pwrite, fd, ptr, count);
- if (fd >= 0)
- COMMON_INTERCEPTOR_FD_RELEASE(fd);
- SSIZE_T res = REAL(pwrite)(fd, ptr, count);
- if (res > 0)
- COMMON_INTERCEPTOR_READ_RANGE(ptr, res);
- return res;
-}
-# define INIT_PWRITE INTERCEPT_FUNCTION(pwrite)
+#if SANITIZER_INTERCEPT_PREAD
+# define INIT_PREAD INTERCEPT_FUNCTION(pread)
#else
-# define INIT_PWRITE
+# define INIT_PREAD
#endif
-#if SANITIZER_INTERCEPT_PWRITE64
-INTERCEPTOR(SSIZE_T, pwrite64, int fd, void *ptr, OFF64_T count) {
- COMMON_INTERCEPTOR_ENTER(pwrite64, fd, ptr, count);
- if (fd >= 0)
- COMMON_INTERCEPTOR_FD_RELEASE(fd);
- SSIZE_T res = REAL(pwrite64)(fd, ptr, count);
- if (res > 0)
- COMMON_INTERCEPTOR_READ_RANGE(ptr, res);
- return res;
-}
-# define INIT_PWRITE64 INTERCEPT_FUNCTION(pwrite64)
+#if SANITIZER_INTERCEPT_PREAD64
+# define INIT_PREAD64 INTERCEPT_FUNCTION(pread64)
#else
-# define INIT_PWRITE64
+# define INIT_PREAD64
#endif
-#if SANITIZER_INTERCEPT_PRCTL
-INTERCEPTOR(int, prctl, int option,
- unsigned long arg2, unsigned long arg3, // NOLINT
- unsigned long arg4, unsigned long arg5) { // NOLINT
- COMMON_INTERCEPTOR_ENTER(prctl, option, arg2, arg3, arg4, arg5);
- static const int PR_SET_NAME = 15;
- int res = REAL(prctl(option, arg2, arg3, arg4, arg5));
- if (option == PR_SET_NAME) {
- char buff[16];
- internal_strncpy(buff, (char*)arg2, 15);
- buff[15] = 0;
- COMMON_INTERCEPTOR_SET_THREAD_NAME(buff);
- }
- return res;
-}
-# define INIT_PRCTL INTERCEPT_FUNCTION(prctl)
-#else
-# define INIT_PRCTL
-#endif // SANITIZER_INTERCEPT_PRCTL
-
#define SANITIZER_COMMON_INTERCEPTORS_INIT \
INIT_READ; \
INIT_PREAD; \
INIT_PREAD64; \
- INIT_PRCTL; \
- INIT_WRITE; \
#endif // SANITIZER_COMMON_INTERCEPTORS_H
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Thu Jan 17 16:51:56 2013
@@ -15,24 +15,17 @@
#include "sanitizer_internal_defs.h"
#if !defined(_WIN32)
-# define SI_NOT_WINDOWS 1
+# define SANITIZER_INTERCEPT_READ 1
+# define SANITIZER_INTERCEPT_PREAD 1
#else
-# define SI_NOT_WINDOWS 0
+# define SANITIZER_INTERCEPT_READ 0
+# define SANITIZER_INTERCEPT_PREAD 0
#endif
#if defined(__linux__) && !defined(ANDROID)
-# define SI_LINUX_NOT_ANDROID 1
+# define SANITIZER_INTERCEPT_PREAD64 1
#else
-# define SI_LINUX_NOT_ANDROID 0
+# define SANITIZER_INTERCEPT_PREAD64 0
#endif
-# define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS
-# define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS
-# define SANITIZER_INTERCEPT_WRITE SI_NOT_WINDOWS
-# define SANITIZER_INTERCEPT_PWRITE SI_NOT_WINDOWS
-
-# define SANITIZER_INTERCEPT_PREAD64 SI_LINUX_NOT_ANDROID
-# define SANITIZER_INTERCEPT_PWRITE64 SI_LINUX_NOT_ANDROID
-# define SANITIZER_INTERCEPT_PRCTL SI_LINUX_NOT_ANDROID
-
Removed: compiler-rt/trunk/lib/tsan/lit_tests/race_on_write.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/race_on_write.cc?rev=172762&view=auto
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/race_on_write.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/race_on_write.cc (removed)
@@ -1,39 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-int fd;
-char buf;
-
-void *Thread1(void *x) {
- buf = 1;
- sleep(1);
- return NULL;
-}
-
-void *Thread2(void *x) {
- write(fd, &buf, 1);
- return NULL;
-}
-
-int main() {
- fd = open("/dev/null", O_WRONLY);
- if (fd < 0) return 1;
- pthread_t t[2];
- pthread_create(&t[0], NULL, Thread1, NULL);
- sleep(1);
- pthread_create(&t[1], NULL, Thread2, NULL);
- pthread_join(t[0], NULL);
- pthread_join(t[1], NULL);
- close(fd);
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Read of size 1
-// CHECK: #0 write
-// CHECK: Previous write of size 1
-// CHECK: #0 Thread1
Modified: compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/thread_name.cc Thu Jan 17 16:51:56 2013
@@ -15,7 +15,8 @@
}
void *Thread2(void *x) {
- pthread_setname_np(pthread_self(), "Thread2");
+ AnnotateThreadName(__FILE__, __LINE__, "Thread2");
+ // TODO: pthread_setname_np(pthread_self(), "Thread2");
Global--;
return NULL;
}
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Thu Jan 17 16:51:56 2013
@@ -1259,6 +1259,30 @@
return res;
}
+TSAN_INTERCEPTOR(long_t, write, int fd, void *buf, long_t sz) {
+ SCOPED_TSAN_INTERCEPTOR(write, fd, buf, sz);
+ if (fd >= 0)
+ FdRelease(thr, pc, fd);
+ int res = REAL(write)(fd, buf, sz);
+ return res;
+}
+
+TSAN_INTERCEPTOR(long_t, pwrite, int fd, void *buf, long_t sz, unsigned off) {
+ SCOPED_TSAN_INTERCEPTOR(pwrite, fd, buf, sz, off);
+ if (fd >= 0)
+ FdRelease(thr, pc, fd);
+ int res = REAL(pwrite)(fd, buf, sz, off);
+ return res;
+}
+
+TSAN_INTERCEPTOR(long_t, pwrite64, int fd, void *buf, long_t sz, u64 off) {
+ SCOPED_TSAN_INTERCEPTOR(pwrite64, fd, buf, sz, off);
+ if (fd >= 0)
+ FdRelease(thr, pc, fd);
+ int res = REAL(pwrite64)(fd, buf, sz, off);
+ return res;
+}
+
TSAN_INTERCEPTOR(long_t, writev, int fd, void *vec, int cnt) {
SCOPED_TSAN_INTERCEPTOR(writev, fd, vec, cnt);
if (fd >= 0)
@@ -1599,10 +1623,9 @@
#define COMMON_INTERCEPTOR_READ_RANGE(ptr, size) \
MemoryAccessRange(thr, pc, (uptr)ptr, size, false)
#define COMMON_INTERCEPTOR_ENTER(func, ...) \
- SCOPED_TSAN_INTERCEPTOR(func, __VA_ARGS__)
+ SCOPED_TSAN_INTERCEPTOR(func, __VA_ARGS__)
#define COMMON_INTERCEPTOR_FD_ACQUIRE(fd) FdAcquire(thr, pc, fd)
#define COMMON_INTERCEPTOR_FD_RELEASE(fd) FdRelease(thr, pc, fd)
-#define COMMON_INTERCEPTOR_SET_THREAD_NAME(name) ThreadSetName(thr, name)
#include "sanitizer_common/sanitizer_common_interceptors.h"
namespace __tsan {
@@ -1775,6 +1798,9 @@
TSAN_INTERCEPT(readv);
TSAN_INTERCEPT(preadv64);
+ TSAN_INTERCEPT(write);
+ TSAN_INTERCEPT(pwrite);
+ TSAN_INTERCEPT(pwrite64);
TSAN_INTERCEPT(writev);
TSAN_INTERCEPT(pwritev64);
TSAN_INTERCEPT(send);
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc Thu Jan 17 16:51:56 2013
@@ -204,7 +204,6 @@
name[StatInt_pipe] = " pipe ";
name[StatInt_pipe2] = " pipe2 ";
name[StatInt_read] = " read ";
- name[StatInt_prctl] = " prctl ";
name[StatInt_pread] = " pread ";
name[StatInt_pread64] = " pread64 ";
name[StatInt_readv] = " readv ";
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h?rev=172763&r1=172762&r2=172763&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h Thu Jan 17 16:51:56 2013
@@ -199,7 +199,6 @@
StatInt_pipe,
StatInt_pipe2,
StatInt_read,
- StatInt_prctl,
StatInt_pread,
StatInt_pread64,
StatInt_readv,
More information about the llvm-commits
mailing list