Skip to content

Instantly share code, notes, and snippets.

@aaronchongth
Last active April 26, 2021 05:28
Show Gist options
  • Save aaronchongth/f6c96f19a3322c6732956f1eb057e943 to your computer and use it in GitHub Desktop.
Save aaronchongth/f6c96f19a3322c6732956f1eb057e943 to your computer and use it in GitHub Desktop.
aaron@biryani:~/workspaces/rmf$ ./build/rmf_battery/test_rmf_battery
==================
WARNING: ThreadSanitizer: data race (pid=222783)
Write of size 4 at 0x55eed75ff2f8 by thread T1:
#0 thread_fn() /home/aaron/workspaces/rmf/src/rmf/rmf_battery/rmf_battery/test/unit/agv/test_Race.cpp:8 (test_rmf_battery+0xd70ec)
#1 void std::__invoke_impl<void, void (*&)()>(std::__invoke_other, void (*&)()) /usr/include/c++/9/bits/invoke.h:60 (test_rmf_battery+0xd7262)
#2 std::__invoke_result<void (*&)()>::type std::__invoke<void (*&)()>(void (*&)()) /usr/include/c++/9/bits/invoke.h:95 (test_rmf_battery+0xd7262)
#3 void std::_Bind<void (*())()>::__call<void>(std::tuple<>&&, std::_Index_tuple<>) /usr/include/c++/9/functional:400 (test_rmf_battery+0xd7262)
#4 void std::_Bind<void (*())()>::operator()<, void>() /usr/include/c++/9/functional:484 (test_rmf_battery+0xd7262)
#5 void std::__invoke_impl<void, std::_Bind<void (*())()>>(std::__invoke_other, std::_Bind<void (*())()>&&) /usr/include/c++/9/bits/invoke.h:60 (test_rmf_battery+0xd7262)
#6 std::__invoke_result<std::_Bind<void (*())()>>::type std::__invoke<std::_Bind<void (*())()>>(std::_Bind<void (*())()>&&) /usr/include/c++/9/bits/invoke.h:95 (test_rmf_battery+0xd7262)
#7 void std::thread::_Invoker<std::tuple<std::_Bind<void (*())()> > >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/9/thread:244 (test_rmf_battery+0xd7262)
#8 std::thread::_Invoker<std::tuple<std::_Bind<void (*())()> > >::operator()() /usr/include/c++/9/thread:251 (test_rmf_battery+0xd7262)
#9 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::_Bind<void (*())()> > > >::_M_run() /usr/include/c++/9/thread:195 (test_rmf_battery+0xd7262)
#10 <null> <null> (libstdc++.so.6+0xd6d83)
Previous write of size 4 at 0x55eed75ff2f8 by main thread:
#0 ____C_A_T_C_H____T_E_S_T____0 /home/aaron/workspaces/rmf/src/rmf/rmf_battery/rmf_battery/test/unit/agv/test_Race.cpp:15 (test_rmf_battery+0xd71d0)
#1 Catch::TestInvokerAsFunction::invoke() const /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:13230 (test_rmf_battery+0x2d4b0)
#2 Catch::TestCase::invoke() const /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:13103 (test_rmf_battery+0x2d4b0)
#3 Catch::RunContext::invokeActiveTestCase() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11760 (test_rmf_battery+0x2d4b0)
#4 Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11730 (test_rmf_battery+0x5c5ef)
#5 Catch::RunContext::runTest(Catch::TestCase const&) /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11462 (test_rmf_battery+0x66049)
#6 Catch::Session::runInternal() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:12088 (test_rmf_battery+0x6c694)
#7 Catch::Session::run() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:12272 (test_rmf_battery+0x6cf28)
#8 int Catch::Session::run<char>(int, char const* const*) /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11980 (test_rmf_battery+0x1dbf5)
#9 main /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:16523 (test_rmf_battery+0x1dbf5)
Location is global 'global' of size 4 at 0x55eed75ff2f8 (test_rmf_battery+0x0000001102f8)
Thread T1 (tid=222785, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x5ea99)
#1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xd7048)
#2 Catch::TestInvokerAsFunction::invoke() const /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:13230 (test_rmf_battery+0x2d4b0)
#3 Catch::TestCase::invoke() const /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:13103 (test_rmf_battery+0x2d4b0)
#4 Catch::RunContext::invokeActiveTestCase() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11760 (test_rmf_battery+0x2d4b0)
#5 Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11730 (test_rmf_battery+0x5c5ef)
#6 Catch::RunContext::runTest(Catch::TestCase const&) /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11462 (test_rmf_battery+0x66049)
#7 Catch::Session::runInternal() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:12088 (test_rmf_battery+0x6c694)
#8 Catch::Session::run() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:12272 (test_rmf_battery+0x6cf28)
#9 int Catch::Session::run<char>(int, char const* const*) /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11980 (test_rmf_battery+0x1dbf5)
#10 main /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:16523 (test_rmf_battery+0x1dbf5)
SUMMARY: ThreadSanitizer: data race /home/aaron/workspaces/rmf/src/rmf/rmf_battery/rmf_battery/test/unit/agv/test_Race.cpp:8 in thread_fn()
==================
===============================================================================
All tests passed (49 assertions in 7 test cases)
ThreadSanitizer: reported 1 warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment