Skip to content

Instantly share code, notes, and snippets.

@xanderdunn
Created April 25, 2021 02:35
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/5e0dcabcb81d8b6ef2604f2f31b385c9 to your computer and use it in GitHub Desktop.
Save xanderdunn/5e0dcabcb81d8b6ef2604f2f31b385c9 to your computer and use it in GitHub Desktop.
Thread Sanitizer warning with no log statements, only quill initialization
==================
WARNING: ThreadSanitizer: data race (pid=2708)
Read of size 8 at 0x7b4800002680 by thread T2:
#0 quill::detail::BackendWorker::_read_event_queue(quill::detail::ThreadContext*) <null> (MyDataPreProcessor+0x4314ea)
#1 quill::detail::BackendWorker::_main_loop() <null> (MyDataPreProcessor+0x430935)
#2 quill::detail::BackendWorker::run()::'lambda'()::operator()() const::'lambda'()::operator()() const <null> (MyDataPreProcessor+0x504447)
#3 std::thread::_State_impl<std::thread::_Invoker<std::tuple<quill::detail::BackendWorker::run()::'lambda'()::operator()() const::'lambda'()> > >::_M_run() <null> (MyDataPreProcessor+0x5042d9)
#4 execute_native_thread_routine /home/conda/feedstock_root/build_artifacts/ctng-compilers_1618239181388/work/.build/x86_64-conda-linux-gnu/src/gcc/libstdc++-v3/src/c++11/thread.cc:80:18 (libstdc++.so.6+0xc9066)
Previous write of size 8 at 0x7b4800002680 by main thread:
#0 posix_memalign <null> (MyDataPreProcessor+0x43b6b8)
#1 quill::detail::aligned_alloc(unsigned long, unsigned long) <null> (MyDataPreProcessor+0x54f736)
#2 initialize_logging() <null> (MyDataPreProcessor+0x4d7f12)
#3 run_historical_data_preprocessing() <null> (MyDataPreProcessor+0x4d7fe2)
#4 main <null> (MyDataPreProcessor+0x4d806f)
As if synchronized via sleep:
#0 nanosleep <null> (MyDataPreProcessor+0x43954d)
#1 quill::detail::BackendWorker::_main_loop() <null> (MyDataPreProcessor+0x430a7d)
#2 quill::detail::BackendWorker::run()::'lambda'()::operator()() const::'lambda'()::operator()() const <null> (MyDataPreProcessor+0x504447)
#3 std::thread::_State_impl<std::thread::_Invoker<std::tuple<quill::detail::BackendWorker::run()::'lambda'()::operator()() const::'lambda'()> > >::_M_run() <null> (MyDataPreProcessor+0x5042d9)
#4 execute_native_thread_routine /home/conda/feedstock_root/build_artifacts/ctng-compilers_1618239181388/work/.build/x86_64-conda-linux-gnu/src/gcc/libstdc++-v3/src/c++11/thread.cc:80:18 (libstdc++.so.6+0xc9066)
Location is heap block of size 384 at 0x7b4800002580 allocated by main thread:
#0 posix_memalign <null> (MyDataPreProcessor+0x43b6b8)
#1 quill::detail::aligned_alloc(unsigned long, unsigned long) <null> (MyDataPreProcessor+0x54f736)
#2 initialize_logging() <null> (MyDataPreProcessor+0x4d7f12)
#3 run_historical_data_preprocessing() <null> (MyDataPreProcessor+0x4d7fe2)
#4 main <null> (MyDataPreProcessor+0x4d806f)
Thread T2 'Quill_Backend' (tid=2711, running) created by main thread at:
#0 pthread_create <null> (MyDataPreProcessor+0x43bbfb)
#1 __gthread_create /home/conda/feedstock_root/build_artifacts/ctng-compilers_1618239181388/work/.build/x86_64-conda-linux-gnu/build/build-cc-gcc-final/x86_64-conda-linux-gnu/libstdc++-v3/include/x86_64-conda-linux-gnu/bits/gthr-default.h:676:35 (libstdc++.so.6+0xc91f8)
#2 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /home/conda/feedstock_root/build_artifacts/ctng-compilers_1618239181388/work/.build/x86_64-conda-linux-gnu/src/gcc/libstdc++-v3/src/c++11/thread.cc:135:37 (libstdc++.so.6+0xc91f8)
#3 void std::call_once<quill::detail::BackendWorker::run()::'lambda'()>(std::once_flag&, quill::detail::BackendWorker::run()::'lambda'()&&)::'lambda0'()::__invoke() <null> (MyDataPreProcessor+0x5040d6)
#4 pthread_once <null> (MyDataPreProcessor+0x43efb5)
#5 void std::call_once<quill::detail::BackendWorker::run()::'lambda'()>(std::once_flag&, quill::detail::BackendWorker::run()::'lambda'()&&) <null> (MyDataPreProcessor+0x504070)
#6 quill::detail::LogManager::start_backend_worker(bool, std::initializer_list<int> const&) <null> (MyDataPreProcessor+0x428da2)
#7 quill::start(bool, std::initializer_list<int>) <null> (MyDataPreProcessor+0x428ce7)
#8 initialize_logging() <null> (MyDataPreProcessor+0x4d7e9f)
#9 run_historical_data_preprocessing() <null> (MyDataPreProcessor+0x4d7fe2)
#10 main <null> (MyDataPreProcessor+0x4d806f)
SUMMARY: ThreadSanitizer: data race (/home/xander/dev/My_model/MyDataPreProcessor+0x4314ea) in quill::detail::BackendWorker::_read_event_queue(quill::detail::ThreadContext*)
==================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment