Details
-
Bug
-
Resolution: Fixed
-
Major
-
6.5.0
-
Untriaged
-
Unknown
Description
As reported by ThreadSanitizer when running a 4-node cluster-run and performing an initial rebalance (2 replicas):
WARNING: ThreadSanitizer: data race (pid=1085)
|
Read of size 8 at 0x7b0400003848 by thread T7 (mutexes: write M2377):
|
#0 std::__uniq_ptr_impl<hdr_histogram, HdrHistogram::HdrDeleter>::_M_ptr() const /usr/local/include/c++/7.3.0/bits/unique_ptr.h:147 (memcached+0x0000005fcde1)
|
#1 std::unique_ptr<hdr_histogram, HdrHistogram::HdrDeleter>::get() const /usr/local/include/c++/7.3.0/bits/unique_ptr.h:337 (memcached+0x0000005fcde1)
|
#2 HdrHistogram::addValueAndCount(unsigned long, unsigned long) /home/couchbase/couchbase/kv_engine/utilities/hdrhistogram.cc:98 (memcached+0x0000005fcde1)
|
#3 Hdr1sfMicroSecHistogram::add(std::chrono::duration<long, std::ratio<1l, 1000000l> >, unsigned long) /home/couchbase/couchbase/kv_engine/utilities/hdrhistogram.h:377 (memcached+0x0000004bf4d8)
|
#4 Timings::collect(cb::mcbp::ClientOpcode, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) /home/couchbase/couchbase/kv_engine/daemon/timings.cc:43 (memcached+0x0000004bf4d8)
|
#5 mcbp_collect_timings(Cookie&) /home/couchbase/couchbase/kv_engine/daemon/mcbp.cc:263 (memcached+0x000000514da6)
|
...
|
|
Previous write of size 8 at 0x7b0400003848 by thread T8 (mutexes: write M2371, write M2392):
|
#0 std::enable_if<std::__and_<std::__not_<std::__is_tuple_like<hdr_histogram*> >, std::is_move_constructible<hdr_histogram*>, std::is_move_assignable<hdr_histogram*> >::value, void>::type std::swap<hdr_histogram*>(hdr_histogram*&, hdr_histogram*&) /usr/local/include/c++/7.3.0/bits/move.h:199 (memcached+0x0000005fe125)
|
#1 std::unique_ptr<hdr_histogram, HdrHistogram::HdrDeleter>::reset(hdr_histogram*) /usr/local/include/c++/7.3.0/bits/unique_ptr.h:374 (memcached+0x0000005fe125)
|
#2 HdrHistogram::HdrHistogram(unsigned long, unsigned long, int, HdrHistogram::Iterator::IterMode) /home/couchbase/couchbase/kv_engine/utilities/hdrhistogram.cc:55 (memcached+0x0000005fe125)
|
#3 std::_MakeUniq<Hdr1sfMicroSecHistogram>::__single_object std::make_unique<Hdr1sfMicroSecHistogram>() /home/couchbase/couchbase/kv_engine/utilities/hdrhistogram.h:374 (memcached+0x0000004bf3b3)
|
#4 Timings::get_or_create_timing_histogram(unsigned char) /home/couchbase/couchbase/kv_engine/daemon/timings.cc:149 (memcached+0x0000004bf3b3)
|
#5 Timings::collect(cb::mcbp::ClientOpcode, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) /home/couchbase/couchbase/kv_engine/daemon/timings.cc:42 (memcached+0x0000004bf4aa)
|
#6 mcbp_collect_timings(Cookie&) /home/couchbase/couchbase/kv_engine/daemon/mcbp.cc:263 (memcached+0x000000514da6)
|
...
|
|
Location is heap block of size 16 at 0x7b0400003840 allocated by thread T8:
|
#0 operator new(unsigned long) <null> (libtsan.so.0+0x00000006d926)
|
#1 std::_MakeUniq<Hdr1sfMicroSecHistogram>::__single_object std::make_unique<Hdr1sfMicroSecHistogram>() /usr/local/include/c++/7.3.0/bits/unique_ptr.h:825 (memcached+0x0000004bf393)
|
#2 Timings::get_or_create_timing_histogram(unsigned char) /home/couchbase/couchbase/kv_engine/daemon/timings.cc:149 (memcached+0x0000004bf393)
|
#3 Timings::collect(cb::mcbp::ClientOpcode, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) /home/couchbase/couchbase/kv_engine/daemon/timings.cc:42 (memcached+0x0000004bf4aa)
|
#4 mcbp_collect_timings(Cookie&) /home/couchbase/couchbase/kv_engine/daemon/mcbp.cc:263 (memcached+0x000000514da6)
|
#5 StateMachine::conn_execute() /home/couchbase/couchbase/kv_engine/daemon/statemachine.cc:423 (memcached+0x0000005530e0)
|
#6 StateMachine::execute() /home/couchbase/couchbase/kv_engine/daemon/statemachine.cc:137 (memcached+0x000000554eea)
|
#7 Connection::runStateMachinery() /home/couchbase/couchbase/kv_engine/daemon/connection.cc:1340 (memcached+0x0000004ec21b)
|
#8 Connection::runEventLoop(short) /home/couchbase/couchbase/kv_engine/daemon/connection.cc:1414 (memcached+0x0000004ec2aa)
|
#9 run_event_loop(Connection*, short) /home/couchbase/couchbase/kv_engine/daemon/connections.cc:148 (memcached+0x000000502340)
|
#10 thread_libevent_process /home/couchbase/couchbase/kv_engine/daemon/thread.cc:340 (memcached+0x0000004bb9ac)
|
#11 event_persist_closure /home/couchbase/jenkins/workspace/cbdeps-platform-build-old/deps/packages/build/libevent/libevent-prefix/src/libevent/event.c:1580 (libevent_core.so.2.1.8+0x000000017856)
|
#12 event_process_active_single_queue /home/couchbase/jenkins/workspace/cbdeps-platform-build-old/deps/packages/build/libevent/libevent-prefix/src/libevent/event.c:1639 (libevent_core.so.2.1.8+0x000000017856)
|
#13 CouchbaseThread::run() /home/couchbase/couchbase/platform/src/cb_pthreads.cc:58 (libplatform_so.so.0.1.0+0x00000000a217)
|
#14 platform_thread_wrap /home/couchbase/couchbase/platform/src/cb_pthreads.cc:71 (libplatform_so.so.0.1.0+0x00000000a217)
|
#15 <null> <null> (libtsan.so.0+0x00000002843b)
|
|
Mutex M2377 (0x7b8c00000388) created at:
|
(Output dropped as this is from babysitter.log)
Attachments
Issue Links
- relates to
-
MB-35413 TSan: Data race in Timings::get_or_create_timing_histogram
- Closed