-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-windowsOperating system: WindowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Rust assumes stdio handles are opened for synchronous access (as will most other Windows processes). However, when passing ChildStdOut
, ChildStdIn
or ChildStdErr
to a new Command
the pipes passed in are asynchronous. For a full test case see src/test/ui-fulldeps/stdio-from.rs but here's a shorter example:
fn try_it(a: &mut Child, b: &mut Child) -> io::Result<()> {
let mut child = Command::new("application")
.stdin(a.stdout.take().unwrap())
.stdout(b.stdin.take().unwrap())
.spawn()?;
assert!(child.wait()?.success());
Ok(())
}
This is related to an older issue: #38811 (comment)
This can cause soundness issues described in #81357.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-windowsOperating system: WindowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.