Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-11376

[C++] ThreadedTaskGroup failure with Thread Sanitizer enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0
    • C++

    Description

      With ARROW_USE_TSAN=on, I get the following error:

      WARNING: ThreadSanitizer: data race (pid=53750)
        Write of size 1 at 0x7ffc241c5833 by thread T45:
          #0 operator() ../src/arrow/util/task_group_test.cc:88 (arrow-threading-utility-test+0xec0cb)
          #1 _M_invoke /usr/include/c++/9/bits/std_function.h:286 (arrow-threading-utility-test+0xf085b)
          #2 std::function<arrow::Status ()>::operator()() const /usr/include/c++/9/bits/std_function.h:688 (libarrow.so.300+0x120842a)
          #3 arrow::internal::ThreadedTaskGroup::AppendReal(std::function<arrow::Status ()>)::{lambda(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&)#1}::operator()(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&) const ../src/arrow/util/task_group.cc:90 (libarrow.so.300+0x12078b5)
          #4 void std::__invoke_impl<void, arrow::internal::ThreadedTaskGroup::AppendReal(std::function<arrow::Status ()>)::{lambda(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&)#1}&, std::shared_ptr<arrow::internal::ThreadedTaskGroup>&, std::function<arrow::Status ()>&>(std::__invoke_other, arrow::internal::ThreadedTaskGroup::AppendReal(std::function<arrow::Status ()>)::{lambda(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&)#1}&, std::shared_ptr<arrow::internal::ThreadedTaskGroup>&, std::function<arrow::Status ()>&) /usr/include/c++/9/bits/invoke.h:60 (libarrow.so.300+0x120a57e)
          #5 std::__invoke_result<arrow::internal::ThreadedTaskGroup::AppendReal(std::function<arrow::Status ()>)::{lambda(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&)#1}&, std::shared_ptr<arrow::internal::ThreadedTaskGroup>&, std::function<arrow::Status ()>&>::type std::__invoke<arrow::internal::ThreadedTaskGroup::AppendReal(std::function<arrow::Status ()>)::{lambda(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&)#1}&, std::shared_ptr<arrow::internal::ThreadedTaskGroup>&, std::function<arrow::Status ()>&>(std::__invoke_result&&, (arrow::internal::ThreadedTaskGroup::AppendReal(std::function<arrow::Status ()>)::{lambda(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&)#1}&)...) /usr/include/c++/9/bits/invoke.h:95 (libarrow.so.300+0x120a435)
          #6 void std::_Bind<arrow::internal::ThreadedTaskGroup::AppendReal(std::function<arrow::Status ()>)::{lambda(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&)#1} (std::shared_ptr<arrow::internal::ThreadedTaskGroup>, std::function<arrow::Status ()>)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) /usr/include/c++/9/functional:400 (libarrow.so.300+0x120a28d)
          #7 void std::_Bind<arrow::internal::ThreadedTaskGroup::AppendReal(std::function<arrow::Status ()>)::{lambda(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&)#1} (std::shared_ptr<arrow::internal::ThreadedTaskGroup>, std::function<arrow::Status ()>)>::operator()<, void>() /usr/include/c++/9/functional:484 (libarrow.so.300+0x120a1bf)
          #8 arrow::internal::FnOnce<void ()>::FnImpl<std::_Bind<arrow::internal::ThreadedTaskGroup::AppendReal(std::function<arrow::Status ()>)::{lambda(std::shared_ptr<arrow::internal::ThreadedTaskGroup> const&, std::function<arrow::Status ()> const&)#1} (std::shared_ptr<arrow::internal::ThreadedTaskGroup>, std::function<arrow::Status ()>)> >::invoke() ../src/arrow/util/functional.h:122 (libarrow.so.300+0x120a154)
          #9 arrow::internal::FnOnce<void ()>::operator()() && ../src/arrow/util/functional.h:110 (libarrow.so.300+0x11ba0cf)
          #10 WorkerLoop ../src/arrow/util/thread_pool.cc:90 (libarrow.so.300+0x120a8bf)
          #11 operator() ../src/arrow/util/thread_pool.cc:227 (libarrow.so.300+0x120b7ef)
          #12 __invoke_impl<void, arrow::internal::ThreadPool::LaunchWorkersUnlocked(int)::<lambda()> > /usr/include/c++/9/bits/invoke.h:60 (libarrow.so.300+0x120cf59)
          #13 __invoke<arrow::internal::ThreadPool::LaunchWorkersUnlocked(int)::<lambda()> > /usr/include/c++/9/bits/invoke.h:95 (libarrow.so.300+0x120ceac)
          #14 _M_invoke<0> /usr/include/c++/9/thread:244 (libarrow.so.300+0x120cdfc)
          #15 operator() /usr/include/c++/9/thread:251 (libarrow.so.300+0x120cd8d)
          #16 _M_run /usr/include/c++/9/thread:195 (libarrow.so.300+0x120cd34)
          #17 execute_native_thread_routine /home/conda/feedstock_root/build_artifacts/ctng-compilers_1601682258120/work/.build/x86_64-conda-linux-gnu/src/gcc/libstdc++-v3/src/c++11/thread.cc:80 (libstdc++.so.6+0xc9066)
      
        Previous read of size 1 at 0x7ffc241c5833 by main thread:
          #0 testing::AssertionResult::AssertionResult<bool>(bool const&, std::enable_if<!std::is_convertible<bool, testing::AssertionResult>::value, void>::type*) /home/antoine/miniconda3/envs/pyarrow/include/gtest/gtest.h:299 (arrow-threading-utility-test+0x63bba)
          #1 arrow::internal::TestTaskGroupErrors(std::shared_ptr<arrow::internal::TaskGroup>) ../src/arrow/util/task_group_test.cc:100 (arrow-threading-utility-test+0xec284)
          #2 arrow::internal::ThreadedTaskGroup_Errors_Test::TestBody() ../src/arrow/util/task_group_test.cc:266 (arrow-threading-utility-test+0xee40d)
          #3 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) <null> (libgtest.so+0x4c98d)
      
      

      It looks like the test is faulty.

      Attachments

        Issue Links

          Activity

            People

              westonpace Weston Pace
              apitrou Antoine Pitrou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m