-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[tsan] Export __cxa_guard_ interceptors from TSan runtime. #171921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
These functions from C++ ABI are defined in compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp and are supposed to replace implementations from libstdc++/libc++abi. We need to export them similar to why we need to export other interceptors and TSan runtime functions - e.g. if a dlopen-ed shared library depends on __cxa_guard_acquire, it needs to pick up the exported definition from the TSan runtime that was linked into the main executable calling the dlopen() However, because the __cxa_guard_ functions don't use traditional interceptor machinery, they are omitted from the auto-generated libclang_rt.tsan.a.syms files. Fix this by adding them to tsan.syms.extra file explicitly.
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Alexey Samsonov (vonosmas) ChangesThese functions from C++ ABI are defined in We need to export them similar to why we need to export other interceptors and TSan runtime functions - e.g. if a dlopen-ed shared library depends on However, because the Full diff: https://github.com/llvm/llvm-project/pull/171921.diff 1 Files Affected:
diff --git a/compiler-rt/lib/tsan/rtl/tsan.syms.extra b/compiler-rt/lib/tsan/rtl/tsan.syms.extra
index 6416e5d47fc41..03d17d21e74e8 100644
--- a/compiler-rt/lib/tsan/rtl/tsan.syms.extra
+++ b/compiler-rt/lib/tsan/rtl/tsan.syms.extra
@@ -1,3 +1,6 @@
+__cxa_guard_acquire
+__cxa_guard_abort
+__cxa_guard_release
__tsan_init
__tsan_flush_memory
__tsan_read*
|
🐧 Linux x64 Test Results
✅ The build succeeded and all tests passed. |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/18020 Here is the relevant piece of the build log for the reference |
These functions from C++ ABI are defined in compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp and are supposed to replace implementations from libstdc++/libc++abi. We need to export them similar to why we need to export other interceptors and TSan runtime functions - e.g. if a dlopen-ed shared library depends on `__cxa_guard_acquire`, it needs to pick up the exported definition from the TSan runtime that was linked into the main executable calling the dlopen() However, because the `__cxa_guard_` functions don't use traditional interceptor machinery, they are omitted from the auto-generated `libclang_rt.tsan.a.syms` files. Fix this by adding them to tsan.syms.extra file explicitly. Co-authored-by: Vitaly Buka <[email protected]>
These functions from C++ ABI are defined in
compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp and are supposed to replace implementations from libstdc++/libc++abi.
We need to export them similar to why we need to export other interceptors and TSan runtime functions - e.g. if a dlopen-ed shared library depends on
__cxa_guard_acquire, it needs to pick up the exported definition from the TSan runtime that was linked into the main executable calling the dlopen()However, because the
__cxa_guard_functions don't use traditional interceptor machinery, they are omitted from the auto-generatedlibclang_rt.tsan.a.symsfiles. Fix this by adding them to tsan.syms.extra file explicitly.