id summary reporter owner description type status milestone component version severity resolution keywords cc 11220 future<>::wait_for() on continuation doesn't return after timeout. Konrad Zemek viboes "If the original future's value will never be set, the wait_for() on continuation will deadlock. I'm using Boost 1.58 with Thread patched to commit 0bed674233a3c94b7254037dc4903961b54eb141 . Example to reproduce: {{{#!c++ #define BOOST_THREAD_VERSION 4 #define BOOST_THREAD_PROVIDES_EXECUTORS #include #include #include #include #include void wait_for() { boost::promise promise; auto future = promise.get_future(); future.wait_for(boost::chrono::milliseconds(100)); } void wait_for_executor() { boost::promise promise; auto future = promise.get_future(); auto far_future = future.then(boost::launch::async, [](auto){}); far_future.wait_for(boost::chrono::milliseconds(100)); } int main() { // works wait_for(); // deadlocks wait_for_executor(); } }}} GDB backtrace: {{{ Thread 1 (Thread 0x7ffff7fe6780 (LWP 247)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185 #1 0x000000000040df1e in boost::condition_variable::wait (this=0x63f3e8, m=...) at /usr/include/boost/thread/pthread/condition_variable.hpp:73 #2 0x00000000004105a1 in boost::detail::shared_state_base::wait_internal (this=0x63f380, lk=..., rethrow=false) at /usr/include/boost/thread/future.hpp:305 #3 0x000000000041061a in boost::detail::shared_state_base::wait (this=0x63f380, lock=..., rethrow=false) at /usr/include/boost/thread/future.hpp:315 #4 0x0000000000422c1f in boost::detail::future_async_shared_state_base::wait ( this=0x63f380, lk=..., rethrow=false) at /usr/include/boost/thread/future.hpp:771 #5 0x0000000000422bb6 in boost::detail::future_async_shared_state_base::block_if_needed (this=0x63f380, lk=...) at /usr/include/boost/thread/future.hpp:757 #6 0x000000000040fed6 in boost::detail::shared_state_base::dec (this=0x63f380, lk=...) at /usr/include/boost/thread/future.hpp:181 #7 0x000000000040ff1e in boost::detail::shared_state_base::dec (this=0x63f380) at /usr/include/boost/thread/future.hpp:184 #8 0x000000000041a2b6 in boost::detail::basic_future::~basic_future ( this=0x7fffffffeb80, __in_chrg=) at /usr/include/boost/thread/future.hpp:1188 #9 0x00000000004147ca in boost::future::~future (this=0x7fffffffeb80, __in_chrg=) at /usr/include/boost/thread/future.hpp:1541 #10 0x000000000040a920 in wait_for_executor () at wait_for_example.cpp:20 #11 0x000000000040a99f in main () at wait_for_example.cpp:29 }}}" Bugs closed To Be Determined thread Boost 1.58.0 Problem invalid wait_for future continuation