Docs: Non-crossplatform assertion in stdio example

Open Beginner friendly
#550 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp

Research direction

Start in the stdio.cpp example at the assertion after reading from the pipe, then compare the documented Windows ReadFile pipe behavior with the linked ASIO issue. Update the example so a normally closed pipe is handled correctly on Windows as well as other platforms, while retaining failure detection; verify the example builds and the assertion no longer fires for a completed process.

Written by the indexing model from the issue text.

Description

In the stdio.cpp example there is the following assertion: assert(!ec || (ec == asio::error::eof)); after reading from the pipe. On Windows it would fire because ec would be asio::error::broken_pipe. As far as I understand, if the process ended the writing part of the pipe has been closed so the error won't be eof. See MSDN and also an ASIO issue.

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.