[compiler-rt] r177637 - tsan: intercept abort() to fflush() libc streams
Dmitry Vyukov
dvyukov at google.com
Thu Mar 21 05:50:43 PDT 2013
Author: dvyukov
Date: Thu Mar 21 07:50:43 2013
New Revision: 177637
URL: http://llvm.org/viewvc/llvm-project?rev=177637&view=rev
Log:
tsan: intercept abort() to fflush() libc streams
Modified:
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/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=177637&r1=177636&r2=177637&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Thu Mar 21 07:50:43 2013
@@ -1520,6 +1520,12 @@ TSAN_INTERCEPTOR(int, fflush, void *stre
return REAL(fflush)(stream);
}
+TSAN_INTERCEPTOR(void, abort, int fake) {
+ SCOPED_TSAN_INTERCEPTOR(abort, fake);
+ REAL(fflush)(0);
+ REAL(abort)(fake);
+}
+
TSAN_INTERCEPTOR(int, puts, const char *s) {
SCOPED_TSAN_INTERCEPTOR(puts, s);
MemoryAccessRange(thr, pc, (uptr)s, internal_strlen(s), false);
@@ -1981,6 +1987,7 @@ void InitializeInterceptors() {
TSAN_INTERCEPT(fread);
TSAN_INTERCEPT(fwrite);
TSAN_INTERCEPT(fflush);
+ TSAN_INTERCEPT(abort);
TSAN_INTERCEPT(puts);
TSAN_INTERCEPT(rmdir);
TSAN_INTERCEPT(opendir);
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=177637&r1=177636&r2=177637&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc Thu Mar 21 07:50:43 2013
@@ -243,6 +243,7 @@ void StatOutput(u64 *stat) {
name[StatInt_fread] = " fread ";
name[StatInt_fwrite] = " fwrite ";
name[StatInt_fflush] = " fflush ";
+ name[StatInt_abort] = " abort ";
name[StatInt_puts] = " puts ";
name[StatInt_rmdir] = " rmdir ";
name[StatInt_opendir] = " opendir ";
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=177637&r1=177636&r2=177637&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h Thu Mar 21 07:50:43 2013
@@ -238,6 +238,7 @@ enum StatType {
StatInt_fread,
StatInt_fwrite,
StatInt_fflush,
+ StatInt_abort,
StatInt_puts,
StatInt_rmdir,
StatInt_opendir,
More information about the llvm-commits
mailing list