-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Read of asynchronous pipe without synchronization #95411
Copy link
Copy link
Closed
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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
In src/sys/windows/pipe.rs a pipe is opened for asynchronous access (aka "overlapped mode").
rust/library/std/src/sys/windows/pipe.rs
Lines 51 to 55 in 2d37f38
However the read method for pipes is:
rust/library/std/src/sys/windows/pipe.rs
Lines 184 to 186 in 2d37f38
Where
inneris aHandlewhose read method does not wait for the buffer to be filled:rust/library/std/src/sys/windows/handle.rs
Lines 76 to 100 in 2d37f38
As far as I know this pipe is only used for
process::ChildStd*so we (probably) get away with it in typical usage. Also theread2method below this does the right thing by synchronizing reads.Found while investigating #81357
@rustbot label +T-libs +O-windows