Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.process.Child: prevent racing children from inheriting one another's pipes #20075

Merged
merged 1 commit into from
May 26, 2024

Conversation

andrewrk
Copy link
Member

This is @mlugg's commit from #20059 rebased to work on master branch + #20049.

The added comment explains the issue here relatively well. The new
progress API made this bug obvious because it became visibly clear that
certain Compile steps were seemingly "hanging" until other steps
completed. As it turned out, these child processes had raced to spawn,
and hence one had inherited the other's stdio pipes, meaning the poll
call in std.Build.Step.evalZigProcess was not identifying the child
stdout as closed until an unrelated process terminated.

…r's pipes

The added comment explains the issue here relatively well. The new
progress API made this bug obvious because it became visibly clear that
certain Compile steps were seemingly "hanging" until other steps
completed. As it turned out, these child processes had raced to spawn,
and hence one had inherited the other's stdio pipes, meaning the `poll`
call in `std.Build.Step.evalZigProcess` was not identifying the child
stdout as closed until an unrelated process terminated.
@andrewrk andrewrk merged commit 389181f into master May 26, 2024
0 of 10 checks passed
@andrewrk andrewrk deleted the fix-fork-race branch May 26, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants