| Issue |
178096
|
| Summary |
Clang and LLVM tests fail under TSan
|
| Labels |
clang,
compiler-rt:tsan,
llvm
|
| Assignees |
|
| Reporter |
ilovepi
|
I ran check-clang and check-llvm under Tsan for the first time in a while, and see that there are several failures in both test suites. I recall running this the last time either last April or maybe in late September. Are these known/tracked issues?
I'm including one of the errors below from clang-scan-deps, which seems disproportionately affected, based on the number of test failures. I do still see errors int he LLVM tests and unit tests under TSan.
The stack trace seems to indicate that there's a race w/ the destructor running in the main thread, which AFAICT shouldn't be possible. Someone that looks at TSan failures more might have a bit more insight.
Error:
```
********************
FAIL: Clang :: ClangScanDeps/strip-codegen-args.m (3714 of 23873)
******************** TEST 'Clang :: ClangScanDeps/strip-codegen-args.m' FAILED ********************
Exit Code: 66
Command Output (stdout):
--
# RUN: at line 1
rm -rf /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp
# executed command: rm -rf /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp
# RUN: at line 2
split-file /usr/local/google/home/paulkirth/llvm-fork/clang/test/ClangScanDeps/strip-codegen-args.m /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp
# executed command: split-file /usr/local/google/home/paulkirth/llvm-fork/clang/test/ClangScanDeps/strip-codegen-args.m /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp
# RUN: at line 3
sed -e "s|DIR|/usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp|g" /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/cdb1.json.template > /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/cdb1.json
# executed command: sed -e 's|DIR|/usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp|g' /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/cdb1.json.template
# RUN: at line 5
/usr/local/google/home/paulkirth/llvm-fork/build/bin/clang-scan-deps -compilation-database /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/cdb1.json -format experimental-full > /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/result1.txt
# executed command: /usr/local/google/home/paulkirth/llvm-fork/build/bin/clang-scan-deps -compilation-database /usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/cdb1.json -format experimental-full
# .---redirected output from '/usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/result1.txt'
# | {
# | "modules": [
# | {
# | "clang-module-deps": [],
# | "clang-modulemap-file": "/usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/modules/A/module.modulemap",
# | "command-line": [
# | "-cc1",
# | "-ferror-limit",
# | "19",
# | "-o",
# | "/usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/module-cache/D3YJALQADLMO6IDV7HKSHU6I6/A-D3YJALQADLMO6IDV7HKSHU6I6.pcm",
# | "-disable-free",
# | "-emit-module",
# | "-x",
# | "objective-c",
# | "/usr/local/google/home/paulkirth/llvm-fork/build/tools/clang/test/ClangScanDeps/Output/strip-codegen-args.m.tmp/modules/A/module.modulemap",
# | "-tune-cpu",
# | "generic",
# | "-target-cpu",
# | "x86-64",
# | "-triple",
# | "x86_64-unknown-linux-gnu",
# | "-fmodules-validate-system-headers",
# | "-fno-modules-prune-non-affecting-module-map-files",
# | "-resource-dir",
# |
# | ...
# `---data was truncated--------
# .---command stderr------------
# | YAML:17:3: error: Expected , between entries!
# | {
# | ^
# | ==================
# | WARNING: ThreadSanitizer: data race (pid=3573090)
# | Write of size 8 at 0x721c000009a0 by main thread:
# | #0 operator delete(void*, unsigned long, std::align_val_t) ../../../../../../llvm-llvm-project/compiler-rt/lib/tsan/rtl/tsan_new_delete.cpp:190:3 (llvm+0x34e1a58) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #1 llvm::deallocate_buffer(void*, unsigned long, unsigned long) /usr/local/google/home/paulkirth/llvm-fork/llvm/lib/Support/MemAlloc.cpp:28:3 (llvm+0xc75a679) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #2 llvm::detail::UniqueFunctionBase<void>::~UniqueFunctionBase() /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/ADT/FunctionExtras.h:285:7 (llvm+0x353f8be) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #3 std::__2::__tuple_leaf<0ul, llvm::unique_function<void ()>, false>::~__tuple_leaf() /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/tuple:368:7 (llvm+0x353f8be)
# | #4 std::__2::tuple<llvm::unique_function<void ()>>::~tuple() /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/tuple:580:34 (llvm+0x353f8be)
# | #5 std::__2::__async_func<llvm::unique_function<void ()>>::~__async_func() /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/future:1834:22 (llvm+0x353f8be)
# | #6 std::__2::__deferred_assoc_state<void, std::__2::__async_func<llvm::unique_function<void ()>>>::~__deferred_assoc_state() /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/future:770:7 (llvm+0x353f8be)
# | #7 std::__2::__deferred_assoc_state<void, std::__2::__async_func<llvm::unique_function<void ()>>>::~__deferred_assoc_state() /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/future:770:7 (llvm+0x353f8be)
# | #8 clang_scan_deps_main(int, char**, llvm::ToolContext const&) /usr/local/google/home/paulkirth/llvm-fork/clang/tools/clang-scan-deps/ClangScanDeps.cpp:1157:7 (llvm+0x350e4d7) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #9 findTool(int, char**, char const*) /usr/local/google/home/paulkirth/llvm-fork/build/tools/llvm-driver/LLVMDriverTools.def:39:1 (llvm+0x3a06f57) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #10 main /usr/local/google/home/paulkirth/llvm-fork/llvm/tools/llvm-driver/llvm-driver.cpp:85:10 (llvm+0x3a06656) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# |
# | Previous read of size 8 at 0x721c000009a0 by thread T4:
# | #0 clang_scan_deps_main(int, char**, llvm::ToolContext const&)::$_3::operator()(clang::dependencies::DependencyScanningService&) const /usr/local/google/home/paulkirth/llvm-fork/clang/tools/clang-scan-deps/ClangScanDeps.cpp:988:35 (llvm+0x350f66e) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #1 clang_scan_deps_main(int, char**, llvm::ToolContext const&)::$_4::operator()() const /usr/local/google/home/paulkirth/llvm-fork/clang/tools/clang-scan-deps/ClangScanDeps.cpp:1157:47 (llvm+0x353fa56) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #2 void llvm::detail::UniqueFunctionBase<void>::CallImpl<clang_scan_deps_main(int, char**, llvm::ToolContext const&)::$_4>(void*) /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/ADT/FunctionExtras.h:212:12 (llvm+0x353fa56)
# | #3 llvm::unique_function<void ()>::operator()() /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/ADT/FunctionExtras.h:364:12 (llvm+0x353f966) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #4 std::__2::__invoke_result_impl<void, llvm::unique_function<void ()>>::type std::__2::__invoke[abi:nn220000]<llvm::unique_function<void ()>>(llvm::unique_function<void ()>&&) /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/__type_traits/invoke.h:90:27 (llvm+0x353f966)
# | #5 void std::__2::__async_func<llvm::unique_function<void ()>>::__execute[abi:nn220000]<0ul>(std::__2::__integer_sequence<unsigned long, 0ul>) /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/future:1850:12 (llvm+0x353f966)
# | #6 std::__2::__async_func<llvm::unique_function<void ()>>::operator()[abi:nn220000]() /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/future:1845:51 (llvm+0x353f966)
# | #7 std::__2::__deferred_assoc_state<void, std::__2::__async_func<llvm::unique_function<void ()>>>::__execute() /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/future:821:5 (llvm+0x353f966)
# | #8 std::__2::shared_future<void>::wait[abi:nn220000]() const /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/future:2034:55 (llvm+0x353f9a1) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #9 std::__2::shared_future<void> llvm::ThreadPoolInterface::asyncImpl<void>(llvm::unique_function<void ()>, llvm::ThreadPoolTaskGroup*)::'lambda'()::operator()() const /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/Support/ThreadPool.h:116:38 (llvm+0x353f9a1)
# | #10 void llvm::detail::UniqueFunctionBase<void>::CallImpl<std::__2::shared_future<void> llvm::ThreadPoolInterface::asyncImpl<void>(llvm::unique_function<void ()>, llvm::ThreadPoolTaskGroup*)::'lambda'()>(void*) /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/ADT/FunctionExtras.h:212:12 (llvm+0x353f9a1)
# | #11 llvm::unique_function<void ()>::operator()() /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/ADT/FunctionExtras.h:364:12 (llvm+0xc7a1b6e) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #12 llvm::StdThreadPool::processTasks(llvm::ThreadPoolTaskGroup*) /usr/local/google/home/paulkirth/llvm-fork/llvm/lib/Support/ThreadPool.cpp:119:5 (llvm+0xc7a1b6e)
# | #13 llvm::StdThreadPool::grow(int)::$_0::operator()() const /usr/local/google/home/paulkirth/llvm-fork/llvm/lib/Support/ThreadPool.cpp:62:9 (llvm+0xc7a51b7) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #14 auto void llvm::thread::GenericThreadProxy<std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>>(void*)::'lambda'(auto&&, auto&&...)::operator()<llvm::StdThreadPool::grow(int)::$_0&>(auto&&, auto&&...) const /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/Support/thread.h:46:11 (llvm+0xc7a51b7)
# | #15 std::__2::__invoke_result_impl<void, void llvm::thread::GenericThreadProxy<std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>>(void*)::'lambda'(auto&&, auto&&...), llvm::StdThreadPool::grow(int)::$_0&>::type std::__2::__invoke[abi:nn220000]<void llvm::thread::GenericThreadProxy<std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>>(void*)::'lambda'(auto&&, auto&&...), llvm::StdThreadPool::grow(int)::$_0&>(void llvm::thread::GenericThreadProxy<std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>>(void*)::'lambda'(auto&&, auto&&...)&&, llvm::StdThreadPool::grow(int)::$_0&) /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/__type_traits/invoke.h:90:27 (llvm+0xc7a51b7)
# | #16 decltype(auto) std::__2::__apply_tuple_impl[abi:nn220000]<void llvm::thread::GenericThreadProxy<std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>>(void*)::'lambda'(auto&&, auto&&...), std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>&, 0ul>(auto&&, std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>&, std::__2::integer_sequence<unsigned long, 0ul>) /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/tuple:1401:5 (llvm+0xc7a51b7)
# | #17 decltype(auto) std::__2::apply[abi:nn220000]<void llvm::thread::GenericThreadProxy<std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>>(void*)::'lambda'(auto&&, auto&&...), std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>&>(auto&&, std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>&) /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/tuple:1405:5 (llvm+0xc7a51b7)
# | #18 void llvm::thread::GenericThreadProxy<std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>>(void*) /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/Support/thread.h:44:5 (llvm+0xc7a51b7)
# | #19 void* llvm::thread::ThreadProxy<std::__2::tuple<llvm::StdThreadPool::grow(int)::$_0>>(void*) /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/Support/thread.h:62:5 (llvm+0xc7a51b7)
# |
# | Thread T4 'llvm-worker-3' (tid=3573363, running) created by main thread at:
# | #0 pthread_create ../../../../../../llvm-llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1075:3 (llvm+0x345f11a) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #1 llvm::llvm_execute_on_thread_impl(void* (*)(void*), void*, std::__2::optional<unsigned int>) /usr/local/google/home/paulkirth/llvm-fork/llvm/lib/Support/Unix/Threading.inc:95:17 (llvm+0xc8324b5) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #2 llvm::thread::thread<llvm::StdThreadPool::grow(int)::$_0&>(std::__2::optional<unsigned int>, llvm::StdThreadPool::grow(int)::$_0&) /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/Support/thread.h:138:12 (llvm+0xc7a124f) (BuildId: 8fac594a806d2a8a01a2101c57cdb487de731a91)
# | #3 llvm::thread::thread<llvm::StdThreadPool::grow(int)::$_0>(llvm::StdThreadPool::grow(int)::$_0&&) /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/Support/thread.h:85:9 (llvm+0xc7a124f)
# | #4 void std::__2::allocator<llvm::thread>::construct[abi:nn220000]<llvm::thread, llvm::StdThreadPool::grow(int)::$_0>(llvm::thread*, llvm::StdThreadPool::grow(int)::$_0&&) /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/__memory/allocator.h:153:24 (llvm+0xc7a124f)
# | #5 void std::__2::allocator_traits<std::__2::allocator<llvm::thread>>::construct[abi:nn220000]<llvm::thread, llvm::StdThreadPool::grow(int)::$_0, 0>(std::__2::allocator<llvm::thread>&, llvm::thread*, llvm::StdThreadPool::grow(int)::$_0&&) /usr/local/google/home/paulkirth/fuchsia/prebuilt/third_party/clang/linux-x64/bin/../include/c++/v1/__memory/allocator_traits.h:296:9 (llvm+0xc7a124f)
# | #6 void std::__2::vector<llvm::thread, std::__2::allocator<llvm::thread>>::__emplace_back_assume_capacity[abi:nn220000]<llvm::StdThreadPool::grow(int)::$_0>(llvm::StdThreadPool::grow(int)::$_0&&) /usr/local/g<truncated>Please see the issue for the entire body.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs