Skip to content

Instantly share code, notes, and snippets.

@aaronchongth
Created April 26, 2021 05:54
Show Gist options
  • Save aaronchongth/7adc89f70612889f4f8c7337bcce0c0c to your computer and use it in GitHub Desktop.
Save aaronchongth/7adc89f70612889f4f8c7337bcce0c0c to your computer and use it in GitHub Desktop.
aaron@biryani:~/workspaces/rmf$ ./build/rmf_task/test_rmf_task
==================
WARNING: ThreadSanitizer: data race (pid=233936)
Write of size 4 at 0x559a94a322e8 by thread T1:
#0 thread_fn() /home/aaron/workspaces/rmf/src/rmf/rmf_task/rmf_task/test/unit/agv/test_Race.cpp:8 (test_rmf_task+0xdc49c)
#1 void std::__invoke_impl<void, void (*&)()>(std::__invoke_other, void (*&)()) /usr/include/c++/9/bits/invoke.h:60 (test_rmf_task+0xdc612)
#2 std::__invoke_result<void (*&)()>::type std::__invoke<void (*&)()>(void (*&)()) /usr/include/c++/9/bits/invoke.h:95 (test_rmf_task+0xdc612)
#3 void std::_Bind<void (*())()>::__call<void>(std::tuple<>&&, std::_Index_tuple<>) /usr/include/c++/9/functional:400 (test_rmf_task+0xdc612)
#4 void std::_Bind<void (*())()>::operator()<, void>() /usr/include/c++/9/functional:484 (test_rmf_task+0xdc612)
#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_task+0xdc612)
#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_task+0xdc612)
#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_task+0xdc612)
#8 std::thread::_Invoker<std::tuple<std::_Bind<void (*())()> > >::operator()() /usr/include/c++/9/thread:251 (test_rmf_task+0xdc612)
#9 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::_Bind<void (*())()> > > >::_M_run() /usr/include/c++/9/thread:195 (test_rmf_task+0xdc612)
#10 <null> <null> (libstdc++.so.6+0xd6d83)
Previous write of size 4 at 0x559a94a322e8 by main thread:
#0 ____C_A_T_C_H____T_E_S_T____0 /home/aaron/workspaces/rmf/src/rmf/rmf_task/rmf_task/test/unit/agv/test_Race.cpp:15 (test_rmf_task+0xdc580)
#1 Catch::TestInvokerAsFunction::invoke() const /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:13230 (test_rmf_task+0x35ff0)
#2 Catch::TestCase::invoke() const /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:13103 (test_rmf_task+0x35ff0)
#3 Catch::RunContext::invokeActiveTestCase() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11760 (test_rmf_task+0x35ff0)
#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_task+0x6512f)
#5 Catch::RunContext::runTest(Catch::TestCase const&) /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11462 (test_rmf_task+0x6eb89)
#6 Catch::Session::runInternal() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:12088 (test_rmf_task+0x751d4)
#7 Catch::Session::run() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:12272 (test_rmf_task+0x75a68)
#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_task+0x26c45)
#9 main /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:16523 (test_rmf_task+0x26c45)
Location is global 'global' of size 4 at 0x559a94a322e8 (test_rmf_task+0x0000001432e8)
Thread T1 (tid=233938, 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_task+0x35ff0)
#3 Catch::TestCase::invoke() const /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:13103 (test_rmf_task+0x35ff0)
#4 Catch::RunContext::invokeActiveTestCase() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11760 (test_rmf_task+0x35ff0)
#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_task+0x6512f)
#6 Catch::RunContext::runTest(Catch::TestCase const&) /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:11462 (test_rmf_task+0x6eb89)
#7 Catch::Session::runInternal() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:12088 (test_rmf_task+0x751d4)
#8 Catch::Session::run() /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:12272 (test_rmf_task+0x75a68)
#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_task+0x26c45)
#10 main /home/aaron/workspaces/rmf/install/rmf_utils/include/rmf_utils/catch.hpp:16523 (test_rmf_task+0x26c45)
SUMMARY: ThreadSanitizer: data race /home/aaron/workspaces/rmf/src/rmf/rmf_task/rmf_task/test/unit/agv/test_Race.cpp:8 in thread_fn()
==================
===============================================================================
All tests passed (93 assertions in 4 test cases)
ThreadSanitizer: reported 1 warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment