Skip to content

Instantly share code, notes, and snippets.

@xanderdunn
Created May 11, 2021 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xanderdunn/9db8e2b465045063c3d7998de841a7e1 to your computer and use it in GitHub Desktop.
Save xanderdunn/9db8e2b465045063c3d7998de841a7e1 to your computer and use it in GitHub Desktop.
72b434b Thread Sanitizer warning
==================
WARNING: ThreadSanitizer: data race (pid=8785)
Read of size 8 at 0x7b4c00000640 by thread T1:
#0 quill::detail::UnboundedSPSCEventQueue<quill::detail::BaseEvent>::try_pop() /home/xander/dev/quill/quill/include/quill/detail/spsc_queue/UnboundedSPSCEventQueue.h:140 (test.exe+0x165fc)
#1 quill::detail::BackendWorker::_read_event_queue(quill::detail::ThreadContext*) /home/xander/dev/quill/quill/include/quill/detail/backend/BackendWorker.h:352 (test.exe+0x165fc)
#2 quill::detail::BackendWorker::_populate_priority_queue(std::vector<quill::detail::ThreadContext*, quill::detail::CacheAlignedAllocator<quill::detail::ThreadContext*> > const&) /home/xander/dev/quill/quill/include/quill/detail/backend/BackendWorker.h:335 (test.exe+0x16516)
#3 quill::detail::BackendWorker::_exit() /home/xander/dev/quill/quill/include/quill/detail/backend/BackendWorker.h:605 (test.exe+0x18643)
#4 quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const /home/xander/dev/quill/quill/include/quill/detail/backend/BackendWorker.h:307 (test.exe+0x15da8)
#5 void std::__invoke_impl<void, quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}>(std::__invoke_other, quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}&&) /usr/include/c++/10/bits/invoke.h:60 (test.exe+0x2dbfe)
#6 std::__invoke_result<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}>::type std::__invoke<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}>(quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}&&, (std::__invoke_result&&)...) /usr/include/c++/10/bits/invoke.h:95 (test.exe+0x2d65e)
#7 void std::thread::_Invoker<std::tuple<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/10/thread:264 (test.exe+0x2d2de)
#8 std::thread::_Invoker<std::tuple<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}> >::operator()() /usr/include/c++/10/thread:271 (test.exe+0x2ca42)
#9 std::thread::_State_impl<std::thread::_Invoker<std::tuple<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}> > >::_M_run() /usr/include/c++/10/thread:215 (test.exe+0x2bbe8)
#10 <null> <null> (libstdc++.so.6+0xd0e8f)
Previous write of size 8 at 0x7b4c00000640 by main thread:
#0 posix_memalign <null> (libtsan.so.0+0x2f579)
#1 quill::detail::aligned_alloc(unsigned long, unsigned long) <null> (test.exe+0x34176)
#2 initialize_logging() /home/xander/dev/plutus_model/test.cpp:35 (test.exe+0x11f7e)
#3 main /home/xander/dev/plutus_model/test.cpp:40 (test.exe+0x12142)
As if synchronized via sleep:
#0 nanosleep <null> (libtsan.so.0+0x61cbc)
#1 void std::this_thread::sleep_for<long, std::ratio<1l, 1000000000l> >(std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&) /usr/include/c++/10/thread:401 (test.exe+0x1bad3)
#2 quill::detail::BackendWorker::_main_loop() /home/xander/dev/quill/quill/include/quill/detail/backend/BackendWorker.h:571 (test.exe+0x1857b)
#3 quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const /home/xander/dev/quill/quill/include/quill/detail/backend/BackendWorker.h:296 (test.exe+0x15d8b)
#4 void std::__invoke_impl<void, quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}>(std::__invoke_other, quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}&&) /usr/include/c++/10/bits/invoke.h:60 (test.exe+0x2dbfe)
#5 std::__invoke_result<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}>::type std::__invoke<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}>(quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}&&, (std::__invoke_result&&)...) /usr/include/c++/10/bits/invoke.h:95 (test.exe+0x2d65e)
#6 void std::thread::_Invoker<std::tuple<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/10/thread:264 (test.exe+0x2d2de)
#7 std::thread::_Invoker<std::tuple<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}> >::operator()() /usr/include/c++/10/thread:271 (test.exe+0x2ca42)
#8 std::thread::_State_impl<std::thread::_Invoker<std::tuple<quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const::{lambda()#1}> > >::_M_run() /usr/include/c++/10/thread:215 (test.exe+0x2bbe8)
#9 <null> <null> (libstdc++.so.6+0xd0e8f)
Location is heap block of size 448 at 0x7b4c00000540 allocated by main thread:
#0 posix_memalign <null> (libtsan.so.0+0x2f579)
#1 quill::detail::aligned_alloc(unsigned long, unsigned long) <null> (test.exe+0x34176)
#2 initialize_logging() /home/xander/dev/plutus_model/test.cpp:35 (test.exe+0x11f7e)
#3 main /home/xander/dev/plutus_model/test.cpp:40 (test.exe+0x12142)
Thread T1 'Quill_Backend' (tid=8787, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x5d445)
#1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xd1124)
#2 quill::detail::BackendWorker::run()::{lambda()#1}::operator()() const /home/xander/dev/quill/quill/include/quill/detail/backend/BackendWorker.h:315 (test.exe+0x15a8a)
#3 void std::__invoke_impl<void, quill::detail::BackendWorker::run()::{lambda()#1}>(std::__invoke_other, quill::detail::BackendWorker::run()::{lambda()#1}&&) /usr/include/c++/10/bits/invoke.h:60 (test.exe+0x22da9)
#4 std::__invoke_result<quill::detail::BackendWorker::run()::{lambda()#1}>::type std::__invoke<quill::detail::BackendWorker::run()::{lambda()#1}>(std::__invoke_result&&, (quill::detail::BackendWorker::run()::{lambda()#1}&&)...) /usr/include/c++/10/bits/invoke.h:95 (test.exe+0x1edf3)
#5 std::call_once<quill::detail::BackendWorker::run()::{lambda()#1}>(std::once_flag&, quill::detail::BackendWorker::run()::{lambda()#1}&&)::{lambda()#1}::operator()() const /usr/include/c++/10/mutex:717 (test.exe+0x1ad7b)
#6 std::call_once<quill::detail::BackendWorker::run()::{lambda()#1}>(std::once_flag&, quill::detail::BackendWorker::run()::{lambda()#1}&&)::{lambda()#2}::operator()() const /usr/include/c++/10/mutex:722 (test.exe+0x1ade2)
#7 std::call_once<quill::detail::BackendWorker::run()::{lambda()#1}>(std::once_flag&, quill::detail::BackendWorker::run()::{lambda()#1}&&)::{lambda()#2}::_FUN() /usr/include/c++/10/mutex:722 (test.exe+0x1ae21)
#8 pthread_once <null> (libtsan.so.0+0x40784)
#9 __gthread_once /usr/include/x86_64-linux-gnu/c++/10/bits/gthr-default.h:700 (test.exe+0x130f7)
#10 void std::call_once<quill::detail::BackendWorker::run()::{lambda()#1}>(std::once_flag&, quill::detail::BackendWorker::run()::{lambda()#1}&&) /usr/include/c++/10/mutex:729 (test.exe+0x1af14)
#11 quill::detail::BackendWorker::run() /home/xander/dev/quill/quill/include/quill/detail/backend/BackendWorker.h:249 (test.exe+0x1633a)
#12 quill::detail::LogManager::start_backend_worker(bool, std::initializer_list<int> const&) /home/xander/dev/quill/quill/include/quill/detail/LogManager.h:150 (test.exe+0x18729)
#13 quill::start(bool, std::initializer_list<int>) /home/xander/dev/quill/quill/include/quill/Quill.h:60 (test.exe+0x187df)
#14 initialize_logging() /home/xander/dev/plutus_model/test.cpp:30 (test.exe+0x11eba)
#15 main /home/xander/dev/plutus_model/test.cpp:40 (test.exe+0x12142)
SUMMARY: ThreadSanitizer: data race /home/xander/dev/quill/quill/include/quill/detail/spsc_queue/UnboundedSPSCEventQueue.h:140 in quill::detail::UnboundedSPSCEventQueue<quill::detail::BaseEvent>::try_pop()
==================
ThreadSanitizer: reported 1 warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment