Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-46937

TSAN data-race at TearDown in DcpConnMapTest.TestCorrectRemovedOnStreamEnd

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1.0
    • None
    • couchbase-bucket
    • None
    • Triaged
    • 1
    • Unknown

    Description

      http://cv.jenkins.couchbase.com/job/kv_engine.threadsanitizer/job/master/11934/consoleFull#27891063161882284-c5b1-40af-8076-4f8cb2d12fb1:

      14:05:30  [ RUN      ] DcpConnMapTest.TestCorrectRemovedOnStreamEnd
      14:05:30  ==================
      14:05:30  WARNING: ThreadSanitizer: data race (pid=9277)
      14:05:30    Write of size 8 at 0x7b1c0004e730 by main thread:
      14:05:30      #0 operator delete(void*, unsigned long) <null> (libtsan.so.0+0x87578)
      14:05:30      #1 DcpFlowControlManagerAggressive::~DcpFlowControlManagerAggressive() /home/couchbase/jenkins/workspace/kv_engine.threadsanitizer_master/kv_engine/engines/ep/src/dcp/flow-control-manager.cc:144 (ep-engine_ep_unit_tests+0x82e7a2)
      14:05:30      #2 std::default_delete<DcpFlowControlManager>::operator()(DcpFlowControlManager*) const /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/unique_ptr.h:85 (ep-engine_ep_unit_tests+0x7ca483)
      14:05:30      #3 std::unique_ptr<DcpFlowControlManager, std::default_delete<DcpFlowControlManager> >::~unique_ptr() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/unique_ptr.h:361 (ep-engine_ep_unit_tests+0x7bc283)
      14:05:30      #4 EventuallyPersistentEngine::~EventuallyPersistentEngine() /home/couchbase/jenkins/workspace/kv_engine.threadsanitizer_master/kv_engine/engines/ep/src/ep_engine.cc:6608 (ep-engine_ep_unit_tests+0x7aa65f)
      14:05:30      #5 SynchronousEPEngine::~SynchronousEPEngine() /home/couchbase/jenkins/workspace/kv_engine.threadsanitizer_master/kv_engine/engines/ep/tests/mock/mock_synchronous_ep_engine.h:38 (ep-engine_ep_unit_tests+0x8d6b55)
      14:05:30      #6 SynchronousEPEngineDeleter::operator()(SynchronousEPEngine*) /home/couchbase/jenkins/workspace/kv_engine.threadsanitizer_master/kv_engine/engines/ep/tests/mock/mock_synchronous_ep_engine.cc:144 (ep-engine_ep_unit_tests+0x8d55fd)
      14:05:30      #7 std::__uniq_ptr_impl<SynchronousEPEngine, SynchronousEPEngineDeleter>::reset(SynchronousEPEngine*) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/unique_ptr.h:182 (ep-engine_ep_unit_tests+0xed567b)
      14:05:30      #8 std::unique_ptr<SynchronousEPEngine, SynchronousEPEngineDeleter>::reset(SynchronousEPEngine*) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/unique_ptr.h:456 (ep-engine_ep_unit_tests+0xed5738)
      14:05:30      #9 DcpConnMapTest::TearDown() ../kv_engine/engines/ep/tests/module_tests/dcp_test.cc:1709 (ep-engine_ep_unit_tests+0xec510f)
      14:05:30      #10 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../third_party/googletest/googletest/src/gtest.cc:2433 (ep-engine_ep_unit_tests+0x152e8f3)
      14:05:30      #11 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../third_party/googletest/googletest/src/gtest.cc:2469 (ep-engine_ep_unit_tests+0x1519fc2)
      14:05:30      #12 testing::Test::Run() ../third_party/googletest/googletest/src/gtest.cc:2516 (ep-engine_ep_unit_tests+0x150298e)
      14:05:30      #13 testing::TestInfo::Run() ../third_party/googletest/googletest/src/gtest.cc:2684 (ep-engine_ep_unit_tests+0x150334a)
      14:05:30      #14 testing::TestSuite::Run() ../third_party/googletest/googletest/src/gtest.cc:2816 (ep-engine_ep_unit_tests+0x1503921)
      14:05:30      #15 testing::internal::UnitTestImpl::RunAllTests() ../third_party/googletest/googletest/src/gtest.cc:5338 (ep-engine_ep_unit_tests+0x150cac1)
      14:05:30      #16 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../third_party/googletest/googletest/src/gtest.cc:2433 (ep-engine_ep_unit_tests+0x1531503)
      14:05:30      #17 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../third_party/googletest/googletest/src/gtest.cc:2469 (ep-engine_ep_unit_tests+0x151c1b2)
      14:05:30      #18 testing::UnitTest::Run() ../third_party/googletest/googletest/src/gtest.cc:4925 (ep-engine_ep_unit_tests+0x150c677)
      14:05:30      #19 RUN_ALL_TESTS() ../third_party/googletest/googletest/include/gtest/gtest.h:2473 (ep-engine_ep_unit_tests+0xf81ae7)
      14:05:30      #20 main ../kv_engine/engines/ep/tests/module_tests/ep_unit_tests_main.cc:175 (ep-engine_ep_unit_tests+0xf81a0e)
      14:05:30  
      14:05:30    Previous read of size 8 at 0x7b1c0004e730 by thread T35:
      14:05:30      #0 FlowControl::~FlowControl() /home/couchbase/jenkins/workspace/kv_engine.threadsanitizer_master/kv_engine/engines/ep/src/dcp/flow-control.cc:36 (ep-engine_ep_unit_tests+0x82db08)
      14:05:30      #1 DcpConsumer::~DcpConsumer() /home/couchbase/jenkins/workspace/kv_engine.threadsanitizer_master/kv_engine/engines/ep/src/dcp/consumer.cc:209 (ep-engine_ep_unit_tests+0x822269)
      14:05:30      #2 void __gnu_cxx::new_allocator<MockDcpConsumer>::destroy<MockDcpConsumer>(MockDcpConsumer*) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/ext/new_allocator.h:156 (ep-engine_ep_unit_tests+0x8ef99d)
      14:05:30      #3 void std::allocator_traits<std::allocator<MockDcpConsumer> >::destroy<MockDcpConsumer>(std::allocator<MockDcpConsumer>&, MockDcpConsumer*) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/alloc_traits.h:531 (ep-engine_ep_unit_tests+0x8ef93e)
      14:05:30      #4 std::_Sp_counted_ptr_inplace<MockDcpConsumer, std::allocator<MockDcpConsumer>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/shared_ptr_base.h:560 (ep-engine_ep_unit_tests+0x8ef782)
      14:05:30      #5 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/shared_ptr_base.h:158 (ep-engine_ep_unit_tests+0x4e26a1)
      14:05:30      #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/shared_ptr_base.h:733 (ep-engine_ep_unit_tests+0x4e2622)
      14:05:30      #7 std::__shared_ptr<DcpConsumer, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/shared_ptr_base.h:1183 (ep-engine_ep_unit_tests+0x83e149)
      14:05:30      #8 DcpConsumerTask::~DcpConsumerTask() /home/couchbase/jenkins/workspace/kv_engine.threadsanitizer_master/kv_engine/engines/ep/src/dcp/consumer.cc:68 (ep-engine_ep_unit_tests+0x84ff10)
      14:05:30      #9 void __gnu_cxx::new_allocator<DcpConsumerTask>::destroy<DcpConsumerTask>(DcpConsumerTask*) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/ext/new_allocator.h:156 (ep-engine_ep_unit_tests+0x85026d)
      14:05:30      #10 void std::allocator_traits<std::allocator<DcpConsumerTask> >::destroy<DcpConsumerTask>(std::allocator<DcpConsumerTask>&, DcpConsumerTask*) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/alloc_traits.h:531 (ep-engine_ep_unit_tests+0x85020e)
      14:05:30      #11 std::_Sp_counted_ptr_inplace<DcpConsumerTask, std::allocator<DcpConsumerTask>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/shared_ptr_base.h:560 (ep-engine_ep_unit_tests+0x84fb9f)
      14:05:30      #12 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/shared_ptr_base.h:158 (ep-engine_ep_unit_tests+0x4e26a1)
      14:05:30      #13 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/shared_ptr_base.h:733 (ep-engine_ep_unit_tests+0x4e2622)
      14:05:30      #14 std::__shared_ptr<GlobalTask, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/shared_ptr_base.h:1183 (ep-engine_ep_unit_tests+0x6481c9)
      14:05:30      #15 std::__shared_ptr<GlobalTask, (__gnu_cxx::_Lock_policy)2>::reset() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/shared_ptr_base.h:1301 (ep-engine_ep_unit_tests+0x71ae33)
      14:05:30      #16 FollyExecutorPool::TaskProxy::resetTaskPtrViaCpuPool()::{lambda()#2}::operator()() /home/couchbase/jenkins/workspace/kv_engine.threadsanitizer_master/kv_engine/executor/folly_executorpool.cc:243 (ep-engine_ep_unit_tests+0x14e6b57)
      14:05:30      #17 void folly::detail::function::FunctionTraits<void ()>::callSmall<FollyExecutorPool::TaskProxy::resetTaskPtrViaCpuPool()::{lambda()#2}>(folly::detail::function::Data&) tlm/deps/folly.exploded/include/folly/Function.h:387 (ep-engine_ep_unit_tests+0x14e6a25)
      14:05:30      #18 folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:416 (ep-engine_ep_unit_tests+0x17f57f3)
      14:05:30      #19 folly::ThreadPoolExecutor::runTask(std::shared_ptr<folly::ThreadPoolExecutor::Thread> const&, folly::ThreadPoolExecutor::Task&&) folly/executors/ThreadPoolExecutor.cpp:97 (ep-engine_ep_unit_tests+0x17f57f3)
      14:05:30      #20 folly::CPUThreadPoolExecutor::threadRun(std::shared_ptr<folly::ThreadPoolExecutor::Thread>) folly/executors/CPUThreadPoolExecutor.cpp:265 (ep-engine_ep_unit_tests+0x17d2a40)
      14:05:30      #21 void std::__invoke_impl<void, void (folly::ThreadPoolExecutor::*&)(std::shared_ptr<folly::ThreadPoolExecutor::Thread>), folly::ThreadPoolExecutor*&, std::shared_ptr<folly::ThreadPoolExecutor::Thread>&>(std::__invoke_memfun_deref, void (folly::ThreadPoolExecutor::*&)(std::shared_ptr<folly::ThreadPoolExecutor::Thread>), folly::ThreadPoolExecutor*&, std::shared_ptr<folly::ThreadPoolExecutor::Thread>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:73 (ep-engine_ep_unit_tests+0x17fc694)
      14:05:30      #22 std::__invoke_result<void (folly::ThreadPoolExecutor::*&)(std::shared_ptr<folly::ThreadPoolExecutor::Thread>), folly::ThreadPoolExecutor*&, std::shared_ptr<folly::ThreadPoolExecutor::Thread>&>::type std::__invoke<void (folly::ThreadPoolExecutor::*&)(std::shared_ptr<folly::ThreadPoolExecutor::Thread>), folly::ThreadPoolExecutor*&, std::shared_ptr<folly::ThreadPoolExecutor::Thread>&>(void (folly::ThreadPoolExecutor::*&)(std::shared_ptr<folly::ThreadPoolExecutor::Thread>), folly::ThreadPoolExecutor*&, std::shared_ptr<folly::ThreadPoolExecutor::Thread>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:95 (ep-engine_ep_unit_tests+0x17fc455)
      14:05:30      #23 void std::_Bind<void (folly::ThreadPoolExecutor::*(folly::ThreadPoolExecutor*, std::shared_ptr<folly::ThreadPoolExecutor::Thread>))(std::shared_ptr<folly::ThreadPoolExecutor::Thread>)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/functional:467 (ep-engine_ep_unit_tests+0x17fc455)
      14:05:30      #24 void std::_Bind<void (folly::ThreadPoolExecutor::*(folly::ThreadPoolExecutor*, std::shared_ptr<folly::ThreadPoolExecutor::Thread>))(std::shared_ptr<folly::ThreadPoolExecutor::Thread>)>::operator()<, void>() /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/functional:549 (ep-engine_ep_unit_tests+0x17fc455)
      14:05:30      #25 void folly::detail::function::FunctionTraits<void ()>::callBig<std::_Bind<void (folly::ThreadPoolExecutor::*(folly::ThreadPoolExecutor*, std::shared_ptr<folly::ThreadPoolExecutor::Thread>))(std::shared_ptr<folly::ThreadPoolExecutor::Thread>)> >(folly::detail::function::Data&) folly/Function.h:401 (ep-engine_ep_unit_tests+0x17fc455)
      14:05:30      #26 folly::detail::function::FunctionTraits<void ()>::operator()() tlm/deps/folly.exploded/include/folly/Function.h:416 (ep-engine_ep_unit_tests+0x14e0f0c)
      14:05:30      #27 CBRegisteredThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}::operator()() /home/couchbase/jenkins/workspace/kv_engine.threadsanitizer_master/kv_engine/executor/folly_executorpool.cc:47 (ep-engine_ep_unit_tests+0x14e0df2)
      14:05:30      #28 void folly::detail::function::FunctionTraits<void ()>::callBig<CBRegisteredThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}>(folly::detail::function::Data&) tlm/deps/folly.exploded/include/folly/Function.h:401 (ep-engine_ep_unit_tests+0x14e0cfd)
      14:05:30      #29 folly::detail::function::FunctionTraits<void ()>::operator()() tlm/deps/folly.exploded/include/folly/Function.h:416 (ep-engine_ep_unit_tests+0x14e0f0c)
      14:05:30      #30 folly::PriorityThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}::operator()() tlm/deps/folly.exploded/include/folly/executors/thread_factory/PriorityThreadFactory.h:54 (ep-engine_ep_unit_tests+0x14e3d68)
      14:05:30      #31 void folly::detail::function::FunctionTraits<void ()>::callBig<folly::PriorityThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}>(folly::detail::function::Data&) tlm/deps/folly.exploded/include/folly/Function.h:401 (ep-engine_ep_unit_tests+0x14e3c1d)
      14:05:30      #32 folly::detail::function::FunctionTraits<void ()>::operator()() tlm/deps/folly.exploded/include/folly/Function.h:416 (ep-engine_ep_unit_tests+0x14e0f0c)
      14:05:30      #33 folly::NamedThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}::operator()() tlm/deps/folly.exploded/include/folly/executors/thread_factory/NamedThreadFactory.h:40 (ep-engine_ep_unit_tests+0x14e35e3)
      14:05:30      #34 void std::__invoke_impl<void, folly::NamedThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}>(std::__invoke_other, folly::NamedThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}&&) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/invoke.h:60 (ep-engine_ep_unit_tests+0x14e358d)
      14:05:30      #35 std::__invoke_result<folly::NamedThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}>::type std::__invoke<folly::NamedThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}>(std::__invoke_result&&, (folly::NamedThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}&&)...) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/bits/invoke.h:95 (ep-engine_ep_unit_tests+0x14e34fd)
      14:05:30      #36 void std::thread::_Invoker<std::tuple<folly::NamedThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/thread:264 (ep-engine_ep_unit_tests+0x14e34c5)
      14:05:30      #37 std::thread::_Invoker<std::tuple<folly::NamedThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}> >::operator()() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/thread:271 (ep-engine_ep_unit_tests+0x14e3485)
      14:05:30      #38 std::thread::_State_impl<std::thread::_Invoker<std::tuple<folly::NamedThreadFactory::newThread(folly::Function<void ()>&&)::{lambda()#1}> > >::_M_run() /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/thread:215 (ep-engine_ep_unit_tests+0x14e3349)
      14:05:30      #39 execute_native_thread_routine /tmp/deploy/objdir/../gcc-10.2.0/libstdc++-v3/src/c++11/thread.cc:80 (libstdc++.so.6+0xd62ef)
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              paolo.cocchi Paolo Cocchi
              paolo.cocchi Paolo Cocchi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change

                  PagerDuty