Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-5904 Enable ThreadSanitizer for Impala
  3. IMPALA-9307

TSAN data race in kudu::Socket::Accept and TraceLog::UpdateCategoryGroupEnabledFlag

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • Backend
    • None
    • ghx-label-1

    Description

      Several backend tests hit this error in a TSAN build:

      WARNING: ThreadSanitizer: data race (pid=31934)                                                                                                                                                                                                                   [2227/29764]
        Read of size 1 at 0x000007eed485 by thread T344:
          #0 kudu::Socket::Accept(kudu::Socket*, kudu::Sockaddr*, int) /home/systest/Impala/be/src/kudu/util/net/socket.cc:330:684 (unifiedbetests+0x3460726)
          #1 kudu::rpc::AcceptorPool::RunThread() /home/systest/Impala/be/src/kudu/rpc/acceptor_pool.cc:152:24 (unifiedbetests+0x3392bf1)
          #2 boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>::operator()(kudu::rpc::AcceptorPool*) const /home/systest/Impala/toolchain/boost-1.57.0-p3/include/boost/bind/mem_fn_template.hpp:49:16 (unifiedbetests+0x33940f6)
          #3 void boost::_bi::list1<boost::_bi::value<kudu::rpc::AcceptorPool*> >::operator()<boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>&, boost::_bi::list0&, int) /home/systest/I
      mpala/toolchain/boost-1.57.0-p3/include/boost/bind/bind.hpp:253:9 (unifiedbetests+0x339404a)
          #4 boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>, boost::_bi::list1<boost::_bi::value<kudu::rpc::AcceptorPool*> > >::operator()() /home/systest/Impala/toolchain/boost-1.57.0-p3/include/boost/bind/bind_template.hpp:20:16 (unifiedbetests+0x3
      393fd3)
          #5 boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>, boost::_bi::list1<boost::_bi::value<kudu::rpc::AcceptorPool*> > >, void>::invoke(boost::detail::function::function_buffer&) /home/systest
      /Impala/toolchain/boost-1.57.0-p3/include/boost/function/function_template.hpp:153:11 (unifiedbetests+0x3393dc9)
          #6 boost::function0<void>::operator()() const /home/systest/Impala/toolchain/boost-1.57.0-p3/include/boost/function/function_template.hpp:766:14 (unifiedbetests+0x2c22491)
          #7 kudu::Thread::SuperviseThread(void*) /home/systest/Impala/be/src/kudu/util/thread.cc:603:3 (unifiedbetests+0x2c20789)
      
       Previous write of size 1 at 0x000007eed485 by thread T343:
          #0 kudu::debug::TraceLog::UpdateCategoryGroupEnabledFlag(int) /home/systest/Impala/be/src/kudu/util/debug/trace_event_impl.cc:1201:44 (unifiedbetests+0x2bf42e2)
          #1 kudu::debug::TraceLog::GetCategoryGroupEnabledInternal(char const*) /home/systest/Impala/be/src/kudu/util/debug/trace_event_impl.cc:1281:5 (unifiedbetests+0x2bf409c)
          #2 kudu::debug::TraceLog::GetCategoryGroupEnabled(char const*) /home/systest/Impala/be/src/kudu/util/debug/trace_event_impl.cc:1170:20 (unifiedbetests+0x2bf2869)
          #3 kudu::Socket::Accept(kudu::Socket*, kudu::Sockaddr*, int) /home/systest/Impala/be/src/kudu/util/net/socket.cc:330:395 (unifiedbetests+0x34608b8)
          #4 kudu::rpc::AcceptorPool::RunThread() /home/systest/Impala/be/src/kudu/rpc/acceptor_pool.cc:152:24 (unifiedbetests+0x3392bf1)
          #5 boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>::operator()(kudu::rpc::AcceptorPool*) const /home/systest/Impala/toolchain/boost-1.57.0-p3/include/boost/bind/mem_fn_template.hpp:49:16 (unifiedbetests+0x33940f6)
          #6 void boost::_bi::list1<boost::_bi::value<kudu::rpc::AcceptorPool*> >::operator()<boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>&, boost::_bi::list0&, int) /home/systest/I
      mpala/toolchain/boost-1.57.0-p3/include/boost/bind/bind.hpp:253:9 (unifiedbetests+0x339404a)
          #7 boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>, boost::_bi::list1<boost::_bi::value<kudu::rpc::AcceptorPool*> > >::operator()() /home/systest/Impala/toolchain/boost-1.57.0-p3/include/boost/bind/bind_template.hpp:20:16 (unifiedbetests+0x3
      393fd3)
          #8 boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::rpc::AcceptorPool>, boost::_bi::list1<boost::_bi::value<kudu::rpc::AcceptorPool*> > >, void>::invoke(boost::detail::function::function_buffer&) /home/systest
      /Impala/toolchain/boost-1.57.0-p3/include/boost/function/function_template.hpp:153:11 (unifiedbetests+0x3393dc9)
          #9 boost::function0<void>::operator()() const /home/systest/Impala/toolchain/boost-1.57.0-p3/include/boost/function/function_template.hpp:766:14 (unifiedbetests+0x2c22491)
          #10 kudu::Thread::SuperviseThread(void*) /home/systest/Impala/be/src/kudu/util/thread.cc:603:3 (unifiedbetests+0x2c20789)  Location is global 'kudu::debug::(anonymous namespace)::g_category_group_enabled' of size 100 at 0x000007eed480 (unifiedbetests+0x000007eed485)  Thread T344 'acceptor-32306' (tid=32306, running) created by main thread at:
         #0 pthread_create /mnt/source/llvm/llvm-5.0.1.src-p1/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:889 (unifiedbetests+0x1b1b5ab)
          #1 kudu::Thread::StartThread(std::string const&, std::string const&, boost::function<void ()> const&, unsigned long, scoped_refptr<kudu::Thread>*) /home/systest/Impala/be/src/kudu/util/thread.cc:556:15 (unifiedbetests+0x2c201f5)
          #2 kudu::Status kudu::Thread::Create<void (kudu::rpc::AcceptorPool::*)(), kudu::rpc::AcceptorPool*>(std::string const&, std::string const&, void (kudu::rpc::AcceptorPool::* const&)(), kudu::rpc::AcceptorPool* const&, scoped_refptr<kudu::Thread>*) /home/systest/Impal
      a/be/src/kudu/util/thread.h:164:12 (unifiedbetests+0x33933e5)
          #3 kudu::rpc::AcceptorPool::Start(int) /home/systest/Impala/be/src/kudu/rpc/acceptor_pool.cc:85:16 (unifiedbetests+0x339293c)
          #4 impala::RpcMgr::StartServices() /home/systest/Impala/be/src/rpc/rpc-mgr.cc:216:50 (unifiedbetests+0x33bd4b8)
          #5 impala::ExecEnv::StartKrpcService() /home/systest/Impala/be/src/runtime/exec-env.cc:541:53 (unifiedbetests+0x2ccd02a)
          #6 impala::ImpalaServer::Start(int, int, int, int) /home/systest/Impala/be/src/service/impala-server.cc:2467:54 (unifiedbetests+0x2ebf3dc)
          #7 impala::InProcessImpalaServer::StartWithClientServers(int, int, int) /home/systest/Impala/be/src/testutil/in-process-servers.cc:88:59 (unifiedbetests+0x2fb0042)
          #8 impala::InProcessImpalaServer::StartWithEphemeralPorts(std::string const&, int, impala::InProcessImpalaServer**) /home/systest/Impala/be/src/testutil/in-process-servers.cc:60:21 (unifiedbetests+0x2faff19)
          #9 impala::ExprTest::SetUpTestCase() /home/systest/Impala/be/src/exprs/expr-test.cc:228:45 (unifiedbetests+0x1cf1948)
          #10 testing::TestCase::Run() <null> (unifiedbetests+0x4726e42)
          #11 __libc_start_main /build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:291 (libc.so.6+0x2082f)
      
        Thread T343 'acceptor-32305' (tid=32305, running) created by main thread at:
          #0 pthread_create /mnt/source/llvm/llvm-5.0.1.src-p1/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:889 (unifiedbetests+0x1b1b5ab)
          #1 kudu::Thread::StartThread(std::string const&, std::string const&, boost::function<void ()> const&, unsigned long, scoped_refptr<kudu::Thread>*) /home/systest/Impala/be/src/kudu/util/thread.cc:556:15 (unifiedbetests+0x2c201f5)
          #2 kudu::Status kudu::Thread::Create<void (kudu::rpc::AcceptorPool::*)(), kudu::rpc::AcceptorPool*>(std::string const&, std::string const&, void (kudu::rpc::AcceptorPool::* const&)(), kudu::rpc::AcceptorPool* const&, scoped_refptr<kudu::Thread>*) /home/systest/Impal
      a/be/src/kudu/util/thread.h:164:12 (unifiedbetests+0x33933e5)
          #3 kudu::rpc::AcceptorPool::Start(int) /home/systest/Impala/be/src/kudu/rpc/acceptor_pool.cc:85:16 (unifiedbetests+0x339293c)
          #4 impala::RpcMgr::StartServices() /home/systest/Impala/be/src/rpc/rpc-mgr.cc:216:50 (unifiedbetests+0x33bd4b8)
          #5 impala::ExecEnv::StartKrpcService() /home/systest/Impala/be/src/runtime/exec-env.cc:541:53 (unifiedbetests+0x2ccd02a)
          #6 impala::ImpalaServer::Start(int, int, int, int) /home/systest/Impala/be/src/service/impala-server.cc:2467:54 (unifiedbetests+0x2ebf3dc)
          #7 impala::InProcessImpalaServer::StartWithClientServers(int, int, int) /home/systest/Impala/be/src/testutil/in-process-servers.cc:88:59 (unifiedbetests+0x2fb0042)
          #8 impala::InProcessImpalaServer::StartWithEphemeralPorts(std::string const&, int, impala::InProcessImpalaServer**) /home/systest/Impala/be/src/testutil/in-process-servers.cc:60:21 (unifiedbetests+0x2faff19)
          #9 impala::ExprTest::SetUpTestCase() /home/systest/Impala/be/src/exprs/expr-test.cc:228:45 (unifiedbetests+0x1cf1948)
          #10 testing::TestCase::Run() <null> (unifiedbetests+0x4726e42)
          #11 __libc_start_main /build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:291 (libc.so.6+0x2082f)SUMMARY: ThreadSanitizer: data race /home/systest/Impala/be/src/kudu/util/net/socket.cc:330:684 in kudu::Socket::Accept(kudu::Socket*, kudu::Sockaddr*, int) 

      expr-test, data-stream-test, session-expiry-test, and rpc-mgr-test all hit this.

      Attachments

        Activity

          People

            Unassigned Unassigned
            stakiar Sahil Takiar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: