forked from OSchip/llvm-project
tsan: intercept longjmp() but die in it, greatly simplifies problem diagnostic
llvm-svn: 157760
This commit is contained in:
parent
21d6ec9224
commit
95a5c5ca4c
|
@ -235,6 +235,18 @@ TSAN_INTERCEPTOR(int, atexit, void (*f)()) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
TSAN_INTERCEPTOR(void, longjmp, void *env, int val) {
|
||||
SCOPED_TSAN_INTERCEPTOR(longjmp, env, val);
|
||||
Printf("ThreadSanitizer: longjmp() is not supported\n");
|
||||
Die();
|
||||
}
|
||||
|
||||
TSAN_INTERCEPTOR(void, siglongjmp, void *env, int val) {
|
||||
SCOPED_TSAN_INTERCEPTOR(siglongjmp, env, val);
|
||||
Printf("ThreadSanitizer: siglongjmp() is not supported\n");
|
||||
Die();
|
||||
}
|
||||
|
||||
static uptr fd2addr(int fd) {
|
||||
(void)fd;
|
||||
static u64 addr;
|
||||
|
@ -1370,6 +1382,9 @@ void InitializeInterceptors() {
|
|||
REAL(memset) = poormans_memset;
|
||||
REAL(memcpy) = poormans_memcpy;
|
||||
|
||||
TSAN_INTERCEPT(longjmp);
|
||||
TSAN_INTERCEPT(siglongjmp);
|
||||
|
||||
TSAN_INTERCEPT(malloc);
|
||||
TSAN_INTERCEPT(calloc);
|
||||
TSAN_INTERCEPT(realloc);
|
||||
|
|
|
@ -91,6 +91,8 @@ void StatOutput(u64 *stat) {
|
|||
name[StatAtomic8] = " size 8 ";
|
||||
|
||||
name[StatInterceptor] = "Interceptors ";
|
||||
name[StatInt_longjmp] = " longjmp ";
|
||||
name[StatInt_siglongjmp] = " siglongjmp ";
|
||||
name[StatInt_malloc] = " malloc ";
|
||||
name[StatInt_calloc] = " calloc ";
|
||||
name[StatInt_realloc] = " realloc ";
|
||||
|
|
|
@ -91,6 +91,8 @@ enum StatType {
|
|||
|
||||
// Interceptors.
|
||||
StatInterceptor,
|
||||
StatInt_longjmp,
|
||||
StatInt_siglongjmp,
|
||||
StatInt_malloc,
|
||||
StatInt_calloc,
|
||||
StatInt_realloc,
|
||||
|
|
Loading…
Reference in New Issue