]> git.feebdaed.xyz Git - 0xmirror/go.git/commit
os,internal/poll: don't call IsNonblock for consoles and Stdin
authorqmuntal <quimmuntal@gmail.com>
Wed, 26 Nov 2025 09:25:16 +0000 (10:25 +0100)
committerGopher Robot <gobot@golang.org>
Wed, 26 Nov 2025 18:18:02 +0000 (10:18 -0800)
commit437d2362ce8ad3e10631aaf90cb4d8c8126d1bac
treea914bd67a0bb1b2e96c704d2184b3589da16d1b8
parent71f8f031b27502e057c569fef8cd4f2cb9187504
os,internal/poll: don't call IsNonblock for consoles and Stdin

windows.IsNonblock can block for synchronous handles that have an
outstanding I/O operation. Console handles are always synchronous, so
we should not call IsNonblock for them. Stdin is often a pipe, and
almost always a synchronous handle, so we should not call IsNonblock for
it either. This avoids potential deadlocks during os package
initialization, which calls NewFile(syscall.Stdin).

Fixes #75949
Updates #76391

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race,gotip-windows-arm64
Change-Id: I1603932b0a99823019aa0cad960f94cee9996505
Reviewed-on: https://go-review.googlesource.com/c/go/+/724640
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/internal/poll/fd_windows.go
src/os/file_windows.go
src/os/os_windows_test.go
src/os/removeall_windows.go
src/os/root_windows.go