Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-2045

Data race on process_memory::g_hard_limit

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.5.0
    • Component/s: util
    • Labels:

      Description

      Saw this in a linked_list-test TSAN run. I don't think it's related to the changes I currently have in my tree:

      ==================
      WARNING: ThreadSanitizer: data race (pid=19052)
        Write of size 8 at 0x7f04796dc478 by thread T123 (mutexes: write M1221):
          #0 kudu::process_memory::(anonymous namespace)::DoInitLimits() /home/adar/Source/kudu/src/kudu/util/process_memory.cc:166:16 (libkudu_util.so+0x1a5719)
          #1 GoogleOnceInternalInit(int*, void (*)(), void (*)(void*), void*) /home/adar/Source/kudu/src/kudu/gutil/once.cc:38:7 (libgutil.so+0x35a87)
          #2 GoogleOnceInit(GoogleOnceType*, void (*)()) /home/adar/Source/kudu/src/kudu/gutil/once.h:55:5 (libtserver.so+0xc69c3)
          #3 kudu::process_memory::(anonymous namespace)::InitLimits() /home/adar/Source/kudu/src/kudu/util/process_memory.cc:184:3 (libkudu_util.so+0x1a5511)
          #4 kudu::process_memory::UnderMemoryPressure(double*) /home/adar/Source/kudu/src/kudu/util/process_memory.cc:221:3 (libkudu_util.so+0x1a544a)
          #5 _ZNSt3__18__invokeIRPFbPdEJS1_EEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS5_DpOS6_ /home/adar/Source/kudu/thirdparty/installed/tsan/include/c++/v1/type_traits:4301:1 (libkudu_util.so+0x16aa6d)
          #6 bool std::__1::__invoke_void_return_wrapper<bool>::__call<bool (*&)(double*), double*>(bool (*&)(double*), double*&&) /home/adar/Source/kudu/thirdparty/installed/tsan/include/c++/v1/__functional_base:328 (libkudu_util.so+0x16aa6d)
          #7 std::__1::__function::__func<bool (*)(double*), std::__1::allocator<bool (*)(double*)>, bool (double*)>::operator()(double*&&) /home/adar/Source/kudu/thirdparty/installed/tsan/include/c++/v1/functional:1552:12 (libkudu_util.so+0x16a974)
          #8 std::__1::function<bool (double*)>::operator()(double*) const /home/adar/Source/kudu/thirdparty/installed/tsan/include/c++/v1/functional:1914:12 (libkudu_util.so+0x168b0d)
          #9 kudu::MaintenanceManager::FindBestOp() /home/adar/Source/kudu/src/kudu/util/maintenance_manager.cc:383:7 (libkudu_util.so+0x165e66)
          #10 kudu::MaintenanceManager::RunSchedulerThread() /home/adar/Source/kudu/src/kudu/util/maintenance_manager.cc:245:25 (libkudu_util.so+0x164650)
          #11 boost::_mfi::mf0<void, kudu::MaintenanceManager>::operator()(kudu::MaintenanceManager*) const /home/adar/Source/kudu/thirdparty/installed/tsan/include/boost/bind/mem_fn_template.hpp:49:29 (libkudu_util.so+0x16b876)
          #12 void boost::_bi::list1<boost::_bi::value<kudu::MaintenanceManager*> >::operator()<boost::_mfi::mf0<void, kudu::MaintenanceManager>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, kudu::MaintenanceManager>&, boost::_bi::list0&, int) /home/adar/Source/kudu/thirdparty/installed/tsan/include/boost/bind/bind.hpp:259:9 (libkudu_util.so+0x16b7ca)
          #13 boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::MaintenanceManager>, boost::_bi::list1<boost::_bi::value<kudu::MaintenanceManager*> > >::operator()() /home/adar/Source/kudu/thirdparty/installed/tsan/include/boost/bind/bind.hpp:1222:16 (libkudu_util.so+0x16b753)
          #14 boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::MaintenanceManager>, boost::_bi::list1<boost::_bi::value<kudu::MaintenanceManager*> > >, void>::invoke(boost::detail::function::function_buffer&) /home/adar/Source/kudu/thirdparty/installed/tsan/include/boost/function/function_template.hpp:159:11 (libkudu_util.so+0x16b559)
          #15 boost::function0<void>::operator()() const /home/adar/Source/kudu/thirdparty/installed/tsan/include/boost/function/function_template.hpp:770:14 (libkrpc.so+0xb0c11)
          #16 kudu::Thread::SuperviseThread(void*) /home/adar/Source/kudu/src/kudu/util/thread.cc:591:3 (libkudu_util.so+0x1bce7e)
      
        Previous read of size 8 at 0x7f04796dc478 by thread T121:
          #0 kudu::process_memory::HardLimit() /home/adar/Source/kudu/src/kudu/util/process_memory.cc:217:10 (libkudu_util.so+0x1a540a)
          #1 kudu::MemTrackersHandler(kudu::WebCallbackRegistry::WebRequest const&, std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) /home/adar/Source/kudu/src/kudu/server/default-path-handlers.cc:149:24 (libserver_process.so+0x4ea1d)
          #2 boost::detail::function::void_function_invoker2<void (*)(kudu::WebCallbackRegistry::WebRequest const&, std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*), void, kudu::WebCallbackRegistry::WebRequest const&, std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>::invoke(boost::detail::function::function_buffer&, kudu::WebCallbackRegistry::WebRequest const&, std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) /home/adar/Source/kudu/thirdparty/installed/tsan/include/boost/function/function_template.hpp:118:11 (libserver_process.so+0x53762)
          #3 boost::function2<void, kudu::WebCallbackRegistry::WebRequest const&, std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>::operator()(kudu::WebCallbackRegistry::WebRequest const&, std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) const /home/adar/Source/kudu/thirdparty/installed/tsan/include/boost/function/function_template.hpp:770:14 (libserver_process.so+0x7a0a0)
          #4 kudu::Webserver::RunPathHandler(kudu::Webserver::PathHandler const&, sq_connection*, sq_request_info*) /home/adar/Source/kudu/src/kudu/server/webserver.cc:430:5 (libserver_process.so+0x78bcd)
          #5 kudu::Webserver::BeginRequestCallback(sq_connection*, sq_request_info*) /home/adar/Source/kudu/src/kudu/server/webserver.cc:374:10 (libserver_process.so+0x78730)
          #6 kudu::Webserver::BeginRequestCallbackStatic(sq_connection*) /home/adar/Source/kudu/src/kudu/server/webserver.cc:349:20 (libserver_process.so+0x78178)
          #7 handle_request /home/adar/Source/kudu/thirdparty/src/squeasel-c304d3f3481b07bf153979155f02e0aab24d01de/squeasel.c:3854:7 (libserver_process.so+0x8d9b0)
          #8 process_new_connection /home/adar/Source/kudu/thirdparty/src/squeasel-c304d3f3481b07bf153979155f02e0aab24d01de/squeasel.c:4464:7 (libserver_process.so+0x8ba27)
          #9 worker_thread /home/adar/Source/kudu/thirdparty/src/squeasel-c304d3f3481b07bf153979155f02e0aab24d01de/squeasel.c:4596 (libserver_process.so+0x8ba27)
      
        Location is global 'kudu::process_memory::(anonymous namespace)::g_hard_limit' of size 8 at 0x7f04796dc478 (libkudu_util.so+0x000000292478)
      
        Mutex M1221 (0x7b44000071f0) created at:
          #0 pthread_mutex_init /home/adar/Source/kudu/thirdparty/src/llvm-4.0.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1114 (kudu-tserver+0x4294fa)
          #1 kudu::Mutex::Mutex() /home/adar/Source/kudu/src/kudu/util/mutex.cc:58:8 (libkudu_util.so+0x187caf)
          #2 kudu::MaintenanceManager::MaintenanceManager(kudu::MaintenanceManager::Options const&) /home/adar/Source/kudu/src/kudu/util/maintenance_manager.cc:120:21 (libkudu_util.so+0x163b6f)
          #3 kudu::tserver::TabletServer::TabletServer(kudu::tserver::TabletServerOptions const&) /home/adar/Source/kudu/src/kudu/tserver/tablet_server.cc:52:30 (libtserver.so+0xc4631)
          #4 kudu::tserver::TabletServerMain(int, char**) /home/adar/Source/kudu/src/kudu/tserver/tablet_server_main.cc:70:16 (kudu-tserver+0x4ba9e3)
          #5 main /home/adar/Source/kudu/src/kudu/tserver/tablet_server_main.cc:91:10 (kudu-tserver+0x4ba71e)
      
        Thread T123 'maintenance_sch' (tid=19301, running) created by main thread at:
          #0 pthread_create /home/adar/Source/kudu/thirdparty/src/llvm-4.0.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:897 (kudu-tserver+0x4290fb)
          #1 kudu::Thread::StartThread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::function<void ()> const&, unsigned long, scoped_refptr<kudu::Thread>*) /home/adar/Source/kudu/src/kudu/util/thread.cc:514:15 (libkudu_util.so+0x1bc677)
          #2 kudu::Status kudu::Thread::Create<boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::MaintenanceManager>, boost::_bi::list1<boost::_bi::value<kudu::MaintenanceManager*> > > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::_bi::bind_t<void, boost::_mfi::mf0<void, kudu::MaintenanceManager>, boost::_bi::list1<boost::_bi::value<kudu::MaintenanceManager*> > > const&, scoped_refptr<kudu::Thread>*) /home/adar/Source/kudu/src/kudu/util/thread.h:152:12 (libkudu_util.so+0x1680eb)
          #3 kudu::MaintenanceManager::Init(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) /home/adar/Source/kudu/src/kudu/util/maintenance_manager.cc:146:3 (libkudu_util.so+0x16442b)
          #4 kudu::tserver::TabletServer::Start() /home/adar/Source/kudu/src/kudu/tserver/tablet_server.cc:122:3 (libtserver.so+0xc52f0)
          #5 kudu::tserver::TabletServerMain(int, char**) /home/adar/Source/kudu/src/kudu/tserver/tablet_server_main.cc:77:3 (kudu-tserver+0x4baaa8)
          #6 main /home/adar/Source/kudu/src/kudu/tserver/tablet_server_main.cc:91:10 (kudu-tserver+0x4ba71e)
      
        Thread T121 'sq_worker' (tid=19299, running) created by thread T120 at:
          #0 pthread_create /home/adar/Source/kudu/thirdparty/src/llvm-4.0.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:897 (kudu-tserver+0x4290fb)
          #1 sq_start_thread /home/adar/Source/kudu/thirdparty/src/squeasel-c304d3f3481b07bf153979155f02e0aab24d01de/squeasel.c:769:12 (libserver_process.so+0x896e9)
          #2 try_start_another_worker /home/adar/Source/kudu/thirdparty/src/squeasel-c304d3f3481b07bf153979155f02e0aab24d01de/squeasel.c:4621 (libserver_process.so+0x896e9)
          #3 produce_socket /home/adar/Source/kudu/thirdparty/src/squeasel-c304d3f3481b07bf153979155f02e0aab24d01de/squeasel.c:4636 (libserver_process.so+0x896e9)
          #4 accept_new_connection /home/adar/Source/kudu/thirdparty/src/squeasel-c304d3f3481b07bf153979155f02e0aab24d01de/squeasel.c:4693 (libserver_process.so+0x896e9)
          #5 master_thread /home/adar/Source/kudu/thirdparty/src/squeasel-c304d3f3481b07bf153979155f02e0aab24d01de/squeasel.c:4731 (libserver_process.so+0x896e9)
      
      SUMMARY: ThreadSanitizer: data race /home/adar/Source/kudu/src/kudu/util/process_memory.cc:166:16 in kudu::process_memory::(anonymous namespace)::DoInitLimits()
      ==================
      

        Attachments

          Activity

            People

            • Assignee:
              tlipcon Todd Lipcon
              Reporter:
              adar Adar Dembo
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: