Skip to content

ThreadSanitizer: data race on replica_path in DatabaseReplicated #92315

@nikitamikhaylov

Description

@nikitamikhaylov

Describe the bug

E   Exception: Sanitizer assert found for instance ==================
E   WARNING: ThreadSanitizer: data race (pid=10)
E     Read of size 1 at 0x72600001131f by thread T678:
E       #0 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::__is_long[abi:ne210105]() const ci/tmp/build/./contrib/llvm-project/libcxx/include/string:2095:23 (clickhouse+0x1e56a382) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #1 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::__get_pointer[abi:ne210105]() const ci/tmp/build/./contrib/llvm-project/libcxx/include/string:2236:12 (clickhouse+0x1e56a382)
E       #2 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::data[abi:ne210105]() const ci/tmp/build/./contrib/llvm-project/libcxx/include/string:1770:30 (clickhouse+0x1e56a382)
E       #3 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::operator std::__1::basic_string_view<char, std::__1::char_traits<char>>[abi:ne210105]() const ci/tmp/build/./contrib/llvm-project/libcxx/include/string:1211:64 (clickhouse+0x1e56a382)
E       #4 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> std::__1::operator+[abi:ne210105]<char, std::__1::char_traits<char>, std::__1::allocator<char>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, char const*) ci/tmp/build/./contrib/llvm-project/libcxx/include/string:3759:77 (clickhouse+0x1e56a382)
E       #5 DB::DatabaseReplicatedDDLWorker::initializeReplication() ci/tmp/build/./src/Databases/DatabaseReplicatedWorker.cpp:172:64 (clickhouse+0x1e56a382)
E       #6 DB::DatabaseReplicatedDDLWorker::initializeMainThread() ci/tmp/build/./src/Databases/DatabaseReplicatedWorker.cpp:117:13 (clickhouse+0x1e568651) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #7 DB::DDLWorker::runMainThread() ci/tmp/build/./src/Interpreters/DDLWorker.cpp:1213:22 (clickhouse+0x1fbaadfc) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #8 std::__1::__invoke_result_impl<void, void (DB::DDLWorker::*&)(), DB::DDLWorker*&>::type std::__1::__invoke[abi:ne210105]<void (DB::DDLWorker::*&)(), DB::DDLWorker*&>(void (DB::DDLWorker::*&)(), DB::DDLWorker*&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__type_traits/invoke.h (clickhouse+0x1fbda084) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #9 decltype(auto) std::__1::__apply_tuple_impl[abi:ne210105]<void (DB::DDLWorker::*&)(), std::__1::tuple<DB::DDLWorker*>&, 0ul>(void (DB::DDLWorker::*&)(), std::__1::tuple<DB::DDLWorker*>&, std::__1::__tuple_indices<0ul>) ci/tmp/build/./contrib/llvm-project/libcxx/include/tuple:1380:5 (clickhouse+0x1fbda084)
E       #10 decltype(auto) std::__1::apply[abi:ne210105]<void (DB::DDLWorker::*&)(), std::__1::tuple<DB::DDLWorker*>&>(void (DB::DDLWorker::*&)(), std::__1::tuple<DB::DDLWorker*>&) ci/tmp/build/./contrib/llvm-project/libcxx/include/tuple:1384:5 (clickhouse+0x1fbda084)
E       #11 ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::DDLWorker::*)(), DB::DDLWorker*>(void (DB::DDLWorker::*&&)(), DB::DDLWorker*&&)::'lambda'()::operator()() ci/tmp/build/./src/Common/ThreadPool.h:312:13 (clickhouse+0x1fbda084)
E       #12 std::__1::__invoke_result_impl<void, ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::DDLWorker::*)(), DB::DDLWorker*>(void (DB::DDLWorker::*&&)(), DB::DDLWorker*&&)::'lambda'()&>::type std::__1::__invoke[abi:ne210105]<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::DDLWorker::*)(), DB::DDLWorker*>(void (DB::DDLWorker::*&&)(), DB::DDLWorker*&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::DDLWorker::*)(), DB::DDLWorker*>(void (DB::DDLWorker::*&&)(), DB::DDLWorker*&&)::'lambda'()&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:87:27 (clickhouse+0x1fbd9fa1) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #13 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ne210105]<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::DDLWorker::*)(), DB::DDLWorker*>(void (DB::DDLWorker::*&&)(), DB::DDLWorker*&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::DDLWorker::*)(), DB::DDLWorker*>(void (DB::DDLWorker::*&&)(), DB::DDLWorker*&&)::'lambda'()&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:342:5 (clickhouse+0x1fbd9fa1)
E       #14 void (DB::DDLWorker::*std::__1::__invoke_r[abi:ne210105]<void, ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::DDLWorker::*)(), DB::DDLWorker*>(void (DB::DDLWorker::*&&)(), DB::DDLWorker*&&)::'lambda'()&>(DB::DDLWorker*&&))() ci/tmp/build/./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:348:10 (clickhouse+0x1fbd9fa1)
E       #15 void std::__1::__function::__policy_func<void ()>::__call_func[abi:ne210105]<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<void (DB::DDLWorker::*)(), DB::DDLWorker*>(void (DB::DDLWorker::*&&)(), DB::DDLWorker*&&)::'lambda'()>(std::__1::__function::__policy_storage const*) ci/tmp/build/./contrib/llvm-project/libcxx/include/__functional/function.h:450:12 (clickhouse+0x1fbd9fa1)
E       #16 std::__1::__function::__policy_func<void ()>::operator()[abi:ne210105]() const ci/tmp/build/./contrib/llvm-project/libcxx/include/__functional/function.h:508:12 (clickhouse+0x161c58f0) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #17 std::__1::function<void ()>::operator()() const ci/tmp/build/./contrib/llvm-project/libcxx/include/__functional/function.h:772:10 (clickhouse+0x161c58f0)
E       #18 ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::worker() ci/tmp/build/./src/Common/ThreadPool.cpp:811:17 (clickhouse+0x161c58f0)
E       #19 std::__1::__invoke_result_impl<void, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>::type std::__1::__invoke[abi:ne210105]<void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>(void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*&&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__type_traits/invoke.h (clickhouse+0x161cf9db) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #20 void std::__1::__thread_execute[abi:ne210105]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>&, std::__1::__tuple_indices<2ul>) ci/tmp/build/./contrib/llvm-project/libcxx/include/__thread/thread.h:159:3 (clickhouse+0x161cf9db)
E       #21 void* std::__1::__thread_proxy[abi:ne210105]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>>(void*) ci/tmp/build/./contrib/llvm-project/libcxx/include/__thread/thread.h:168:3 (clickhouse+0x161cf9db)
E   
E     Previous write of size 8 at 0x726000011318 by thread T5:
E       #0 __tsan_memcpy /home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_memintrinsics.cpp:27:3 (clickhouse+0x9b26b3e) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #1 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::__move_assign[abi:ne210105](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::integral_constant<bool, true>) ci/tmp/build/./contrib/llvm-project/libcxx/include/string:2926:10 (clickhouse+0x1e50c552) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #2 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::operator=[abi:ne210105](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&&) ci/tmp/build/./contrib/llvm-project/libcxx/include/string:1229:5 (clickhouse+0x1e50c552)
E       #3 DB::DatabaseReplicated::tryConnectToZooKeeperAndInitDatabase(DB::LoadingStrictnessLevel) ci/tmp/build/./src/Databases/DatabaseReplicated.cpp:551:22 (clickhouse+0x1e50c552)
E       #4 DB::DatabaseReplicated::restoreDatabaseMetadataInKeeper(std::__1::shared_ptr<DB::Context const>) ci/tmp/build/./src/Databases/DatabaseReplicated.cpp:1926:5 (clickhouse+0x1e549527) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #5 DB::InterpreterSystemQuery::restoreDatabaseReplica(DB::ASTSystemQuery&) ci/tmp/build/./src/Interpreters/InterpreterSystemQuery.cpp:1044:20 (clickhouse+0x2040aabb) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #6 DB::InterpreterSystemQuery::execute() ci/tmp/build/./src/Interpreters/InterpreterSystemQuery.cpp:849:13 (clickhouse+0x203f3f61) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #7 DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer>>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::ImplicitTransactionControlExecutor>, std::__1::function<void ()>, DB::QueryResultDetails&) ci/tmp/build/./src/Interpreters/executeQuery.cpp:1738:40 (clickhouse+0x2039fc2b) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #8 DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) ci/tmp/build/./src/Interpreters/executeQuery.cpp:1959:11 (clickhouse+0x203982ce) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #9 DB::TCPHandler::runImpl() ci/tmp/build/./src/Server/TCPHandler.cpp:776:68 (clickhouse+0x261f3835) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #10 DB::TCPHandler::run() ci/tmp/build/./src/Server/TCPHandler.cpp:2866:9 (clickhouse+0x26222ba7) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #11 Poco::Net::TCPServerConnection::start() ci/tmp/build/./base/poco/Net/src/TCPServerConnection.cpp:40:3 (clickhouse+0x2ebc8be2) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #12 Poco::Net::TCPServerDispatcher::run() ci/tmp/build/./base/poco/Net/src/TCPServerDispatcher.cpp:115:38 (clickhouse+0x2ebc9501) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #13 Poco::PooledThread::run() ci/tmp/build/./base/poco/Foundation/src/ThreadPool.cpp:205:14 (clickhouse+0x2eb2b4d0) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #14 Poco::(anonymous namespace)::RunnableHolder::run() ci/tmp/build/./base/poco/Foundation/src/Thread.cpp:45:11 (clickhouse+0x2eb295af) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #15 Poco::ThreadImpl::runnableEntry(void*) ci/tmp/build/./base/poco/Foundation/src/Thread_POSIX.cpp:341:27 (clickhouse+0x2eb27849) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E   
E     Location is heap block of size 968 at 0x726000011000 allocated by thread T5:
E       #0 operator new(unsigned long) /home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_new_delete.cpp:64:3 (clickhouse+0x9baea42) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #1 std::__1::__shared_ptr_emplace<DB::DatabaseReplicated, std::__1::allocator<DB::DatabaseReplicated>>* std::__1::__libcpp_allocate[abi:ne210105]<std::__1::__shared_ptr_emplace<DB::DatabaseReplicated, std::__1::allocator<DB::DatabaseReplicated>>>(std::__1::__element_count, unsigned long) ci/tmp/build/./contrib/llvm-project/libcxx/include/__new/allocate.h:43:28 (clickhouse+0x1e55b7f6) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #2 std::__1::allocator<std::__1::__shared_ptr_emplace<DB::DatabaseReplicated, std::__1::allocator<DB::DatabaseReplicated>>>::allocate[abi:ne210105](unsigned long) ci/tmp/build/./contrib/llvm-project/libcxx/include/__memory/allocator.h:105:14 (clickhouse+0x1e55b7f6)
E       #3 std::__1::allocator_traits<std::__1::allocator<std::__1::__shared_ptr_emplace<DB::DatabaseReplicated, std::__1::allocator<DB::DatabaseReplicated>>>>::allocate[abi:ne210105](std::__1::allocator<std::__1::__shared_ptr_emplace<DB::DatabaseReplicated, std::__1::allocator<DB::DatabaseReplicated>>>&, unsigned long) ci/tmp/build/./contrib/llvm-project/libcxx/include/__memory/allocator_traits.h:259:16 (clickhouse+0x1e55b7f6)
E       #4 std::__1::__allocation_guard<std::__1::allocator<std::__1::__shared_ptr_emplace<DB::DatabaseReplicated, std::__1::allocator<DB::DatabaseReplicated>>>>::__allocation_guard[abi:ne210105]<std::__1::allocator<DB::DatabaseReplicated>>(std::__1::allocator<DB::DatabaseReplicated>, unsigned long) ci/tmp/build/./contrib/llvm-project/libcxx/include/__memory/allocation_guard.h:55:16 (clickhouse+0x1e55b7f6)
E       #5 std::__1::shared_ptr<DB::DatabaseReplicated> std::__1::allocate_shared[abi:ne210105]<DB::DatabaseReplicated, std::__1::allocator<DB::DatabaseReplicated>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, StrongTypedef<wide::integer<128ul, unsigned int>, DB::UUIDTag> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, DB::DatabaseReplicatedSettings, std::__1::shared_ptr<DB::Context const>&, 0>(std::__1::allocator<DB::DatabaseReplicated> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, StrongTypedef<wide::integer<128ul, unsigned int>, DB::UUIDTag> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, DB::DatabaseReplicatedSettings&&, std::__1::shared_ptr<DB::Context const>&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:735:46 (clickhouse+0x1e55b7f6)
E       #6 std::__1::shared_ptr<DB::DatabaseReplicated> std::__1::make_shared[abi:ne210105]<DB::DatabaseReplicated, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, StrongTypedef<wide::integer<128ul, unsigned int>, DB::UUIDTag> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, DB::DatabaseReplicatedSettings, std::__1::shared_ptr<DB::Context const>&, 0>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, StrongTypedef<wide::integer<128ul, unsigned int>, DB::UUIDTag> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, DB::DatabaseReplicatedSettings&&, std::__1::shared_ptr<DB::Context const>&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:744:10 (clickhouse+0x1e556a0a) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #7 DB::registerDatabaseReplicated(DB::DatabaseFactory&)::$_0::operator()(DB::DatabaseFactory::Arguments const&) const ci/tmp/build/./src/Databases/DatabaseReplicated.cpp:2482:16 (clickhouse+0x1e556a0a)
E       #8 std::__1::__invoke_result_impl<void, DB::registerDatabaseReplicated(DB::DatabaseFactory&)::$_0&, DB::DatabaseFactory::Arguments const&>::type std::__1::__invoke[abi:ne210105]<DB::registerDatabaseReplicated(DB::DatabaseFactory&)::$_0&, DB::DatabaseFactory::Arguments const&>(DB::registerDatabaseReplicated(DB::DatabaseFactory&)::$_0&, DB::DatabaseFactory::Arguments const&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:87:27 (clickhouse+0x1e556a0a)
E       #9 std::__1::shared_ptr<DB::IDatabase> std::__1::__invoke_void_return_wrapper<std::__1::shared_ptr<DB::IDatabase>, false>::__call[abi:ne210105]<DB::registerDatabaseReplicated(DB::DatabaseFactory&)::$_0&, DB::DatabaseFactory::Arguments const&>(DB::registerDatabaseReplicated(DB::DatabaseFactory&)::$_0&, DB::DatabaseFactory::Arguments const&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:334:12 (clickhouse+0x1e556a0a)
E       #10 std::__1::shared_ptr<DB::IDatabase> std::__1::__invoke_r[abi:ne210105]<std::__1::shared_ptr<DB::IDatabase>, DB::registerDatabaseReplicated(DB::DatabaseFactory&)::$_0&, DB::DatabaseFactory::Arguments const&>(DB::registerDatabaseReplicated(DB::DatabaseFactory&)::$_0&, DB::DatabaseFactory::Arguments const&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:348:10 (clickhouse+0x1e556a0a)
E       #11 std::__1::shared_ptr<DB::IDatabase> std::__1::__function::__policy_func<std::__1::shared_ptr<DB::IDatabase> (DB::DatabaseFactory::Arguments const&)>::__call_func[abi:ne210105]<DB::registerDatabaseReplicated(DB::DatabaseFactory&)::$_0>(std::__1::__function::__policy_storage const*, DB::DatabaseFactory::Arguments const&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__functional/function.h:450:12 (clickhouse+0x1e556a0a)
E       #12 std::__1::__function::__policy_func<std::__1::shared_ptr<DB::IDatabase> (DB::DatabaseFactory::Arguments const&)>::operator()[abi:ne210105](DB::DatabaseFactory::Arguments const&) const ci/tmp/build/./contrib/llvm-project/libcxx/include/__functional/function.h:508:12 (clickhouse+0x1e4a9fd6) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #13 std::__1::function<std::__1::shared_ptr<DB::IDatabase> (DB::DatabaseFactory::Arguments const&)>::operator()(DB::DatabaseFactory::Arguments const&) const ci/tmp/build/./contrib/llvm-project/libcxx/include/__functional/function.h:772:10 (clickhouse+0x1e4a9fd6)
E       #14 DB::DatabaseFactory::getImpl(DB::ASTCreateQuery const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::Context const>) ci/tmp/build/./src/Databases/DatabaseFactory.cpp:163:12 (clickhouse+0x1e4a9fd6)
E       #15 DB::DatabaseFactory::get(DB::ASTCreateQuery const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::Context const>) ci/tmp/build/./src/Databases/DatabaseFactory.cpp:116:24 (clickhouse+0x1e4a96ca) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #16 DB::InterpreterCreateQuery::createDatabase(DB::ASTCreateQuery&) ci/tmp/build/./src/Interpreters/InterpreterCreateQuery.cpp:325:56 (clickhouse+0x1fd3ada8) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #17 DB::InterpreterCreateQuery::execute() ci/tmp/build/./src/Interpreters/InterpreterCreateQuery.cpp:2392:16 (clickhouse+0x1fd680bd) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #18 DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer>>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::ImplicitTransactionControlExecutor>, std::__1::function<void ()>, DB::QueryResultDetails&) ci/tmp/build/./src/Interpreters/executeQuery.cpp:1738:40 (clickhouse+0x2039fc2b) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #19 DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) ci/tmp/build/./src/Interpreters/executeQuery.cpp:1959:11 (clickhouse+0x203982ce) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #20 DB::TCPHandler::runImpl() ci/tmp/build/./src/Server/TCPHandler.cpp:776:68 (clickhouse+0x261f3835) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #21 DB::TCPHandler::run() ci/tmp/build/./src/Server/TCPHandler.cpp:2866:9 (clickhouse+0x26222ba7) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #22 Poco::Net::TCPServerConnection::start() ci/tmp/build/./base/poco/Net/src/TCPServerConnection.cpp:40:3 (clickhouse+0x2ebc8be2) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #23 Poco::Net::TCPServerDispatcher::run() ci/tmp/build/./base/poco/Net/src/TCPServerDispatcher.cpp:115:38 (clickhouse+0x2ebc9501) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #24 Poco::PooledThread::run() ci/tmp/build/./base/poco/Foundation/src/ThreadPool.cpp:205:14 (clickhouse+0x2eb2b4d0) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #25 Poco::(anonymous namespace)::RunnableHolder::run() ci/tmp/build/./base/poco/Foundation/src/Thread.cpp:45:11 (clickhouse+0x2eb295af) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #26 Poco::ThreadImpl::runnableEntry(void*) ci/tmp/build/./base/poco/Foundation/src/Thread_POSIX.cpp:341:27 (clickhouse+0x2eb27849) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E   
E     Thread T678 'DDLWorker' (tid=691, running) created by thread T5 at:
E       #0 pthread_create /home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1090:3 (clickhouse+0x9b2b49a) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #1 std::__1::__libcpp_thread_create[abi:ne210105](unsigned long*, void* (*)(void*), void*) ci/tmp/build/./contrib/llvm-project/libcxx/include/__thread/support/pthread.h:182:10 (clickhouse+0x161c6b95) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #2 std::__1::thread::thread[abi:ne210105]<void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*, 0>(void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*&&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__thread/thread.h:213:16 (clickhouse+0x161c6b95)
E       #3 ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::ThreadFromThreadPool(ThreadPoolImpl<std::__1::thread>&) ci/tmp/build/./src/Common/ThreadPool.cpp:613:14 (clickhouse+0x161c4fc0) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #4 std::__1::unique_ptr<ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool, std::__1::default_delete<ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool>> std::__1::make_unique[abi:ne210105]<ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool, ThreadPoolImpl<std::__1::thread>&, 0>(ThreadPoolImpl<std::__1::thread>&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:759:30 (clickhouse+0x161c74a4) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #5 void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, Priority, std::__1::optional<unsigned long>, bool) ci/tmp/build/./src/Common/ThreadPool.cpp:299:30 (clickhouse+0x161c74a4)
E       #6 ThreadPoolImpl<std::__1::thread>::scheduleOrThrow(std::__1::function<void ()>, Priority, unsigned long, bool) ci/tmp/build/./src/Common/ThreadPool.cpp:505:5 (clickhouse+0x161cae68) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #7 ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&) ci/tmp/build/./src/Common/ThreadPool.h:279:38 (clickhouse+0x161cae68)
E       #8 ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::ThreadFromThreadPool(ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>&) ci/tmp/build/./src/Common/ThreadPool.cpp:613:14 (clickhouse+0x161c8f6f) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #9 std::__1::unique_ptr<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool, std::__1::default_delete<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool>> std::__1::make_unique[abi:ne210105]<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>&, 0>(ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>&) ci/tmp/build/./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:759:30 (clickhouse+0x161cb9e4) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #10 void ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::scheduleImpl<void>(std::__1::function<void ()>, Priority, std::__1::optional<unsigned long>, bool) ci/tmp/build/./src/Common/ThreadPool.cpp:299:30 (clickhouse+0x161cb9e4)
E       #11 ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::scheduleOrThrowOnError(std::__1::function<void ()>, Priority) ci/tmp/build/./src/Common/ThreadPool.cpp:493:5 (clickhouse+0x161cb800) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #12 DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::__1::unique_lock<std::__1::mutex>&) ci/tmp/build/./src/Common/AsyncLoader.cpp:908:5 (clickhouse+0x164decbe) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #13 DB::AsyncLoader::enqueue(DB::AsyncLoader::Info&, std::__1::shared_ptr<DB::LoadJob> const&, std::__1::unique_lock<std::__1::mutex>&) ci/tmp/build/./src/Common/AsyncLoader.cpp:744:9 (clickhouse+0x164db801) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #14 DB::AsyncLoader::schedule(std::__1::unordered_set<std::__1::shared_ptr<DB::LoadJob>, std::__1::hash<std::__1::shared_ptr<DB::LoadJob>>, std::__1::equal_to<std::__1::shared_ptr<DB::LoadJob>>, std::__1::allocator<std::__1::shared_ptr<DB::LoadJob>>> const&) ci/tmp/build/./src/Common/AsyncLoader.cpp:401:13 (clickhouse+0x164d93d9) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #15 DB::AsyncLoader::schedule(std::__1::vector<std::__1::shared_ptr<DB::LoadTask>, std::__1::allocator<std::__1::shared_ptr<DB::LoadTask>>> const&) ci/tmp/build/./src/Common/AsyncLoader.cpp:332:5 (clickhouse+0x164d9f5e) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #16 DB::scheduleLoad(std::__1::vector<std::__1::shared_ptr<DB::LoadTask>, std::__1::allocator<std::__1::shared_ptr<DB::LoadTask>>> const&) ci/tmp/build/./src/Common/AsyncLoader.h:547:12 (clickhouse+0x164b8684) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #17 DB::waitLoad(std::__1::vector<std::__1::shared_ptr<DB::LoadTask>, std::__1::allocator<std::__1::shared_ptr<DB::LoadTask>>> const&, bool) ci/tmp/build/./src/Common/AsyncLoader.h:565:5 (clickhouse+0x164b8684)
E       #18 DB::waitLoad(unsigned long, std::__1::vector<std::__1::shared_ptr<DB::LoadTask>, std::__1::allocator<std::__1::shared_ptr<DB::LoadTask>>> const&, bool) ci/tmp/build/./src/Common/AsyncLoader.h:602:5 (clickhouse+0x164b8684)
E       #19 DB::InterpreterCreateQuery::createDatabase(DB::ASTCreateQuery&) ci/tmp/build/./src/Interpreters/InterpreterCreateQuery.cpp:379:13 (clickhouse+0x1fd3ba65) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #20 DB::InterpreterCreateQuery::execute() ci/tmp/build/./src/Interpreters/InterpreterCreateQuery.cpp:2392:16 (clickhouse+0x1fd680bd) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #21 DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::__1::unique_ptr<DB::ReadBuffer, std::__1::default_delete<DB::ReadBuffer>>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::ImplicitTransactionControlExecutor>, std::__1::function<void ()>, DB::QueryResultDetails&) ci/tmp/build/./src/Interpreters/executeQuery.cpp:1738:40 (clickhouse+0x2039fc2b) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #22 DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) ci/tmp/build/./src/Interpreters/executeQuery.cpp:1959:11 (clickhouse+0x203982ce) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #23 DB::TCPHandler::runImpl() ci/tmp/build/./src/Server/TCPHandler.cpp:776:68 (clickhouse+0x261f3835) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #24 DB::TCPHandler::run() ci/tmp/build/./src/Server/TCPHandler.cpp:2866:9 (clickhouse+0x26222ba7) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #25 Poco::Net::TCPServerConnection::start() ci/tmp/build/./base/poco/Net/src/TCPServerConnection.cpp:40:3 (clickhouse+0x2ebc8be2) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #26 Poco::Net::TCPServerDispatcher::run() ci/tmp/build/./base/poco/Net/src/TCPServerDispatcher.cpp:115:38 (clickhouse+0x2ebc9501) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #27 Poco::PooledThread::run() ci/tmp/build/./base/poco/Foundation/src/ThreadPool.cpp:205:14 (clickhouse+0x2eb2b4d0) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #28 Poco::(anonymous namespace)::RunnableHolder::run() ci/tmp/build/./base/poco/Foundation/src/Thread.cpp:45:11 (clickhouse+0x2eb295af) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #29 Poco::ThreadImpl::runnableEntry(void*) ci/tmp/build/./base/poco/Foundation/src/Thread_POSIX.cpp:341:27 (clickhouse+0x2eb27849) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E   
E     Thread T5 'TCPHandler' (tid=18, running) created by main thread at:
E       #0 pthread_create /home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1090:3 (clickhouse+0x9b2b49a) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #1 Poco::ThreadImpl::startImpl(Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Runnable>>) ci/tmp/build/./base/poco/Foundation/src/Thread_POSIX.cpp:203:7 (clickhouse+0x2eb27090) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #2 Poco::Thread::start(Poco::Runnable&) ci/tmp/build/./base/poco/Foundation/src/Thread.cpp:118:2 (clickhouse+0x2eb28e6f) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #3 Poco::PooledThread::start() ci/tmp/build/./base/poco/Foundation/src/ThreadPool.cpp:91:10 (clickhouse+0x2eb2ba93) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #4 Poco::ThreadPool::ThreadPool(int, int, int, int, unsigned long, unsigned long) ci/tmp/build/./base/poco/Foundation/src/ThreadPool.cpp:258:12 (clickhouse+0x2eb2ba93)
E       #5 DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) ci/tmp/build/./programs/server/Server.cpp:1337:22 (clickhouse+0x1650ff58) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #6 Poco::Util::Application::run() ci/tmp/build/./base/poco/Util/src/Application.cpp:315:8 (clickhouse+0x2ec04b3e) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #7 DB::Server::run() ci/tmp/build/./programs/server/Server.cpp:657:25 (clickhouse+0x16500b90) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #8 Poco::Util::ServerApplication::run(int, char**) ci/tmp/build/./base/poco/Util/src/ServerApplication.cpp:131:9 (clickhouse+0x2ec254d5) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #9 mainEntryClickHouseServer(int, char**) ci/tmp/build/./programs/server/Server.cpp:444:20 (clickhouse+0x164fcca7) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E       #10 main ci/tmp/build/./programs/main.cpp:380:21 (clickhouse+0x9bb1913) (BuildId: 88aeb12a3408e34970d0d2803e6ab4e4988fb5ec)
E   
E   SUMMARY: ThreadSanitizer: data race ci/tmp/build/./contrib/llvm-project/libcxx/include/string:2095:23 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::__is_long[abi:ne210105]() const

How to reproduce

https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=bc3e79d54e60a6c9cd76ad89a969c9214b3bc44c&name_0=MasterCI&name_1=Integration%20tests%20%28amd_tsan%2C%204%2F6%29&name_1=Integration%20tests%20%28amd_tsan%2C%204%2F6%29

Error message and/or stacktrace

No response

Metadata

Metadata

Labels

testingSpecial issue with list of bugs found by CI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions