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

ThreadSanitizer CHECK failed: sanitizer_deadlock_detector1.cc:166 "((!dd.isHeld(&lt->dd, m->id))) != (0)" (0x0, 0x0)

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      When testing the new FollyExectutorPool under TSan, the following check (internal to TSan) fails:

      [ RUN      ] CollectionsVBFilterTest.validation_no_default
      FATAL: ThreadSanitizer CHECK failed: /build/llvm-toolchain-9-9~+20191211110317+c1a0a213378/compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector1.cc:166 "((!dd.isHeld(&lt->dd, m->id))) != (0)" (0x0, 0x0)
      [Detaching after fork from child process 71399]
      

      This is seen with various backtraces, both when locking folly::SharedMutex and std:::mutex. For example:

          #0 __tsan::TsanCheckFailed() <null> (ep-engine_ep_unit_tests+0x64c085)
          #1 __sanitizer::CheckFailed() <null> (ep-engine_ep_unit_tests+0x662e3f)
          #2 __sanitizer::DD::MutexAfterLock() <null> (ep-engine_ep_unit_tests+0x656aed)
          #3 __tsan::MutexPostLock() <null> (ep-engine_ep_unit_tests+0x64a563)
          #4 pthread_mutex_lock <null> (ep-engine_ep_unit_tests+0x602258)
          #5 __gthread_mutex_lock(pthread_mutex_t*) include/x86_64-linux-gnu/c++/7.3.0/bits/gthr-default.h:748:12 (ep-engine_ep_unit_tests+0x6a1e63)
          #6 std::mutex::lock() include/c++/7.3.0/bits/std_mutex.h:103:17 (ep-engine_ep_unit_tests+0x6a4465)
          #7 std::lock_guard<std::mutex>::lock_guard(std::mutex&) include/c++/7.3.0/bits/std_mutex.h:162:19 (ep-engine_ep_unit_tests+0x6a24a6)
          #8 BgFetcher::~BgFetcher() kv_engine/engines/ep/src/bgfetcher.cc:37:16 (ep-engine_ep_unit_tests+0x6a11c5)
          #9 std::default_delete<BgFetcher>::operator()(BgFetcher*) const include/c++/7.3.0/bits/unique_ptr.h:78:2 (ep-engine_ep_unit_tests+0x917f6a)
          #10 std::unique_ptr<BgFetcher, std::default_delete<BgFetcher> >::~unique_ptr() include/c++/7.3.0/bits/unique_ptr.h:268:4 (ep-engine_ep_unit_tests+0x9166d7)
          #11 KVShard::~KVShard() kv_engine/engines/ep/src/kvshard.cc:92:19 (ep-engine_ep_unit_tests+0x915426)
          #12 std::default_delete<KVShard>::operator()(KVShard*) const include/c++/7.3.0/bits/unique_ptr.h:78:2 (ep-engine_ep_unit_tests+0x8f994a)
          #13 std::unique_ptr<KVShard, std::default_delete<KVShard> >::~unique_ptr() include/c++/7.3.0/bits/unique_ptr.h:268:4 (ep-engine_ep_unit_tests+0x8f98a7)
          #14 void std::_Destroy<std::unique_ptr<KVShard, std::default_delete<KVShard> > >(std::unique_ptr<KVShard, std::default_delete<KVShard> >*) include/c++/7.3.0/bits/stl_construct.h:98:19 (ep-engine_ep_unit_tests+0x8f9835)
          #15 void std::_Destroy_aux<false>::__destroy<std::unique_ptr<KVShard, std::default_delete<KVShard> >*>(std::unique_ptr<KVShard, std::default_delete<KVShard> >*, std::unique_ptr<KVShard, std::default_delete<KVShard> >*) include/c++/7.3.0/bits/stl_construct.h:108:6 (ep-engine_ep_unit_tests+0x8f97ff)
          #16 void std::_Destroy<std::unique_ptr<KVShard, std::default_delete<KVShard> >*>(std::unique_ptr<KVShard, std::default_delete<KVShard> >*, std::unique_ptr<KVShard, std::default_delete<KVShard> >*) include/c++/7.3.0/bits/stl_construct.h:136:7 (ep-engine_ep_unit_tests+0x8f97ae)
          #17 void std::_Destroy<std::unique_ptr<KVShard, std::default_delete<KVShard> >*, std::unique_ptr<KVShard, std::default_delete<KVShard> > >(std::unique_ptr<KVShard, std::default_delete<KVShard> >*, std::unique_ptr<KVShard, std::default_delete<KVShard> >*, std::allocator<std::unique_ptr<KVShard, std::default_delete<KVShard> > >&) include/c++/7.3.0/bits/stl_construct.h:206:7 (ep-engine_ep_unit_tests+0x8f96de)
          #18 std::vector<std::unique_ptr<KVShard>, ...>::~vector() include/c++/7.3.0/bits/stl_vector.h:434:9 (ep-engine_ep_unit_tests+0x8f968f)
          #19 VBucketMap::~VBucketMap() kv_engine/engines/ep/src/vbucketmap.h:33:7 (ep-engine_ep_unit_tests+0x8f6385)
          #20 KVBucket::~KVBucket() kv_engine/engines/ep/src/kv_bucket.cc:501:1 (ep-engine_ep_unit_tests+0x8e87c6)
          #21 EPBucket::~EPBucket() kv_engine/engines/ep/src/ep_bucket.cc:283:1 (ep-engine_ep_unit_tests+0x7f68c9)
          #22 MockEPBucket::~MockEPBucket() kv_engine/engines/ep/tests/mock/mock_ep_bucket.h:29:7 (ep-engine_ep_unit_tests+0xa7dc49)
          #23 testing::NiceMock<MockEPBucket>::~NiceMock() third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h:103:3 (ep-engine_ep_unit_tests+0xa9dd2d)
          #24 testing::NiceMock<MockEPBucket>::~NiceMock() third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h:100:15 (ep-engine_ep_unit_tests+0xa9dd65)
          #25 std::default_delete<KVBucket>::operator()(KVBucket*) const include/c++/7.3.0/bits/unique_ptr.h:78:2 (ep-engine_ep_unit_tests+0x86e323)
          #26 std::unique_ptr<KVBucket, std::default_delete<KVBucket> >::reset(KVBucket*) include/c++/7.3.0/bits/unique_ptr.h:376:4 (ep-engine_ep_unit_tests+0x85267f)
          #27 EventuallyPersistentEngine::~EventuallyPersistentEngine() kv_engine/engines/ep/src/ep_engine.cc:6571:18 (ep-engine_ep_unit_tests+0x8475db)
          #28 SynchronousEPEngine::~SynchronousEPEngine() kv_engine/engines/ep/tests/mock/mock_synchronous_ep_engine.h:43:7 (ep-engine_ep_unit_tests+0xa9d235)
          #29 SynchronousEPEngineDeleter::operator()(SynchronousEPEngine*) kv_engine/engines/ep/tests/mock/mock_synchronous_ep_engine.cc:135:5 (ep-engine_ep_unit_tests+0xa9c2bd)
          #30 std::unique_ptr<SynchronousEPEngine, SynchronousEPEngineDeleter>::reset(SynchronousEPEngine*) include/c++/7.3.0/bits/unique_ptr.h:376:4 (ep-engine_ep_unit_tests+0xf86c2f)
          #31 KVBucketTest::destroy() kv_engine/engines/ep/tests/module_tests/kv_bucket_test.cc:129:12 (ep-engine_ep_unit_tests+0x13610e4)
          #32 KVBucketTest::TearDown() kv_engine/engines/ep/tests/module_tests/kv_bucket_test.cc:116:5 (ep-engine_ep_unit_tests+0x1361065)
          #33 SingleThreadedKVBucketTest::TearDown() kv_engine/engines/ep/tests/module_tests/evp_store_single_threaded_test.cc:115:19 (ep-engine_ep_unit_tests+0x1147be9)
          #34 CollectionsVBFilterTest::TearDown() kv_engine/engines/ep/tests/module_tests/collections/filter_test.cc:57:26 (ep-engine_ep_unit_tests+0xce87e1)
          #35 virtual thunk to CollectionsVBFilterTest::TearDown() kv_engine/engines/ep/tests/module_tests/collections/filter_test.cc (ep-engine_ep_unit_tests+0xce8880)
          #36 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) third_party/googletest/googletest/src/gtest.cc:2433:10 (ep-engine_ep_unit_tests+0x14f5003)
          #37 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) third_party/googletest/googletest/src/gtest.cc:2469:14 (ep-engine_ep_unit_tests+0x14e0992)
          #38 testing::Test::Run() third_party/googletest/googletest/src/gtest.cc:2516:3 (ep-engine_ep_unit_tests+0x14c922e)
          #39 testing::TestInfo::Run() third_party/googletest/googletest/src/gtest.cc:2684:11 (ep-engine_ep_unit_tests+0x14c9bea)
          #40 testing::TestSuite::Run() third_party/googletest/googletest/src/gtest.cc:2816:28 (ep-engine_ep_unit_tests+0x14ca1c1)
          #41 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/googletest/src/gtest.cc:5338:44 (ep-engine_ep_unit_tests+0x14d33a1)
          #42 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:10 (ep-engine_ep_unit_tests+0x14f83c3)
          #43 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:14 (ep-engine_ep_unit_tests+0x14e2b62)
          #44 testing::UnitTest::Run() third_party/googletest/googletest/src/gtest.cc:4925:10 (ep-engine_ep_unit_tests+0x14d2f57)
          #45 RUN_ALL_TESTS() third_party/googletest/googletest/include/gtest/gtest.h:2473:46 (ep-engine_ep_unit_tests+0x101bf97)
          #46 main kv_engine/engines/ep/tests/module_tests/ep_unit_tests_main.cc:175:16 (ep-engine_ep_unit_tests+0x101bdfe)
          #47 __libc_start_main /build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:291 (libc.so.6+0x2082f)
          #48 _start <null> (ep-engine_ep_unit_tests+0x5dc728)
      

      This appears to have started since moving to use clang-9 for the TSan build, however it's not totally clear given when GCC-7.3 was used other false positives were observed.

      Attachments

        Issue Links

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

          Activity

            People

              drigby Dave Rigby (Inactive)
              drigby Dave Rigby (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty