Re: [Boost-bugs] [Boost C++ Libraries] #11256: future<>::is_ready() == false in continuation function

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11256: future<>::is_ready() == false in continuation function
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-03 15:45:34


#11256: future<>::is_ready() == false in continuation function
-------------------------------------+-------------------------------------
  Reporter: Konrad Zemek | Owner: viboes
  <konrad.zemek@…> | Status: assigned
      Type: Bugs | Component: thread
 Milestone: To Be Determined | Severity: Problem
   Version: Boost 1.58.0 | Keywords: then continuation
Resolution: | is_ready
-------------------------------------+-------------------------------------

Comment (by Konrad Zemek <konrad.zemek@…>):

 I assumed it should be simply {{{wrapped.future_->mutex}}} and changed it
 as such to avoid compilation error. Using the modified code with the
 example I posted above results in a deadlock:

 {{{
 Thread 2 (Thread 0x7ffff699c700 (LWP 172)):
 #0 __lll_lock_wait () at
 ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
 #1 0x00007ffff6cad56a in _L_lock_913 () from /lib/x86_64-linux-
 gnu/libpthread.so.0
 #2 0x00007ffff6cad390 in __GI___pthread_mutex_lock (mutex=0x64a6b0) at
 ../nptl/pthread_mutex_lock.c:79
 #3 0x000000000040de34 in pthread_mutex_lock (m=0x64a6b0) at
 thread/include/boost/thread/pthread/mutex.hpp:62
 #4 boost::mutex::lock (this=0x64a6b0) at
 thread/include/boost/thread/pthread/mutex.hpp:116
 #5 0x0000000000414a01 in boost::unique_lock<boost::mutex>::lock
 (this=0x7ffff699bc60) at thread/include/boost/thread/lock_types.hpp:346
 #6 0x00000000004128ed in boost::unique_lock<boost::mutex>::unique_lock
 (this=0x7ffff699bc60, m_=...) at
 thread/include/boost/thread/lock_types.hpp:124
 #7 0x000000000042b983 in boost::detail::shared_state<boost::future<void>
>::mark_finished_with_result(boost::future<void>&&) (this=0x64a670,
 result_=<unknown type in /home/kzemek/plgrid/helpers/example, CU 0x0, DIE
 0x1b312>)
     at thread/include/boost/thread/future.hpp:551
 #8 0x000000000040c9c3 in
 boost::detail::future_executor_continuation_shared_state<boost::executors::basic_thread_pool,
 boost::future<void>, boost::future<void>,
 stepOne(boost::executors::basic_thread_pool&)::<lambda(auto:1)>
>::run(boost::shared_ptr<boost::detail::shared_state_base>) (that_=...) at
 thread/include/boost/thread/future.hpp:4303
 #9 0x000000000040c82a in
 boost::detail::run_it<boost::detail::future_executor_continuation_shared_state<boost::executors::basic_thread_pool,
 boost::future<void>, boost::future<void>,
 stepOne(boost::executors::basic_thread_pool&)::<lambda(auto:1)> >
>::operator()(void) (this=0x64a838) at
 thread/include/boost/thread/future.hpp:4274
 #10 0x000000000040c79c in
 boost::detail::nullary_function<void()>::impl_type<boost::detail::run_it<boost::detail::future_executor_continuation_shared_state<boost::executors::basic_thread_pool,
 boost::future<void>, boost::future<void>,
 stepOne(boost::executors::basic_thread_pool&)::<lambda(auto:1)> > >
>::call(void) (this=0x64a830) at
 thread/include/boost/thread/detail/nullary_function.hpp:52
 #11 0x000000000040ec67 in boost::detail::nullary_function<void
 ()>::operator()() (this=0x7ffff699bdd0) at
 thread/include/boost/thread/detail/nullary_function.hpp:125
 #12 0x00000000004119ed in
 boost::executors::basic_thread_pool::worker_thread (this=0x7fffffffe530)
 at thread/include/boost/thread/executors/basic_thread_pool.hpp:91
 #13 0x000000000042ada9 in boost::detail::invoke<void
 (boost::executors::basic_thread_pool::*)(),
 boost::executors::basic_thread_pool<>*>(void
 (boost::executors::basic_thread_pool::*&&)(),
 boost::executors::basic_thread_pool<>*&&,
 (boost::executors::basic_thread_pool<>*&&)...) (f=<unknown type in
 /home/kzemek/plgrid/helpers/example, CU 0x0, DIE 0x4cba2>, a0=<unknown
 type in /home/kzemek/plgrid/helpers/example, CU 0x0, DIE 0x4cba7>)
     at thread/include/boost/thread/detail/invoke.hpp:77
 #14 0x0000000000429815 in boost::detail::thread_data<void
 (boost::executors::basic_thread_pool::*)(),
 boost::executors::basic_thread_pool*>::run2<1ul> (this=0x64a0f0) at
 thread/include/boost/thread/detail/thread.hpp:75
 #15 0x00000000004278c6 in boost::detail::thread_data<void
 (boost::executors::basic_thread_pool::*)(),
 boost::executors::basic_thread_pool*>::run (this=0x64a0f0) at
 thread/include/boost/thread/detail/thread.hpp:81
 #16 0x00007ffff7bc7d8a in ?? () from /usr/lib/x86_64-linux-
 gnu/libboost_thread.so.1.58.0
 #17 0x00007ffff6cab0a5 in start_thread (arg=0x7ffff699c700) at
 pthread_create.c:309
 #18 0x00007ffff71c2cfd in clone () at
 ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

 Thread 1 (Thread 0x7ffff7fe6780 (LWP 168)):
 #0 __lll_lock_wait () at
 ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
 #1 0x00007ffff6cad56a in _L_lock_913 () from /lib/x86_64-linux-
 gnu/libpthread.so.0
 #2 0x00007ffff6cad390 in __GI___pthread_mutex_lock (mutex=0x64a6b0) at
 ../nptl/pthread_mutex_lock.c:79
 #3 0x000000000040de34 in pthread_mutex_lock (m=0x64a6b0) at
 thread/include/boost/thread/pthread/mutex.hpp:62
 #4 boost::mutex::lock (this=0x64a6b0) at
 thread/include/boost/thread/pthread/mutex.hpp:116
 #5 0x0000000000414a01 in boost::unique_lock<boost::mutex>::lock
 (this=0x7fffffffe2e0) at thread/include/boost/thread/lock_types.hpp:346
 #6 0x00000000004128ed in boost::unique_lock<boost::mutex>::unique_lock
 (this=0x7fffffffe2e0, m_=...) at
 thread/include/boost/thread/lock_types.hpp:124
 #7 0x000000000042993c in boost::future<boost::future<void> >::get
 (this=0x64a998) at thread/include/boost/thread/future.hpp:1868
 #8 0x0000000000427ac9 in
 boost::detail::future_unwrap_shared_state<boost::future<boost::future<void>
>, void>::set_continuation_ptr (this=0x64a890, continuation=..., lock=...)
 at thread/include/boost/thread/future.hpp:5068
 #9 0x000000000040ae5c in
 boost::detail::make_future_executor_continuation_shared_state<boost::executors::basic_thread_pool,
 boost::future<void>, void,
 stepTwo(boost::executors::basic_thread_pool&)::<lambda(auto:2)>
>(boost::executors::basic_thread_pool &, boost::unique_lock<boost::mutex>
 &, <unknown type in /home/kzemek/plgrid/helpers/example, CU 0x0, DIE
 0x3dc9c>, <unknown type in /home/kzemek/plgrid/helpers/example, CU 0x0,
 DIE 0x3dc76>) (ex=..., lock=...,
     f=<unknown type in /home/kzemek/plgrid/helpers/example, CU 0x0, DIE
 0x3dc9c>, c=<unknown type in /home/kzemek/plgrid/helpers/example, CU 0x0,
 DIE 0x3dc76>) at thread/include/boost/thread/future.hpp:4704
 #10 0x000000000040ab0c in
 boost::future<void>::then<boost::executors::basic_thread_pool,
 stepTwo(boost::executors::basic_thread_pool&)::<lambda(auto:2)>
>(boost::executors::basic_thread_pool &, <unknown type in
 /home/kzemek/plgrid/helpers/example, CU 0x0, DIE 0x379fd>)
 (this=0x7fffffffe4e0, ex=..., func=<unknown type in
 /home/kzemek/plgrid/helpers/example, CU 0x0, DIE 0x379fd>) at
 thread/include/boost/thread/future.hpp:4804
 #11 0x000000000040a8a2 in stepTwo (executor=...) at example.cpp:30
 #12 0x000000000040a931 in main () at example.cpp:36
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11256#comment:10>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC