Details
- Reviewers
eugenis dvyukov - Commits
- rG75e01fa00bed: [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock
rGe5bd32682242: [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock
rL332320: [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock
rCRT332320: [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock
rCRT332268: [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock
rL332268: [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock
Diff Detail
- Repository
- rCRT Compiler Runtime
Event Timeline
Interesting. Who calls these functions? Why? Can we change them to call normal functions instead?
In pthread they are no more than aliases to normal functions, can we do it with aliases too? like we do it for __libc_mutex_lock:
sanitizer_common/sanitizer_common_interceptors.inc-INTERCEPTOR(int, __libc_mutex_lock, void *m) \
sanitizer_common/sanitizer_common_interceptors.inc: ALIAS(WRAPPER_NAME(pthread_mutex_lock));
I've cc'd you on the internal bug.
In pthread they are no more than aliases to normal functions, can we do it with aliases too? like we do it for __libc_mutex_lock:
sanitizer_common/sanitizer_common_interceptors.inc-INTERCEPTOR(int, __libc_mutex_lock, void *m) \
sanitizer_common/sanitizer_common_interceptors.inc: ALIAS(WRAPPER_NAME(pthread_mutex_lock));
Alias version works.
I need to fall back to "return WRAP(pthread_mutex_lock)(m)"
I've forgot to rerun tsan tests with ALIAS. With ALIAS stacks became __pthread_mutex_lock for regular pthread_mutex_lock calls which breaks some tests.