io_context.run() block indefinitely if child redirects it's output to pipe

Open
#468 1 comment 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

Research direction

Start with the linked FreeOrion Process.cpp lines 215-220 and the boost-process-v2-capture branch. Reproduce the hang after adding async_pipe and redirecting stdout and stderr, then inspect why io_context.run() does not return. Done means identifying and fixing the blocking behavior with redirected child output, with a regression test if the repository provides a suitable test location.

Written by the indexing model from the issue text.

Description

I have the code already using boost.process v1 to manage child processes:

https://github.com/freeorion/freeorion/blob/a72caab5816e7401247ed0ea2399efe47ad6702a/util/Process.cpp#L215-L220

If I add boost::process::async_pipe and redirects boost::process::std_out and boost::process::std_err here it freezes on io_context.run().

I've tried to use Boost.Process V2 but it doesn't help https://github.com/o01eg/freeorion/tree/boost-process-v2-capture

Dominant language
C++
Stars
145
Forks
151
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/process

All issues in boostorg/process

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.