when_all() on a deferred future crashes
- Dominant language
- C++
- Stars
- 214
- Forks
- 171
- PR merge metrics
- No merged PRs in 30d
Description
Trying to run
```
int q = 0;
boost::promise x;
boost::future fx = x.get_future();
fx.then(boost::launch::deferred, [&q](boost::future&&) { q = 1; });
future>>&& _ = boost::when_all(std::move(fx)); // CRASH!
```
Yields a crash:
```
#0 0x00007ffff4ae1387 in raise () from /lib64/libc.so.6
#1 0x00007ffff4ae2a78 in abort () from /lib64/libc.so.6
#2 0x00007ffff4ada1a6 in __assert_fail_base () from /lib64/libc.so.6
#3 0x00007ffff4ada252 in __assert_fail () from /lib64/libc.so.6
#4 0x000000000307ceaa in boost::shared_ptr >::operator-> (this=0xec0eb60)
at boost/smart_ptr/shared_ptr.hpp:734
#5 0x0000000003094d85 in boost::future::run_if_is_deferred (
this=0xec0eb60)
at boost/thread/future.hpp:1785
#6 0x000000000308f5f7 in boost::detail::accumulate_run_if_is_deferred >, 1ul>::operator() (this=0x7fffffffd77f,
t=std::tuple containing)
at boost/thread/future.hpp:5685
#7 0x0000000003086eb1 in boost::detail::future_when_all_tuple_shared_state >, boost::future>::run_deferred() (
this=0xec0ea40)
at boost/thread/future.hpp:5726
#8 0x000000000307d24c in boost::detail::future_when_all_tuple_shared_state >, boost::future>::init() (this=0xec0ea40)
at boost/thread/future.hpp:5729
#9 0x0000000003073cfd in boost::when_all>(boost::future&&) (
f=)
at boost/thread/future.hpp:5856
```
Which is maybe related to #112 asking for when_all to be rewritten anyway.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.