NVIDIA/stdexec

gcc TSAN failure in `tbb_thread_pool`: "data race on vptr" in `task` ctor

ericniebler opened this issue · 6 comments

The tbb_thread_pool exceptions test is failing with a TSAN error. gcc 13.1, Debug, -fsanitize=thread.

[ctest] ==================
[ctest] WARNING: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call) (pid=304135)
[ctest]   Write of size 8 at 0x7fc87d30bd00 by main thread:
[ctest]     #0 tbb::detail::d1::task::task() /usr/include/oneapi/tbb/detail/_task.h:214 (test.stdexec+0xcc6ea4) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #1 tbb::detail::d1::enqueue_task<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>::enqueue_task(tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}&&, tbb::detail::d1::small_object_allocator&) /usr/include/oneapi/tbb/task_arena.h:234 (test.stdexec+0xcc6fa0) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #2 tbb::detail::d1::enqueue_task<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>* tbb::detail::d1::small_object_allocator::new_object<tbb::detail::d1::enqueue_task<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>, tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}, tbb::detail::d1::small_object_allocator&>(tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}&&, tbb::detail::d1::small_object_allocator&) /usr/include/oneapi/tbb/detail/_small_object_pool.h:63 (test.stdexec+0xcc5246) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #3 void tbb::detail::d1::enqueue_impl<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>(tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}&&, tbb::detail::d1::task_arena_base*) /usr/include/oneapi/tbb/task_arena.h:240 (test.stdexec+0xcc326a) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #4 void tbb::detail::d1::task_arena::enqueue<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>(tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}&&) /usr/include/oneapi/tbb/task_arena.h:389 (test.stdexec+0xcc17a7) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #5 tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int) /home/eniebler/Code/stdexec/include/tbbexec/tbb_thread_pool.hpp:524 (test.stdexec+0xcbf9d7) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #6 enqueue /home/eniebler/Code/stdexec/include/tbbexec/tbb_thread_pool.hpp:490 (test.stdexec+0xc91f33) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #7 tag_invoke /home/eniebler/Code/stdexec/include/tbbexec/tbb_thread_pool.hpp:494 (test.stdexec+0xc90c36) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #8 operator()<stdexec::__start::start_t, tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t&> /home/eniebler/Code/stdexec/include/stdexec/__detail/../functional.hpp:347 (test.stdexec+0xc8e966) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #9 operator()<tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t> /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:1174 (test.stdexec+0xc8e966)
[ctest]     #10 operator()<> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:189 (test.stdexec+0xc8e966)
[ctest]     #11 operator()<tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:363 (test.stdexec+0xc8e9ff) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #12 operator()<stdexec::__detail::tag_invoke<stdexec::__start::start_t>(stdexec::__start::start_t, __op_state<stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, __receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t>&)::<lambda(auto:55& ...)>, stdexec::__tup::__tuple<std::integer_sequence<long unsigned int, 0>*, tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t>&, 0, tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t> /home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:81 (test.stdexec+0xc900ba) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #13 __apply<stdexec::__detail::tag_invoke<stdexec::__start::start_t>(stdexec::__start::start_t, __op_state<stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, __receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t>&)::<lambda(auto:55& ...)>, stdexec::__tup::__tuple<std::integer_sequence<long unsigned int, 0>*, tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t>&> /home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:91 (test.stdexec+0xc89a15) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #14 tag_invoke<stdexec::__start::start_t> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:361 (test.stdexec+0xc89a15)
[ctest]     #15 operator()<stdexec::__start::start_t, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t>&> /home/eniebler/Code/stdexec/include/stdexec/__detail/../functional.hpp:347 (test.stdexec+0xc89a15)
[ctest]     #16 operator()<stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:1174 (test.stdexec+0xc89a15)
[ctest]     #17 operator()<> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:189 (test.stdexec+0xc89a15)
[ctest]     #18 operator()<stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> > /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:363 (test.stdexec+0xc89ab3) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #19 operator()<stdexec::__detail::tag_invoke<stdexec::__start::start_t>(stdexec::__start::start_t, __op_state<stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__sync_wait::__receiver<int>::__t>&)::<lambda(auto:55& ...)>, stdexec::__tup::__tuple<std::integer_sequence<long unsigned int, 0>*, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> >&, 0, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> > /home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:81 (test.stdexec+0xc8d1cc) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #20 __apply<stdexec::__detail::tag_invoke<stdexec::__start::start_t>(stdexec::__start::start_t, __op_state<stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__sync_wait::__receiver<int>::__t>&)::<lambda(auto:55& ...)>, stdexec::__tup::__tuple<std::integer_sequence<long unsigned int, 0>*, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<int>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> >&> /home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:91 (test.stdexec+0xc83130) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #21 tag_invoke<stdexec::__start::start_t> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:361 (test.stdexec+0xc83130)
[ctest]     #22 operator()<stdexec::__start::start_t, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__sync_wait::__receiver<int>::__t>&> /home/eniebler/Code/stdexec/include/stdexec/__detail/../functional.hpp:347 (test.stdexec+0xc83130)
[ctest]     #23 operator()<stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__sync_wait::__receiver<int>::__t> > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:1174 (test.stdexec+0xc83130)
[ctest]     #24 apply_sender<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> > > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:5553 (test.stdexec+0xc83130)
[ctest]     #25 apply_sender<stdexec::__sync_wait::sync_wait_t, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> > > /home/eniebler/Code/stdexec/include/stdexec/__detail/__domain.hpp:119 (test.stdexec+0xc83310) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #26 operator()<stdexec::default_domain, stdexec::__sync_wait::sync_wait_t, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> > > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:700 (test.stdexec+0xc83310)
[ctest]     #27 operator()<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> > > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:5523 (test.stdexec+0xc83310)
[ctest]     #28 ____C_A_T_C_H____T_E_S_T____4 /home/eniebler/Code/stdexec/test/tbbexec/test_tbb_thread_pool.cpp:151 (test.stdexec+0xc7bc8a) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #29 Catch::TestInvokerAsFunction::invoke() const /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:14317 (test.stdexec+0x425cc) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #30 Catch::TestCase::invoke() const /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:14156 (test.stdexec+0x412c4) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #31 Catch::RunContext::invokeActiveTestCase() /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:13016 (test.stdexec+0x39a15) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #32 Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:12989 (test.stdexec+0x39642) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #33 Catch::RunContext::runTest(Catch::TestCase const&) /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:12750 (test.stdexec+0x376bf) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #34 execute /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:13343 (test.stdexec+0x3bbc0) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #35 Catch::Session::runInternal() /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:13549 (test.stdexec+0x3d4c6) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #36 Catch::Session::run() /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:13505 (test.stdexec+0x3d096) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #37 int Catch::Session::run<char>(int, char const* const*) <null> (test.stdexec+0x9ce11) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #38 main /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:17504 (test.stdexec+0x59f02) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest] 
[ctest]   Previous write of size 8 at 0x7fc87d30bd00 by thread T2:
[ctest]     #0 tbb::detail::d1::task::~task() /usr/include/oneapi/tbb/detail/_task.h:216 (test.stdexec+0xcc6f14) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #1 tbb::detail::d1::enqueue_task<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>::~enqueue_task() /usr/include/oneapi/tbb/task_arena.h:216 (test.stdexec+0xcca149) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #2 void tbb::detail::d1::small_object_allocator::delete_object<tbb::detail::d1::enqueue_task<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}> >(tbb::detail::d1::enqueue_task<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>*, tbb::detail::d1::execution_data const&) /usr/include/oneapi/tbb/detail/_small_object_pool.h:72 (test.stdexec+0xcca8c7) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #3 tbb::detail::d1::enqueue_task<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>::finalize(tbb::detail::d1::execution_data const&) /usr/include/oneapi/tbb/task_arena.h:221 (test.stdexec+0xcca659) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #4 tbb::detail::d1::enqueue_task<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>::execute(tbb::detail::d1::execution_data&) /usr/include/oneapi/tbb/task_arena.h:225 (test.stdexec+0xcca1df) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #5 <null> <null> (libtbb.so.12+0x20b3b) (BuildId: 3337fe835c644cbbf5154b0b2dbdcedb9b8a3ee2)
[ctest] 
[ctest]   Thread T2 (tid=304140, running) created by main thread at:
[ctest]     #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:1036 (libtsan.so.2+0x3d179) (BuildId: 5e151fac359cd43a07192270fb85f74e380f2fc8)
[ctest]     #1 <null> <null> (libtbb.so.12+0x2243b) (BuildId: 3337fe835c644cbbf5154b0b2dbdcedb9b8a3ee2)
[ctest]     #2 void tbb::detail::d1::task_arena::enqueue<tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}>(tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int)::{lambda()#1}&&) /usr/include/oneapi/tbb/task_arena.h:389 (test.stdexec+0xcc17a7) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #3 tbbexec::tbb_thread_pool::enqueue(exec::_pool_::task_base*, unsigned int) /home/eniebler/Code/stdexec/include/tbbexec/tbb_thread_pool.hpp:524 (test.stdexec+0xcbf9d7) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #4 enqueue /home/eniebler/Code/stdexec/include/tbbexec/tbb_thread_pool.hpp:490 (test.stdexec+0xc91c3f) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #5 tag_invoke /home/eniebler/Code/stdexec/include/tbbexec/tbb_thread_pool.hpp:494 (test.stdexec+0xc90a40) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #6 operator()<stdexec::__start::start_t, tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t&> /home/eniebler/Code/stdexec/include/stdexec/__detail/../functional.hpp:347 (test.stdexec+0xc8e5ce) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #7 operator()<tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t> /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:1174 (test.stdexec+0xc8e5ce)
[ctest]     #8 operator()<> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:189 (test.stdexec+0xc8e5ce)
[ctest]     #9 operator()<tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:363 (test.stdexec+0xc8e667) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #10 operator()<stdexec::__detail::tag_invoke<stdexec::__start::start_t>(stdexec::__start::start_t, __op_state<stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, __receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t>&)::<lambda(auto:55& ...)>, stdexec::__tup::__tuple<std::integer_sequence<long unsigned int, 0>*, tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t>&, 0, tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t> /home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:81 (test.stdexec+0xc8fefe) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #11 __apply<stdexec::__detail::tag_invoke<stdexec::__start::start_t>(stdexec::__start::start_t, __op_state<stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, __receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t>&)::<lambda(auto:55& ...)>, stdexec::__tup::__tuple<std::integer_sequence<long unsigned int, 0>*, tbbexec::detail::operation<tbbexec::tbb_thread_pool, stdexec::__detail::__receiver<stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*> >::__t>&> /home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:91 (test.stdexec+0xc89759) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #12 tag_invoke<stdexec::__start::start_t> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:361 (test.stdexec+0xc89759)
[ctest]     #13 operator()<stdexec::__start::start_t, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t>&> /home/eniebler/Code/stdexec/include/stdexec/__detail/../functional.hpp:347 (test.stdexec+0xc89759)
[ctest]     #14 operator()<stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:1174 (test.stdexec+0xc89759)
[ctest]     #15 operator()<> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:189 (test.stdexec+0xc89759)
[ctest]     #16 operator()<stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> > /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:363 (test.stdexec+0xc897f7) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #17 operator()<stdexec::__detail::tag_invoke<stdexec::__start::start_t>(stdexec::__start::start_t, __op_state<stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__sync_wait::__receiver<>::__t>&)::<lambda(auto:55& ...)>, stdexec::__tup::__tuple<std::integer_sequence<long unsigned int, 0>*, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> >&, 0, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> > /home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:81 (test.stdexec+0xc8cf1c) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #18 __apply<stdexec::__detail::tag_invoke<stdexec::__start::start_t>(stdexec::__start::start_t, __op_state<stdexec::__sexpr<(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__sync_wait::__receiver<>::__t>&)::<lambda(auto:55& ...)>, stdexec::__tup::__tuple<std::integer_sequence<long unsigned int, 0>*, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__detail::__receiver<stdexec::__sync_wait::__receiver<>, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__mconstant_<0>*>::__t> >&> /home/eniebler/Code/stdexec/include/stdexec/__detail/__tuple.hpp:91 (test.stdexec+0xc8275f) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #19 tag_invoke<stdexec::__start::start_t> /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:361 (test.stdexec+0xc8275f)
[ctest]     #20 operator()<stdexec::__start::start_t, stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__sync_wait::__receiver<>::__t>&> /home/eniebler/Code/stdexec/include/stdexec/__detail/../functional.hpp:347 (test.stdexec+0xc8275f)
[ctest]     #21 operator()<stdexec::__detail::__op_state<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> >, stdexec::__sync_wait::__receiver<>::__t> > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:1174 (test.stdexec+0xc8275f)
[ctest]     #22 apply_sender<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> > > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:5553 (test.stdexec+0xc8275f)
[ctest]     #23 apply_sender<stdexec::__sync_wait::sync_wait_t, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> > > /home/eniebler/Code/stdexec/include/stdexec/__detail/__domain.hpp:119 (test.stdexec+0xc82968) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #24 operator()<stdexec::default_domain, stdexec::__sync_wait::sync_wait_t, stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> > > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:700 (test.stdexec+0xc82968)
[ctest]     #25 operator()<stdexec::__sexpr<stdexec::__detail::(anonymous namespace)::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> > > /home/eniebler/Code/stdexec/include/stdexec/execution.hpp:5523 (test.stdexec+0xc82968)
[ctest]     #26 ____C_A_T_C_H____T_E_S_T____4 /home/eniebler/Code/stdexec/test/tbbexec/test_tbb_thread_pool.cpp:143 (test.stdexec+0xc7b815) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #27 Catch::TestInvokerAsFunction::invoke() const /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:14317 (test.stdexec+0x425cc) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #28 Catch::TestCase::invoke() const /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:14156 (test.stdexec+0x412c4) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #29 Catch::RunContext::invokeActiveTestCase() /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:13016 (test.stdexec+0x39a15) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #30 Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:12989 (test.stdexec+0x39642) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #31 Catch::RunContext::runTest(Catch::TestCase const&) /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:12750 (test.stdexec+0x376bf) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #32 execute /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:13343 (test.stdexec+0x3bbc0) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #33 Catch::Session::runInternal() /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:13549 (test.stdexec+0x3d4c6) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #34 Catch::Session::run() /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:13505 (test.stdexec+0x3d096) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #35 int Catch::Session::run<char>(int, char const* const*) <null> (test.stdexec+0x9ce11) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest]     #36 main /home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include/catch2/catch.hpp:17504 (test.stdexec+0x59f02) (BuildId: 815504a06a5b1a1688eea45af30aab057ba83c99)
[ctest] 
[ctest] SUMMARY: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call) /usr/include/oneapi/tbb/detail/_task.h:214 in tbb::detail::d1::task::task()
[ctest] ==================

