`.get()` hangs on unwrapped, deferred future.

Open
#358 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
backend

Research direction

Start by compiling and running the minimal reproducer with the stated Boost and GCC versions. Trace the interaction between set_deferred(), then(), unwrap(), and the final get() to determine why completion does not return. Done means the cause is identified and the behavior is covered by a suitable regression test.

Written by the indexing model from the issue text.

Description

Can someone tell my why the .get() call here does not return?

#define BOOST_THREAD_VERSION 5
#include <boost/thread/future.hpp>

int main()
{
	auto outer = boost::make_ready_future();
	outer.set_deferred();
	outer.then([](auto inner) {
		inner.get();
		return boost::make_ready_future();
	})
	.unwrap()
	.get();
}

(this is a minimal repro of this issue in a much larger codebase. i know you could return void from the lambda here and avoid calling unwrap()...)

gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
boost v1.71, v1.77

Dominant language
C++
Stars
213
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/thread

All issues in boostorg/thread

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.