Uploaded image for project: 'C++ Couchbase Client'
  1. C++ Couchbase Client
  2. CXXCBC-90

Thread Sanitizer issues

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 1.0.0-beta
    • 1.0.0-beta
    • None
    • None
    • 1
    • SDK02: CB++ and Query Error, SDK06: Trxns, Indx Mg, Qry Err

    Description

      When going from 809940691ef3d6eee3d06701b4165086eb257f87 to ed0c8867b166a58c2dfc4d63d1b23f138d28610b, I'm seeing queries timeout or segfault.  When running TSAN, I see the following at startup of my tests (which ping until kv and query are up):

      ==================
      WARNING: ThreadSanitizer: data race (pid=3047331)
        Write of size 8 at 0x7b0800028080 by main thread:
          #0 operator delete(void*) ../../../../src/libsanitizer/tsan/tsan_new_delete.cpp:126 (libtsan.so.0+0x83f38)
          #1 couchbase::diag::endpoint_ping_info::~endpoint_ping_info() /home/davidk/projects/couchbase-transactions-cxx/deps/couchbase-cxx-client/couchbase/diagnostics.hxx:76 (client_tests+0x609e9d)
       
        Previous write of size 8 at 0x7b0800028080 by thread T2 (mutexes: write M320735496101722304):
          #0 operator new(unsigned long) ../../../../src/libsanitizer/tsan/tsan_new_delete.cpp:64 (libtsan.so.0+0x8499c)
          #1 void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) <null> (libstdc++.so.6+0x135dde)
          #2 __gthread_once /usr/include/x86_64-linux-gnu/c++/10/bits/gthr-default.h:700 (client_tests+0x5db009)
          #3 couchbase::ping_collector::invoke_handler() /home/davidk/projects/couchbase-transactions-cxx/deps/couchbase-cxx-client/couchbase/cluster.cxx:61 (libtransactions_cxx.so.2+0xbf9756)
          #4 couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}::operator()(couchbase::diag::endpoint_ping_info&&) const /home/davidk/projects/couchbase-transactions-cxx/deps/couchbase-cxx-client/couchbase/cluster.cxx:53 (libtransactions_cxx.so.2+0xbf9486)
          #5 couchbase::io::mcbp_session::ping<couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}>(couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&)::{lambda(std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&)#1}::operator()(couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&, std::error_code, couchbase::io::mcbp_message) const <null> (libtransactions_cxx.so.2+0xbfaac0)
          #6 couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1} std::__invoke_impl<void, couchbase::io::mcbp_session::ping<couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}>(couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&)::{lambda(std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&)#1}&, couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&, std::error_code, couchbase::io::retry_reason>(std::__invoke_other, couchbase::io::mcbp_session::ping<couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}>(couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&)::{lambda(std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&)#1}&, void&&, std::error_code&&, couchbase::io::retry_reason&&) /usr/include/c++/10/bits/invoke.h:60 (libtransactions_cxx.so.2+0xc06988)
          #7 std::enable_if<is_invocable_r_v<couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}, couchbase::io::mcbp_session::ping<couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}>(couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&)::{lambda(std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&)#1}&, couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&, std::error_code, couchbase::io::retry_reason>, couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}>::type std::__invoke_r<void, couchbase::io::mcbp_session::ping<couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}>(couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&)::{lambda(std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&)#1}&, couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&, std::error_code, couchbase::io::retry_reason>(couchbase::io::mcbp_session::ping<couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}>(couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&)::{lambda(std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&)#1}&, (std::enable_if&&)...) /usr/include/c++/10/bits/invoke.h:110 (libtransactions_cxx.so.2+0xc040b4)
          #8 std::_Function_handler<void (std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&), couchbase::io::mcbp_session::ping<couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}>(couchbase::ping_collector::build_reporter()::{lambda(couchbase::diag::endpoint_ping_info&&)#1}&&)::{lambda(std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&)#1}>::_M_invoke(std::_Any_data const&, std::error_code&&, couchbase::io::retry_reason&&, couchbase::io::mcbp_message&&) /usr/include/c++/10/bits/std_function.h:291 (libtransactions_cxx.so.2+0xc00f60)
          #9 std::function<void (std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&)>::operator()(std::error_code, couchbase::io::retry_reason, couchbase::io::mcbp_message&&) const <null> (client_tests+0x61964c)
       
        Mutex M320735496101722304 is already destroyed.
       
        Thread T2 (tid=3047334, running) created by main thread at:
          #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:962 (libtsan.so.0+0x58ba2)
          #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xcf144)
       
      SUMMARY: ThreadSanitizer: data race ../../../../src/libsanitizer/tsan/tsan_new_delete.cpp:126 in operator delete(void*)
       

      Attachments

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

        Activity

          People

            david.kelly David Kelly (Inactive)
            david.kelly David Kelly (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes