Boost C++ Libraries: Ticket #11097: test_scheduled_tp - ThreadSanitizer: heap-use-after-free https://svn.boost.org/trac10/ticket/11097 <pre class="wiki"> Test output: BenPope x86_64 Ubuntu - thread - test_scheduled_tp_p / clang-linux-3.6~tsan~c14_libc++ Rev 7e43647340008d6bf42c4fd90980f57f9483de73 / Tue, 10 Mar 2015 11:15:03 +0000 Compile [2015-03-10 15:33:41 UTC]: succeed "clang++-3.6" -c -x c++ -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -std=c++1y -stdlib=libc++ -fsanitize=thread -O0 -fno-inline -Wall -pthread -fPIC -m64 -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED -DBOOST_THREAD_USE_DLL=1 -I".." -o "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/test_scheduled_tp_p.test/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/test_scheduled_tp.o" "../libs/thread/test/test_scheduled_tp.cpp" Link [2015-03-10 15:33:41 UTC]: succeed "clang++-3.6" -Wl,-R -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/chrono/build/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi" -Wl,-R -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/system/build/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi" -Wl,-R -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/build/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi" -Wl,-rpath-link -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/chrono/build/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi" -Wl,-rpath-link -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/system/build/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi" -Wl,-rpath-link -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/build/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi" -o "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/test_scheduled_tp_p.test/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/test_scheduled_tp_p" -Wl,--start-group "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/test_scheduled_tp_p.test/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/test_scheduled_tp.o" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/test_scheduled_tp_p.test/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/winrt_init.o" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/build/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/libboost_thread.so.1.58.0" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/chrono/build/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/libboost_chrono.so.1.58.0" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/system/build/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/libboost_system.so.1.58.0" -Wl,-Bstatic -Wl,-Bdynamic -lrt -Wl,--end-group -fsanitize=thread -lc++ -lc++abi -pthread -m64 RmTemps /home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/sync_tq_single_thread_p.test/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/sync_tq_single_thread_p rm -f "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/sync_tq_single_thread_p.test/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/sync/mutual_exclusion/sync_pq/tq_single_thread_pass.o" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/sync_tq_single_thread_p.test/clang-linux-3.6~tsan~c14_libc++/debug/address-model-64/architecture-x86/debug-symbols-off/threading-multi/winrt_init.o" Run [2015-03-10 15:33:41 UTC]: fail ================== WARNING: ThreadSanitizer: heap-use-after-free (pid=20383) Read of size 8 at 0x7d0c0000efe0 by thread T4 (mutexes: write M22): #0 memcpy /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:638:3 (test_scheduled_tp_p+0x00000046dc20) #1 boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;::time_since_epoch() const &lt;null&gt; (test_scheduled_tp_p+0x0000004fcbc6) #2 bool boost::chrono::operator&lt; &lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;(boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; const&amp;, boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; const&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004d53e5) #3 boost::cv_status boost::condition_variable::wait_until&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;(boost::unique_lock&lt;boost::mutex&gt;&amp;, boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; const&amp;) &lt;null&gt; (test_scheduled_tp_p+0x000000503c28) #4 boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::wait_until_not_empty_time_reached_or_closed(boost::unique_lock&lt;boost::mutex&gt;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x000000500ae3) #5 boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::wait_pull(boost::unique_lock&lt;boost::mutex&gt;&amp;, boost::detail::nullary_function&lt;void ()&gt;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000005007c0) #6 boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::wait_pull(boost::detail::nullary_function&lt;void ()&gt;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x00000050050c) #7 boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt;::loop() &lt;null&gt; (test_scheduled_tp_p+0x0000005002ad) #8 void boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::call&lt;boost::executors::scheduled_thread_pool*&gt;(boost::executors::scheduled_thread_pool*&amp;, void const*) const &lt;null&gt; (test_scheduled_tp_p+0x0000005063c9) #9 void boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::operator()&lt;boost::executors::scheduled_thread_pool*&gt;(boost::executors::scheduled_thread_pool*&amp;) const &lt;null&gt; (test_scheduled_tp_p+0x00000050627f) #10 void boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt;::operator()&lt;boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list0&gt;(boost::_bi::type&lt;void&gt;, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;&amp;, boost::_bi::list0&amp;, int) &lt;null&gt; (test_scheduled_tp_p+0x000000506159) #11 boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;::operator()() &lt;null&gt; (test_scheduled_tp_p+0x000000506084) #12 _ZN5boost6detail6invokeINS_3_bi6bind_tIvNS_4_mfi3mf0IvNS_9executors6detail22priority_executor_baseINS_10concurrent16sync_timed_queueINS0_16nullary_functionIFvvEEENS_6chrono12steady_clockEEEEEEENS2_5list1INS2_5valueIPNS6_21scheduled_thread_poolEEEEEEEJEEEDTclclsr5boostE7forwardIT_Efp_Espclsr5boostE7forwardIT0_Efp0_EEEOSQ_DpOSR_ &lt;null&gt; (test_scheduled_tp_p+0x000000506008) #13 void boost::detail::thread_data&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;&gt;::run2&lt;&gt;(boost::detail::tuple_indices&lt;&gt;) &lt;null&gt; (test_scheduled_tp_p+0x000000505faf) #14 boost::detail::thread_data&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;&gt;::run() &lt;null&gt; (test_scheduled_tp_p+0x000000505ee0) #15 boost::(anonymous namespace)::thread_proxy(void*) &lt;null&gt; (libboost_thread.so.1.58.0+0x0000000256e1) Previous write of size 8 at 0x7d0c0000efe0 by main thread (mutexes: write M22): #0 operator delete(void*) /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:603:3 (test_scheduled_tp_p+0x00000046d2bb) #1 std::__1::__split_buffer&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt;&amp;&gt;::~__split_buffer() &lt;null&gt; (test_scheduled_tp_p+0x0000004f6684) #2 void std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::__push_back_slow_path&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt;(boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;&amp;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f47ff) #3 boost::detail::priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::push(boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;&amp;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f1d11) #4 boost::concurrent::sync_priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::push(boost::lock_guard&lt;boost::mutex&gt;&amp;, boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;&amp;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f144f) #5 boost::concurrent::sync_priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::push(boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;&amp;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f0ff1) #6 void boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::push&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;(boost::detail::nullary_function&lt;void ()&gt;&amp;&amp;, boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; const&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f0dcf) #7 boost::executors::detail::scheduled_executor_base&lt;boost::chrono::steady_clock&gt;::submit_after(boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; const&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004d59bf) #8 test_timing(int) &lt;null&gt; (test_scheduled_tp_p+0x0000004d2be2) #9 main &lt;null&gt; (test_scheduled_tp_p+0x0000004d3757) Mutex M22 (0x7fff5066a048) created at: #0 pthread_mutex_init /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1082:3 (test_scheduled_tp_p+0x0000004715e0) #1 boost::mutex::mutex() &lt;null&gt; (test_scheduled_tp_p+0x0000004e5837) #2 boost::concurrent::detail::sync_queue_base&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, boost::detail::priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt; &gt;::sync_queue_base() &lt;null&gt; (test_scheduled_tp_p+0x000000506572) #3 boost::concurrent::sync_priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::sync_priority_queue() &lt;null&gt; (test_scheduled_tp_p+0x000000506513) #4 boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::sync_timed_queue() &lt;null&gt; (test_scheduled_tp_p+0x0000005064c3) #5 boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt;::priority_executor_base() &lt;null&gt; (test_scheduled_tp_p+0x000000506470) #6 boost::executors::detail::scheduled_executor_base&lt;boost::chrono::steady_clock&gt;::scheduled_executor_base() &lt;null&gt; (test_scheduled_tp_p+0x0000004ffc13) #7 boost::executors::scheduled_thread_pool::scheduled_thread_pool(unsigned long) &lt;null&gt; (test_scheduled_tp_p+0x0000004d5cf0) #8 test_timing(int) &lt;null&gt; (test_scheduled_tp_p+0x0000004d2934) #9 main &lt;null&gt; (test_scheduled_tp_p+0x0000004d3757) Thread T4 (tid=20394, running) created by main thread at: #0 pthread_create /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:896:3 (test_scheduled_tp_p+0x0000004701b1) #1 boost::thread::start_thread_noexcept() &lt;null&gt; (libboost_thread.so.1.58.0+0x0000000255b0) #2 boost::thread::start_thread() &lt;null&gt; (test_scheduled_tp_p+0x0000004dd8f3) #3 boost::thread::thread&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;&amp;&gt;(boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x000000504e6a) #4 boost::thread* boost::thread_group::create_thread&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt; &gt;(boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;) &lt;null&gt; (test_scheduled_tp_p+0x0000004ffcba) #5 boost::executors::scheduled_thread_pool::scheduled_thread_pool(unsigned long) &lt;null&gt; (test_scheduled_tp_p+0x0000004d5df0) #6 test_timing(int) &lt;null&gt; (test_scheduled_tp_p+0x0000004d2934) #7 main &lt;null&gt; (test_scheduled_tp_p+0x0000004d3757) SUMMARY: ThreadSanitizer: heap-use-after-free ??:0 boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;::time_since_epoch() const ================== 1 2 3 4 5 ================== WARNING: ThreadSanitizer: heap-use-after-free (pid=20383) Read of size 8 at 0x7d080000edd0 by thread T10 (mutexes: write M84): #0 memcpy /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:638:3 (test_scheduled_tp_p+0x00000046dc20) #1 boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;::time_since_epoch() const &lt;null&gt; (test_scheduled_tp_p+0x0000004fcbc6) #2 bool boost::chrono::operator&lt; &lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;(boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; const&amp;, boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; const&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004d53e5) #3 boost::cv_status boost::condition_variable::wait_until&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;(boost::unique_lock&lt;boost::mutex&gt;&amp;, boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; const&amp;) &lt;null&gt; (test_scheduled_tp_p+0x000000503c28) #4 boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::wait_until_not_empty_time_reached_or_closed(boost::unique_lock&lt;boost::mutex&gt;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x000000500ae3) #5 boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::wait_pull(boost::unique_lock&lt;boost::mutex&gt;&amp;, boost::detail::nullary_function&lt;void ()&gt;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000005007c0) #6 boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::wait_pull(boost::detail::nullary_function&lt;void ()&gt;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x00000050050c) #7 boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt;::loop() &lt;null&gt; (test_scheduled_tp_p+0x0000005002ad) #8 void boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::call&lt;boost::executors::scheduled_thread_pool*&gt;(boost::executors::scheduled_thread_pool*&amp;, void const*) const &lt;null&gt; (test_scheduled_tp_p+0x0000005063c9) #9 void boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::operator()&lt;boost::executors::scheduled_thread_pool*&gt;(boost::executors::scheduled_thread_pool*&amp;) const &lt;null&gt; (test_scheduled_tp_p+0x00000050627f) #10 void boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt;::operator()&lt;boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list0&gt;(boost::_bi::type&lt;void&gt;, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;&amp;, boost::_bi::list0&amp;, int) &lt;null&gt; (test_scheduled_tp_p+0x000000506159) #11 boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;::operator()() &lt;null&gt; (test_scheduled_tp_p+0x000000506084) #12 _ZN5boost6detail6invokeINS_3_bi6bind_tIvNS_4_mfi3mf0IvNS_9executors6detail22priority_executor_baseINS_10concurrent16sync_timed_queueINS0_16nullary_functionIFvvEEENS_6chrono12steady_clockEEEEEEENS2_5list1INS2_5valueIPNS6_21scheduled_thread_poolEEEEEEEJEEEDTclclsr5boostE7forwardIT_Efp_Espclsr5boostE7forwardIT0_Efp0_EEEOSQ_DpOSR_ &lt;null&gt; (test_scheduled_tp_p+0x000000506008) #13 void boost::detail::thread_data&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;&gt;::run2&lt;&gt;(boost::detail::tuple_indices&lt;&gt;) &lt;null&gt; (test_scheduled_tp_p+0x000000505faf) #14 boost::detail::thread_data&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;&gt;::run() &lt;null&gt; (test_scheduled_tp_p+0x000000505ee0) #15 boost::(anonymous namespace)::thread_proxy(void*) &lt;null&gt; (libboost_thread.so.1.58.0+0x0000000256e1) Previous write of size 8 at 0x7d080000edd0 by thread T15 (mutexes: write M84): #0 operator delete(void*) /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:603:3 (test_scheduled_tp_p+0x00000046d2bb) #1 std::__1::__split_buffer&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt;&amp;&gt;::~__split_buffer() &lt;null&gt; (test_scheduled_tp_p+0x0000004f6684) #2 void std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::__push_back_slow_path&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt;(boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;&amp;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f47ff) #3 boost::detail::priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::push(boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;&amp;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f1d11) #4 boost::concurrent::sync_priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::push(boost::lock_guard&lt;boost::mutex&gt;&amp;, boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;&amp;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f144f) #5 boost::concurrent::sync_priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::push(boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;&amp;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f0ff1) #6 void boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::push&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;(boost::detail::nullary_function&lt;void ()&gt;&amp;&amp;, boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; const&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004f0dcf) #7 boost::executors::detail::scheduled_executor_base&lt;boost::chrono::steady_clock&gt;::submit_after(boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; const&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004d59bf) #8 func2(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;) &lt;null&gt; (test_scheduled_tp_p+0x0000004d2807) #9 void boost::_bi::list2&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt;, boost::_bi::value&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; &gt;::operator()&lt;void (*)(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;), boost::_bi::list0&gt;(boost::_bi::type&lt;void&gt;, void (*&amp;)(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;), boost::_bi::list0&amp;, int) &lt;null&gt; (test_scheduled_tp_p+0x0000004e54f6) #10 boost::_bi::bind_t&lt;void, void (*)(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;), boost::_bi::list2&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt;, boost::_bi::value&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; &gt; &gt;::operator()() &lt;null&gt; (test_scheduled_tp_p+0x0000004e5354) #11 _ZN5boost6detail6invokeINS_3_bi6bind_tIvPFvPNS_9executors21scheduled_thread_poolENS_6chrono8durationIlNS_5ratioILl1ELl1000000000EEEEEENS2_5list2INS2_5valueIS6_EENSF_ISB_EEEEEEJEEEDTclclsr5boostE7forwardIT_Efp_Espclsr5boostE7forwardIT0_Efp0_EEEOSK_DpOSL_ &lt;null&gt; (test_scheduled_tp_p+0x0000004e52d8) #12 void boost::detail::thread_data&lt;boost::_bi::bind_t&lt;void, void (*)(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;), boost::_bi::list2&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt;, boost::_bi::value&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; &gt; &gt;&gt;::run2&lt;&gt;(boost::detail::tuple_indices&lt;&gt;) &lt;null&gt; (test_scheduled_tp_p+0x0000004e527f) #13 boost::detail::thread_data&lt;boost::_bi::bind_t&lt;void, void (*)(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;), boost::_bi::list2&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt;, boost::_bi::value&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; &gt; &gt;&gt;::run() &lt;null&gt; (test_scheduled_tp_p+0x0000004e1270) #14 boost::(anonymous namespace)::thread_proxy(void*) &lt;null&gt; (libboost_thread.so.1.58.0+0x0000000256e1) Mutex M84 (0x7fff5066a060) created at: #0 pthread_mutex_init /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1082:3 (test_scheduled_tp_p+0x0000004715e0) #1 boost::mutex::mutex() &lt;null&gt; (test_scheduled_tp_p+0x0000004e5837) #2 boost::concurrent::detail::sync_queue_base&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, boost::detail::priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt; &gt;::sync_queue_base() &lt;null&gt; (test_scheduled_tp_p+0x000000506572) #3 boost::concurrent::sync_priority_queue&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::vector&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;, std::__1::allocator&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, std::__1::less&lt;boost::concurrent::detail::scheduled_type&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;::sync_priority_queue() &lt;null&gt; (test_scheduled_tp_p+0x000000506513) #4 boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt;::sync_timed_queue() &lt;null&gt; (test_scheduled_tp_p+0x0000005064c3) #5 boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt;::priority_executor_base() &lt;null&gt; (test_scheduled_tp_p+0x000000506470) #6 boost::executors::detail::scheduled_executor_base&lt;boost::chrono::steady_clock&gt;::scheduled_executor_base() &lt;null&gt; (test_scheduled_tp_p+0x0000004ffc13) #7 boost::executors::scheduled_thread_pool::scheduled_thread_pool(unsigned long) &lt;null&gt; (test_scheduled_tp_p+0x0000004d5cf0) #8 test_deque_multi(int) &lt;null&gt; (test_scheduled_tp_p+0x0000004d3311) #9 main &lt;null&gt; (test_scheduled_tp_p+0x0000004d388a) Thread T10 (tid=20979, running) created by main thread at: #0 pthread_create /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:896:3 (test_scheduled_tp_p+0x0000004701b1) #1 boost::thread::start_thread_noexcept() &lt;null&gt; (libboost_thread.so.1.58.0+0x0000000255b0) #2 boost::thread::start_thread() &lt;null&gt; (test_scheduled_tp_p+0x0000004dd8f3) #3 boost::thread::thread&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;&amp;&gt;(boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x000000504e6a) #4 boost::thread* boost::thread_group::create_thread&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt; &gt;(boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, boost::executors::detail::priority_executor_base&lt;boost::concurrent::sync_timed_queue&lt;boost::detail::nullary_function&lt;void ()&gt;, boost::chrono::steady_clock&gt; &gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt; &gt; &gt;) &lt;null&gt; (test_scheduled_tp_p+0x0000004ffcba) #5 boost::executors::scheduled_thread_pool::scheduled_thread_pool(unsigned long) &lt;null&gt; (test_scheduled_tp_p+0x0000004d5df0) #6 test_deque_multi(int) &lt;null&gt; (test_scheduled_tp_p+0x0000004d3311) #7 main &lt;null&gt; (test_scheduled_tp_p+0x0000004d388a) Thread T15 (tid=20984, finished) created by main thread at: #0 pthread_create /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:896:3 (test_scheduled_tp_p+0x0000004701b1) #1 boost::thread::start_thread_noexcept() &lt;null&gt; (libboost_thread.so.1.58.0+0x0000000255b0) #2 boost::thread::start_thread() &lt;null&gt; (test_scheduled_tp_p+0x0000004dd8f3) #3 boost::thread::thread&lt;boost::_bi::bind_t&lt;void, void (*)(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;), boost::_bi::list2&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt;, boost::_bi::value&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; &gt; &gt;&amp;&gt;(boost::_bi::bind_t&lt;void, void (*)(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;), boost::_bi::list2&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt;, boost::_bi::value&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; &gt; &gt;&amp;) &lt;null&gt; (test_scheduled_tp_p+0x0000004d81fa) #4 boost::thread* boost::thread_group::create_thread&lt;boost::_bi::bind_t&lt;void, void (*)(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;), boost::_bi::list2&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt;, boost::_bi::value&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; &gt; &gt; &gt;(boost::_bi::bind_t&lt;void, void (*)(boost::executors::scheduled_thread_pool*, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt;), boost::_bi::list2&lt;boost::_bi::value&lt;boost::executors::scheduled_thread_pool*&gt;, boost::_bi::value&lt;boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt; &gt; &gt;) &lt;null&gt; (test_scheduled_tp_p+0x0000004d6a1a) #5 test_deque_multi(int) &lt;null&gt; (test_scheduled_tp_p+0x0000004d35a2) #6 main &lt;null&gt; (test_scheduled_tp_p+0x0000004d388a) SUMMARY: ThreadSanitizer: heap-use-after-free ??:0 boost::chrono::time_point&lt;boost::chrono::steady_clock, boost::chrono::duration&lt;long, boost::ratio&lt;1l, 1000000000l&gt; &gt; &gt;::time_since_epoch() const ================== No errors detected. ThreadSanitizer: reported 2 warnings EXIT STATUS: 66 </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11097 Trac 1.4.3 viboes Tue, 10 Mar 2015 18:42:47 GMT status, component changed; owner set https://svn.boost.org/trac10/ticket/11097#comment:1 https://svn.boost.org/trac10/ticket/11097#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">thread</span> </li> </ul> Ticket daira@… Fri, 12 Aug 2016 18:45:42 GMT <link>https://svn.boost.org/trac10/ticket/11097#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11097#comment:2</guid> <description> <p> <a class="ext-link" href="https://github.com/zcash/zcash/issues/1241"><span class="icon">​</span>https://github.com/zcash/zcash/issues/1241</a> </p> <p> Any response to this? Use-after-free is often an exploitable security bug, and boost is used in security-critical software such as Bitcoin. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 15 Aug 2016 17:27:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11097#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11097#comment:3</guid> <description> <p> Hi, </p> <p> sorry for the inconvenience. Any help on this will be much appreciated. </p> </description> <category>Ticket</category> </item> <item> <author>daira@…</author> <pubDate>Sun, 21 Aug 2016 12:57:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11097#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11097#comment:4</guid> <description> <p> Well, the problem is likely in <a class="ext-link" href="https://github.com/boostorg/thread/blob/develop/include/boost/thread/concurrent_queues/sync_timed_queue.hpp"><span class="icon">​</span>sync_timed_queue</a>, but I've no idea what its locking policy is. </p> </description> <category>Ticket</category> </item> <item> <author>daira@…</author> <pubDate>Sun, 21 Aug 2016 13:00:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11097#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11097#comment:5</guid> <description> <p> Sorry, was confusing this with a race condition; locking policy might not be relevant. In any case, I'm not familiar enough with the internals of boost to help. </p> </description> <category>Ticket</category> </item> <item> <author>daira@…</author> <pubDate>Sun, 21 Aug 2016 13:07:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11097#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11097#comment:6</guid> <description> <p> It seems as though the report in the description was not compiled with enough debug information to give line numbers. The report in the zcash bug does have line numbers; note that it is not necessarily exactly the same bug. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 31 Aug 2016 16:54:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11097#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11097#comment:7</guid> <description> <p> Why do you think the issue comes from sync_timed_queue? </p> </description> <category>Ticket</category> </item> <item> <author>patrik@…</author> <pubDate>Wed, 31 Aug 2016 18:20:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11097#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11097#comment:8</guid> <description> <p> We're experiencing this behavior too, in boost 1.61.0. </p> </description> <category>Ticket</category> </item> <item> <author>daira@…</author> <pubDate>Thu, 01 Sep 2016 21:46:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11097#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11097#comment:9</guid> <description> <p> viboes: I no longer remember at all why I thought that. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 03 Sep 2016 18:40:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11097#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11097#comment:10</guid> <description> <p> I believe that I've found where the problem is. The call to super::data_.top().time </p> <pre class="wiki"> super::not_empty_.wait_until(lk, super::data_.top().time); </pre><p> pass the time by reference while we need to copy it, as the storage can be re-arranged. </p> <pre class="wiki"> template &lt;class T, class Clock&gt; bool sync_timed_queue&lt;T, Clock&gt;::wait_until_not_empty_time_reached_or_closed(unique_lock&lt;mutex&gt;&amp; lk) { for (;;) { if (super::closed(lk)) return true; while (! super::empty(lk)) { if (! time_not_reached(lk)) return false; - super::not_empty_.wait_until(lk, super::data_.top().time); + time_point tp = super::data_.top().time; + super::not_empty_.wait_until(lk, tp); if (super::closed(lk)) return true; } if (super::closed(lk)) return true; super::not_empty_.wait(lk); } //return false; } </pre><p> See this commit </p> <p> <a class="ext-link" href="https://github.com/boostorg/thread/commit/c52a34c2cf1b2e9807a70065c03b0555895963df"><span class="icon">​</span>https://github.com/boostorg/thread/commit/c52a34c2cf1b2e9807a70065c03b0555895963df</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 03 Sep 2016 18:41:09 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/11097#comment:11 https://svn.boost.org/trac10/ticket/11097#comment:11 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.62.0</span> </li> </ul> Ticket viboes Tue, 06 Sep 2016 16:51:42 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11097#comment:12 https://svn.boost.org/trac10/ticket/11097#comment:12 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket