https://bugs.llvm.org/show_bug.cgi?id=41095
Bug ID: 41095
Summary: interceptors for __pthread_mutex_(un)lock should wrap
__pthread_mutex_lock but actually call
pthread_mutex_lock
Product: compiler-rt
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: asan
Assignee: unassignedb...@nondot.org
Reporter: r...@ocallahan.org
CC: llvm-bugs@lists.llvm.org
https://github.com/llvm-project/llvm-project-20170507/commit/0a6efb6b61cba4040646e634c89c81ce38512d4d#diff-84c56a2db2415e80a9250fcf8679f462R4057
#if SANITIZER_INTERCEPT___PTHREAD_MUTEX
INTERCEPTOR(int, __pthread_mutex_lock, void *m) {
return WRAP(pthread_mutex_lock)(m);
}
This doesn't look right to me. I think it should call
WRAP(__pthread_mutex_lock).
This matters in practice because rr wraps pthread_mutex_lock to modify mutex
state and then call __pthread_mutex_lock. When recording an ASAN application,
ASAN intercepts __pthread_mutex_lock to delegate to pthread_mutex_lock, which
ends up back at rr's override. So we're in an infinite loop.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs