Skip to content

Conversation

@dcantah
Copy link
Contributor

@dcantah dcantah commented Jan 16, 2026

Fixes #477

Because we start piping stdin before process launch we can fill up the guest pipe buffer before the process even starts. We'd need some backpressure mechanism to handle this and slow consumers (register the other end with epoll and buffer some data etc.), but we should probably just start piping after the process is up and running. This change does exactly that, as well as stops holding the process mutex while draining stdin in the guest for CloseStdin().

This fixes issues where we try and write > pipe_buf bytes through stdin. Today this hangs.

Because we start piping stdin before process launch we can
fill up the guest pipe buffer before the process even starts.
We'd need some backpressure mechanism to handle this (register
the other end with epoll and buffer some data etc.), but we
should probably just start piping after the process is up and
running. This change does exactly that, as well as stops
holding the process mutex while draining stdin in the guest
for `CloseStdin()`.

This fixes issues where we try and write > pipe_buf bytes through
stdin. Today this hangs.
@dcantah dcantah merged commit 26f3dcc into apple:main Jan 16, 2026
2 checks passed
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.

[Bug]: Stdin pipe deadlocks when input exceeds 65536 bytes (OS Pipe Buffer Limit?)

2 participants