mirror of
https://github.com/moby/buildkit.git
synced 2026-10-29 00:54:40 +08:00
The resize goroutine calls ptm.Resize (os.File.Fd) and only exits once runcProcess.Shutdown() cancels its context, which ran after the cleanup had already closed ptm. A resize racing with process exit could read a closed or reused fd, so TIOCSWINSZ could hit an unrelated descriptor. Stop and join the resize loop before the pty is closed. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>