@BenFrantzDale, do you think you could take a look at this?

maikel commented

Is tbb compiled with tsan enabled? If not then thats the reason.

TBB has TSAN support. You should use -DTBB_SANITIZE=thread during build to enable it.

Like this?

[build] [114/115  95% :: 15.569] /usr/bin/g++-13 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING \
  -DTBB_USE_DEBUG -I/home/eniebler/Code/stdexec/test -I/home/eniebler/Code/stdexec/include \
  -I"/home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include" \
  -fsanitize=thread -ftemplate-backtrace-limit=0 -DTBB_SANITIZE=thread -g -std=c++20 \
  -fcoroutines -fconcepts-diagnostics-depth=10 -Wall -Wno-non-template-friend -MD \
  -MT test/CMakeFiles/test.stdexec.dir/tbbexec/test_tbb_thread_pool.cpp.o
  -MF test/CMakeFiles/test.stdexec.dir/tbbexec/test_tbb_thread_pool.cpp.o.d \
  -o test/CMakeFiles/test.stdexec.dir/tbbexec/test_tbb_thread_pool.cpp.o \
  -c /home/eniebler/Code/stdexec/test/tbbexec/test_tbb_thread_pool.cpp

Still fails for me. 🤔

maikel commented

Like this?

[build] [114/115  95% :: 15.569] /usr/bin/g++-13 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING \
  -DTBB_USE_DEBUG -I/home/eniebler/Code/stdexec/test -I/home/eniebler/Code/stdexec/include \
  -I"/home/eniebler/Code/stdexec/build/GCC 13.1 x86_64-linux-gnu/Debug/_deps/catch2-src/single_include" \
  -fsanitize=thread -ftemplate-backtrace-limit=0 -DTBB_SANITIZE=thread -g -std=c++20 \
  -fcoroutines -fconcepts-diagnostics-depth=10 -Wall -Wno-non-template-friend -MD \
  -MT test/CMakeFiles/test.stdexec.dir/tbbexec/test_tbb_thread_pool.cpp.o
  -MF test/CMakeFiles/test.stdexec.dir/tbbexec/test_tbb_thread_pool.cpp.o.d \
  -o test/CMakeFiles/test.stdexec.dir/tbbexec/test_tbb_thread_pool.cpp.o \
  -c /home/eniebler/Code/stdexec/test/tbbexec/test_tbb_thread_pool.cpp

Still fails for me. 🤔

No, you need to use a compiled tbb library that has tsan enabled. Instead of installing some tbb shared library from aptitude you need to compile and link tbb itself. Afaik, same goes for asan.

Bah. Too much trouble. I will assume that this is user error and close.