Advertisement
Guest User

Untitled

a guest
Aug 19th, 2021
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.35 KB | None | 0 0
  1. ==================
  2. WARNING: ThreadSanitizer: double lock of a mutex (pid=72217)
  3. #0 pthread_mutex_lock /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4250 (libtsan.so.0+0x54b6a)
  4. #1 __gthread_mutex_lock(pthread_mutex_t*) <null> (a.out+0x2df5)
  5. #2 std::mutex::lock() <null> (a.out+0x2e7a)
  6. #3 std::scoped_lock<std::mutex>::scoped_lock(std::mutex&) <null> (a.out+0x4c4a)
  7. #4 Test::check() <null> (a.out+0x2628)
  8. #5 check_th() <null> (a.out+0x27d7)
  9. #6 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  10. #7 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  11. #8 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  12. #9 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  13. #10 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  14. #11 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  15.  
  16. Location is global 't' of size 168 at 0x5566b5a9d1c0 (a.out+0x0000000111c0)
  17.  
  18. Mutex M10 (0x5566b5a9d1c0) created at:
  19. #0 pthread_mutex_lock /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4250 (libtsan.so.0+0x54b6a)
  20. #1 __gthread_mutex_lock(pthread_mutex_t*) <null> (a.out+0x2df5)
  21. #2 std::mutex::lock() <null> (a.out+0x2e7a)
  22. #3 std::unique_lock<std::mutex>::lock() <null> (a.out+0x5715)
  23. #4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) <null> (a.out+0x4998)
  24. #5 Test::read() <null> (a.out+0x24c4)
  25. #6 read_th() <null> (a.out+0x277a)
  26. #7 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  27. #8 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  28. #9 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  29. #10 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  30. #11 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  31. #12 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  32.  
  33. SUMMARY: ThreadSanitizer: double lock of a mutex (/tmp/a.out+0x2df5) in __gthread_mutex_lock(pthread_mutex_t*)
  34. ==================
  35. ==================
  36. WARNING: ThreadSanitizer: data race (pid=72217)
  37. Read of size 8 at 0x5566b5a9d248 by thread T2 (mutexes: write M10):
  38. #0 std::operator-(std::_Deque_iterator<std::weak_ptr<Mes>, std::weak_ptr<Mes>&, std::weak_ptr<Mes>*> const&, std::_Deque_iterator<std::weak_ptr<Mes>, std::weak_ptr<Mes>&, std::weak_ptr<Mes>*> const&) <null> (a.out+0x6c4f)
  39. #1 std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::size() const <null> (a.out+0x5d59)
  40. #2 std::queue<std::weak_ptr<Mes>, std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > > >::size() const <null> (a.out+0x4ccc)
  41. #3 Test::check() <null> (a.out+0x2638)
  42. #4 check_th() <null> (a.out+0x27d7)
  43. #5 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  44. #6 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  45. #7 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  46. #8 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  47. #9 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  48. #10 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  49.  
  50. Previous write of size 8 at 0x5566b5a9d248 by thread T1 (mutexes: write M10):
  51. #0 std::weak_ptr<Mes>& std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::emplace_back<std::weak_ptr<Mes> >(std::weak_ptr<Mes>&&) <null> (a.out+0x6942)
  52. #1 std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::push_back(std::weak_ptr<Mes>&&) <null> (a.out+0x5a3e)
  53. #2 std::queue<std::weak_ptr<Mes>, std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > > >::push(std::weak_ptr<Mes>&&) <null> (a.out+0x4b77)
  54. #3 Test::read() <null> (a.out+0x24fa)
  55. #4 read_th() <null> (a.out+0x277a)
  56. #5 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  57. #6 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  58. #7 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  59. #8 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  60. #9 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  61. #10 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  62.  
  63. Location is global 't' of size 168 at 0x5566b5a9d1c0 (a.out+0x000000011248)
  64.  
  65. Mutex M10 (0x5566b5a9d1c0) created at:
  66. #0 pthread_mutex_lock /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4250 (libtsan.so.0+0x54b6a)
  67. #1 __gthread_mutex_lock(pthread_mutex_t*) <null> (a.out+0x2df5)
  68. #2 std::mutex::lock() <null> (a.out+0x2e7a)
  69. #3 std::unique_lock<std::mutex>::lock() <null> (a.out+0x5715)
  70. #4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) <null> (a.out+0x4998)
  71. #5 Test::read() <null> (a.out+0x24c4)
  72. #6 read_th() <null> (a.out+0x277a)
  73. #7 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  74. #8 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  75. #9 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  76. #10 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  77. #11 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  78. #12 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  79.  
  80. Thread T2 (tid=72220, running) created by main thread at:
  81. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  82. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  83. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  84. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  85. #4 main <null> (a.out+0x2851)
  86.  
  87. Thread T1 (tid=72219, running) created by main thread at:
  88. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  89. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  90. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  91. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  92. #4 main <null> (a.out+0x283b)
  93.  
  94. SUMMARY: ThreadSanitizer: data race (/tmp/a.out+0x6c4f) in std::operator-(std::_Deque_iterator<std::weak_ptr<Mes>, std::weak_ptr<Mes>&, std::weak_ptr<Mes>*> const&, std::_Deque_iterator<std::weak_ptr<Mes>, std::weak_ptr<Mes>&, std::weak_ptr<Mes>*> const&)
  95. ==================
  96. ==================
  97. WARNING: ThreadSanitizer: data race (pid=72217)
  98. Read of size 8 at 0x7b5000000008 by thread T2 (mutexes: write M10):
  99. #0 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t) <null> (a.out+0x7c2e)
  100. #1 std::__shared_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__weak_ptr<Mes, (__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t) <null> (a.out+0x6d37)
  101. #2 std::shared_ptr<Mes>::shared_ptr(std::weak_ptr<Mes> const&, std::nothrow_t) <null> (a.out+0x5e08)
  102. #3 std::weak_ptr<Mes>::lock() const <null> (a.out+0x4d46)
  103. #4 Test::check() <null> (a.out+0x2668)
  104. #5 check_th() <null> (a.out+0x27d7)
  105. #6 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  106. #7 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  107. #8 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  108. #9 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  109. #10 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  110. #11 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  111.  
  112. Previous write of size 8 at 0x7b5000000008 by thread T1 (mutexes: write M10):
  113. #0 std::__weak_count<(__gnu_cxx::_Lock_policy)2>::__weak_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2>&&) <null> (a.out+0x8cb9)
  114. #1 std::__weak_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__weak_ptr(std::__weak_ptr<Mes, (__gnu_cxx::_Lock_policy)2>&&) <null> (a.out+0x8433)
  115. #2 std::weak_ptr<Mes>::weak_ptr(std::weak_ptr<Mes>&&) <null> (a.out+0x769c)
  116. #3 decltype (::new ((void*)(0)) std::weak_ptr<Mes>((declval<std::weak_ptr<Mes> >)())) std::construct_at<std::weak_ptr<Mes>, std::weak_ptr<Mes> >(std::weak_ptr<Mes>*, std::weak_ptr<Mes>&&) <null> (a.out+0x76f1)
  117. #4 void std::allocator_traits<std::allocator<std::weak_ptr<Mes> > >::construct<std::weak_ptr<Mes>, std::weak_ptr<Mes> >(std::allocator<std::weak_ptr<Mes> >&, std::weak_ptr<Mes>*, std::weak_ptr<Mes>&&) <null> (a.out+0x7740)
  118. #5 std::weak_ptr<Mes>& std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::emplace_back<std::weak_ptr<Mes> >(std::weak_ptr<Mes>&&) <null> (a.out+0x6916)
  119. #6 std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::push_back(std::weak_ptr<Mes>&&) <null> (a.out+0x5a3e)
  120. #7 std::queue<std::weak_ptr<Mes>, std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > > >::push(std::weak_ptr<Mes>&&) <null> (a.out+0x4b77)
  121. #8 Test::read() <null> (a.out+0x24fa)
  122. #9 read_th() <null> (a.out+0x277a)
  123. #10 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  124. #11 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  125. #12 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  126. #13 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  127. #14 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  128. #15 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  129.  
  130. Location is heap block of size 512 at 0x7b5000000000 allocated by main thread:
  131. #0 operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/tsan/tsan_new_delete.cpp:64 (libtsan.so.0+0x91824)
  132. #1 __gnu_cxx::new_allocator<std::weak_ptr<Mes> >::allocate(unsigned long, void const*) <null> (a.out+0x9a4a)
  133. #2 std::allocator_traits<std::allocator<std::weak_ptr<Mes> > >::allocate(std::allocator<std::weak_ptr<Mes> >&, unsigned long) <null> (a.out+0x8884)
  134. #3 std::_Deque_base<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::_M_allocate_node() <null> (a.out+0x80f8)
  135. #4 std::_Deque_base<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::_M_create_nodes(std::weak_ptr<Mes>**, std::weak_ptr<Mes>**) <null> (a.out+0x7272)
  136. #5 std::_Deque_base<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::_M_initialize_map(unsigned long) <null> (a.out+0x6281)
  137. #6 std::_Deque_base<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::_Deque_base() <null> (a.out+0x545f)
  138. #7 std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::deque() <null> (a.out+0x47ca)
  139. #8 std::queue<std::weak_ptr<Mes>, std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > > >::queue<std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >, void>() <null> (a.out+0x4874)
  140. #9 Test::Test() <null> (a.out+0x3eec)
  141. #10 __static_initialization_and_destruction_0(int, int) <null> (a.out+0x2a52)
  142. #11 _GLOBAL__sub_I_t <null> (a.out+0x2ab4)
  143. #12 __libc_csu_init <null> (a.out+0xa6fc)
  144.  
  145. Mutex M10 (0x5566b5a9d1c0) created at:
  146. #0 pthread_mutex_lock /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4250 (libtsan.so.0+0x54b6a)
  147. #1 __gthread_mutex_lock(pthread_mutex_t*) <null> (a.out+0x2df5)
  148. #2 std::mutex::lock() <null> (a.out+0x2e7a)
  149. #3 std::unique_lock<std::mutex>::lock() <null> (a.out+0x5715)
  150. #4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) <null> (a.out+0x4998)
  151. #5 Test::read() <null> (a.out+0x24c4)
  152. #6 read_th() <null> (a.out+0x277a)
  153. #7 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  154. #8 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  155. #9 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  156. #10 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  157. #11 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  158. #12 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  159.  
  160. Thread T2 (tid=72220, running) created by main thread at:
  161. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  162. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  163. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  164. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  165. #4 main <null> (a.out+0x2851)
  166.  
  167. Thread T1 (tid=72219, running) created by main thread at:
  168. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  169. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  170. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  171. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  172. #4 main <null> (a.out+0x283b)
  173.  
  174. SUMMARY: ThreadSanitizer: data race (/tmp/a.out+0x7c2e) in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t)
  175. ==================
  176. ==================
  177. WARNING: ThreadSanitizer: data race (pid=72217)
  178. Atomic read of size 4 at 0x7b0800001028 by thread T2 (mutexes: write M10):
  179. #0 __tsan_atomic32_load /build/gcc/src/gcc/libsanitizer/tsan/tsan_interface_atomic.cpp:534 (libtsan.so.0+0x81eaf)
  180. #1 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_get_use_count() const <null> (a.out+0x473f)
  181. #2 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_lock_nothrow() <null> (a.out+0x3d31)
  182. #3 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t) <null> (a.out+0x7c7b)
  183. #4 std::__shared_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__weak_ptr<Mes, (__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t) <null> (a.out+0x6d37)
  184. #5 std::shared_ptr<Mes>::shared_ptr(std::weak_ptr<Mes> const&, std::nothrow_t) <null> (a.out+0x5e08)
  185. #6 std::weak_ptr<Mes>::lock() const <null> (a.out+0x4d46)
  186. #7 Test::check() <null> (a.out+0x2668)
  187. #8 check_th() <null> (a.out+0x27d7)
  188. #9 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  189. #10 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  190. #11 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  191. #12 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  192. #13 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  193. #14 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  194.  
  195. Previous write of size 8 at 0x7b0800001028 by thread T1 (mutexes: write M10):
  196. #0 operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/tsan/tsan_new_delete.cpp:64 (libtsan.so.0+0x91824)
  197. #1 __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) <null> (a.out+0x9cfd)
  198. #2 std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) <null> (a.out+0x94e6)
  199. #3 std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >&) <null> (a.out+0x8988)
  200. #4 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<Mes, std::allocator<Mes>>(Mes*&, std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x82c1)
  201. #5 std::__shared_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<Mes>>(std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x7564)
  202. #6 std::shared_ptr<Mes>::shared_ptr<std::allocator<Mes>>(std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x67e5)
  203. #7 std::shared_ptr<Mes> std::allocate_shared<Mes, std::allocator<Mes>>(std::allocator<Mes> const&) <null> (a.out+0x5862)
  204. #8 std::shared_ptr<Mes> std::make_shared<Mes>() <null> (a.out+0x4a60)
  205. #9 Test::read() <null> (a.out+0x24d0)
  206. #10 read_th() <null> (a.out+0x277a)
  207. #11 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  208. #12 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  209. #13 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  210. #14 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  211. #15 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  212. #16 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  213.  
  214. Location is heap block of size 24 at 0x7b0800001020 allocated by thread T1:
  215. #0 operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/tsan/tsan_new_delete.cpp:64 (libtsan.so.0+0x91824)
  216. #1 __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) <null> (a.out+0x9cfd)
  217. #2 std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) <null> (a.out+0x94e6)
  218. #3 std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >&) <null> (a.out+0x8988)
  219. #4 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<Mes, std::allocator<Mes>>(Mes*&, std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x82c1)
  220. #5 std::__shared_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<Mes>>(std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x7564)
  221. #6 std::shared_ptr<Mes>::shared_ptr<std::allocator<Mes>>(std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x67e5)
  222. #7 std::shared_ptr<Mes> std::allocate_shared<Mes, std::allocator<Mes>>(std::allocator<Mes> const&) <null> (a.out+0x5862)
  223. #8 std::shared_ptr<Mes> std::make_shared<Mes>() <null> (a.out+0x4a60)
  224. #9 Test::read() <null> (a.out+0x24d0)
  225. #10 read_th() <null> (a.out+0x277a)
  226. #11 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  227. #12 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  228. #13 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  229. #14 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  230. #15 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  231. #16 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  232.  
  233. Mutex M10 (0x5566b5a9d1c0) created at:
  234. #0 pthread_mutex_lock /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4250 (libtsan.so.0+0x54b6a)
  235. #1 __gthread_mutex_lock(pthread_mutex_t*) <null> (a.out+0x2df5)
  236. #2 std::mutex::lock() <null> (a.out+0x2e7a)
  237. #3 std::unique_lock<std::mutex>::lock() <null> (a.out+0x5715)
  238. #4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) <null> (a.out+0x4998)
  239. #5 Test::read() <null> (a.out+0x24c4)
  240. #6 read_th() <null> (a.out+0x277a)
  241. #7 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  242. #8 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  243. #9 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  244. #10 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  245. #11 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  246. #12 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  247.  
  248. Thread T2 (tid=72220, running) created by main thread at:
  249. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  250. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  251. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  252. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  253. #4 main <null> (a.out+0x2851)
  254.  
  255. Thread T1 (tid=72219, running) created by main thread at:
  256. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  257. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  258. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  259. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  260. #4 main <null> (a.out+0x283b)
  261.  
  262. SUMMARY: ThreadSanitizer: data race (/tmp/a.out+0x473f) in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_get_use_count() const
  263. ==================
  264. ==================
  265. WARNING: ThreadSanitizer: data race (pid=72217)
  266. Read of size 8 at 0x7b5000000000 by thread T2 (mutexes: write M10):
  267. #0 std::__shared_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__weak_ptr<Mes, (__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t) <null> (a.out+0x6d58)
  268. #1 std::shared_ptr<Mes>::shared_ptr(std::weak_ptr<Mes> const&, std::nothrow_t) <null> (a.out+0x5e08)
  269. #2 std::weak_ptr<Mes>::lock() const <null> (a.out+0x4d46)
  270. #3 Test::check() <null> (a.out+0x2668)
  271. #4 check_th() <null> (a.out+0x27d7)
  272. #5 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  273. #6 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  274. #7 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  275. #8 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  276. #9 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  277. #10 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  278.  
  279. Previous write of size 8 at 0x7b5000000000 by thread T1 (mutexes: write M10):
  280. #0 std::__weak_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__weak_ptr(std::__weak_ptr<Mes, (__gnu_cxx::_Lock_policy)2>&&) <null> (a.out+0x8409)
  281. #1 std::weak_ptr<Mes>::weak_ptr(std::weak_ptr<Mes>&&) <null> (a.out+0x769c)
  282. #2 decltype (::new ((void*)(0)) std::weak_ptr<Mes>((declval<std::weak_ptr<Mes> >)())) std::construct_at<std::weak_ptr<Mes>, std::weak_ptr<Mes> >(std::weak_ptr<Mes>*, std::weak_ptr<Mes>&&) <null> (a.out+0x76f1)
  283. #3 void std::allocator_traits<std::allocator<std::weak_ptr<Mes> > >::construct<std::weak_ptr<Mes>, std::weak_ptr<Mes> >(std::allocator<std::weak_ptr<Mes> >&, std::weak_ptr<Mes>*, std::weak_ptr<Mes>&&) <null> (a.out+0x7740)
  284. #4 std::weak_ptr<Mes>& std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::emplace_back<std::weak_ptr<Mes> >(std::weak_ptr<Mes>&&) <null> (a.out+0x6916)
  285. #5 std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::push_back(std::weak_ptr<Mes>&&) <null> (a.out+0x5a3e)
  286. #6 std::queue<std::weak_ptr<Mes>, std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > > >::push(std::weak_ptr<Mes>&&) <null> (a.out+0x4b77)
  287. #7 Test::read() <null> (a.out+0x24fa)
  288. #8 read_th() <null> (a.out+0x277a)
  289. #9 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  290. #10 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  291. #11 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  292. #12 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  293. #13 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  294. #14 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  295.  
  296. Location is heap block of size 512 at 0x7b5000000000 allocated by main thread:
  297. #0 operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/tsan/tsan_new_delete.cpp:64 (libtsan.so.0+0x91824)
  298. #1 __gnu_cxx::new_allocator<std::weak_ptr<Mes> >::allocate(unsigned long, void const*) <null> (a.out+0x9a4a)
  299. #2 std::allocator_traits<std::allocator<std::weak_ptr<Mes> > >::allocate(std::allocator<std::weak_ptr<Mes> >&, unsigned long) <null> (a.out+0x8884)
  300. #3 std::_Deque_base<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::_M_allocate_node() <null> (a.out+0x80f8)
  301. #4 std::_Deque_base<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::_M_create_nodes(std::weak_ptr<Mes>**, std::weak_ptr<Mes>**) <null> (a.out+0x7272)
  302. #5 std::_Deque_base<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::_M_initialize_map(unsigned long) <null> (a.out+0x6281)
  303. #6 std::_Deque_base<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::_Deque_base() <null> (a.out+0x545f)
  304. #7 std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >::deque() <null> (a.out+0x47ca)
  305. #8 std::queue<std::weak_ptr<Mes>, std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > > >::queue<std::deque<std::weak_ptr<Mes>, std::allocator<std::weak_ptr<Mes> > >, void>() <null> (a.out+0x4874)
  306. #9 Test::Test() <null> (a.out+0x3eec)
  307. #10 __static_initialization_and_destruction_0(int, int) <null> (a.out+0x2a52)
  308. #11 _GLOBAL__sub_I_t <null> (a.out+0x2ab4)
  309. #12 __libc_csu_init <null> (a.out+0xa6fc)
  310.  
  311. Mutex M10 (0x5566b5a9d1c0) created at:
  312. #0 pthread_mutex_lock /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4250 (libtsan.so.0+0x54b6a)
  313. #1 __gthread_mutex_lock(pthread_mutex_t*) <null> (a.out+0x2df5)
  314. #2 std::mutex::lock() <null> (a.out+0x2e7a)
  315. #3 std::unique_lock<std::mutex>::lock() <null> (a.out+0x5715)
  316. #4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) <null> (a.out+0x4998)
  317. #5 Test::read() <null> (a.out+0x24c4)
  318. #6 read_th() <null> (a.out+0x277a)
  319. #7 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  320. #8 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  321. #9 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  322. #10 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  323. #11 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  324. #12 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  325.  
  326. Thread T2 (tid=72220, running) created by main thread at:
  327. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  328. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  329. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  330. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  331. #4 main <null> (a.out+0x2851)
  332.  
  333. Thread T1 (tid=72219, running) created by main thread at:
  334. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  335. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  336. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  337. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  338. #4 main <null> (a.out+0x283b)
  339.  
  340. SUMMARY: ThreadSanitizer: data race (/tmp/a.out+0x6d58) in std::__shared_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__weak_ptr<Mes, (__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t)
  341. ==================
  342. ==================
  343. WARNING: ThreadSanitizer: data race (pid=72217)
  344. Write of size 4 at 0x7b0800001030 by thread T2 (mutexes: write M10):
  345. #0 Test::check() <null> (a.out+0x2692)
  346. #1 check_th() <null> (a.out+0x27d7)
  347. #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  348. #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  349. #4 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  350. #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  351. #6 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  352. #7 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  353.  
  354. Previous write of size 8 at 0x7b0800001030 by thread T1 (mutexes: write M10):
  355. #0 operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/tsan/tsan_new_delete.cpp:64 (libtsan.so.0+0x91824)
  356. #1 __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) <null> (a.out+0x9cfd)
  357. #2 std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) <null> (a.out+0x94e6)
  358. #3 std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >&) <null> (a.out+0x8988)
  359. #4 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<Mes, std::allocator<Mes>>(Mes*&, std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x82c1)
  360. #5 std::__shared_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<Mes>>(std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x7564)
  361. #6 std::shared_ptr<Mes>::shared_ptr<std::allocator<Mes>>(std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x67e5)
  362. #7 std::shared_ptr<Mes> std::allocate_shared<Mes, std::allocator<Mes>>(std::allocator<Mes> const&) <null> (a.out+0x5862)
  363. #8 std::shared_ptr<Mes> std::make_shared<Mes>() <null> (a.out+0x4a60)
  364. #9 Test::read() <null> (a.out+0x24d0)
  365. #10 read_th() <null> (a.out+0x277a)
  366. #11 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  367. #12 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  368. #13 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  369. #14 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  370. #15 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  371. #16 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  372.  
  373. Location is heap block of size 24 at 0x7b0800001020 allocated by thread T1:
  374. #0 operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/tsan/tsan_new_delete.cpp:64 (libtsan.so.0+0x91824)
  375. #1 __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) <null> (a.out+0x9cfd)
  376. #2 std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) <null> (a.out+0x94e6)
  377. #3 std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<Mes, std::allocator<Mes>, (__gnu_cxx::_Lock_policy)2> >&) <null> (a.out+0x8988)
  378. #4 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<Mes, std::allocator<Mes>>(Mes*&, std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x82c1)
  379. #5 std::__shared_ptr<Mes, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<Mes>>(std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x7564)
  380. #6 std::shared_ptr<Mes>::shared_ptr<std::allocator<Mes>>(std::_Sp_alloc_shared_tag<std::allocator<Mes> >) <null> (a.out+0x67e5)
  381. #7 std::shared_ptr<Mes> std::allocate_shared<Mes, std::allocator<Mes>>(std::allocator<Mes> const&) <null> (a.out+0x5862)
  382. #8 std::shared_ptr<Mes> std::make_shared<Mes>() <null> (a.out+0x4a60)
  383. #9 Test::read() <null> (a.out+0x24d0)
  384. #10 read_th() <null> (a.out+0x277a)
  385. #11 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  386. #12 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  387. #13 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  388. #14 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  389. #15 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  390. #16 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  391.  
  392. Mutex M10 (0x5566b5a9d1c0) created at:
  393. #0 pthread_mutex_lock /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4250 (libtsan.so.0+0x54b6a)
  394. #1 __gthread_mutex_lock(pthread_mutex_t*) <null> (a.out+0x2df5)
  395. #2 std::mutex::lock() <null> (a.out+0x2e7a)
  396. #3 std::unique_lock<std::mutex>::lock() <null> (a.out+0x5715)
  397. #4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) <null> (a.out+0x4998)
  398. #5 Test::read() <null> (a.out+0x24c4)
  399. #6 read_th() <null> (a.out+0x277a)
  400. #7 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (a.out+0xa60e)
  401. #8 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (a.out+0xa565)
  402. #9 void std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (a.out+0xa4ca)
  403. #10 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (a.out+0xa45a)
  404. #11 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run() <null> (a.out+0xa3ac)
  405. #12 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)
  406.  
  407. Thread T2 (tid=72220, running) created by main thread at:
  408. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  409. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  410. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  411. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  412. #4 main <null> (a.out+0x2851)
  413.  
  414. Thread T1 (tid=72219, running) created by main thread at:
  415. #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
  416. #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663 (libstdc++.so.6+0xd36aa)
  417. #2 std::thread std::jthread::_S_create<void (&)()>(std::stop_source&, void (&)()) <null> (a.out+0x5f9e)
  418. #3 std::jthread::jthread<void (&)(), , void>(void (&)()) <null> (a.out+0x4e47)
  419. #4 main <null> (a.out+0x283b)
  420.  
  421. SUMMARY: ThreadSanitizer: data race (/tmp/a.out+0x2692) in Test::check()
  422. ==================
  423.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement