boostorg / boostorg/process

Posix pipe_out is missing uses_handles and get_used_handles

Open
#282 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
145
Forks
151
PR merge metrics
No merged PRs in 30d

Description

I'm using boost 1.80. I haven't checked if a later development version includes a fix already.

I noticed that file handles were leaking to exec children. This caused some parallel children's hand because leaked pipes stayed open after the source process had exited. When I was trying to figure out how to close the extra file descriptor I noticed limit_handles. limit_handles promises to prevent file descriptors from leaking. Too bad it seemed to break all pipes for children. I managed to figure out that the issue was hidden in the posix pipe_out implementation. All pipe_out file descriptors are being closed.

I tested locally that inheriting from uses_handles and implementing get_used_handles makes my code work.

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the POSIX pipe_out implementation and compare it with the uses_handles and get_used_handles behavior described in the issue. Reproduce the interaction with limit_handles and child pipes, then verify that pipe descriptors remain available to children without leaking unrelated file descriptors.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.