Skip to content

os: io.Copy(net.Conn, os.Stdin) on MacOS terminate immediately without waiting for input [1.23 backport] #70789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gopherbot opened this issue Dec 11, 2024 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases
Milestone

Comments

@gopherbot
Copy link
Contributor

@ianlancetaylor requested issue #70763 to be considered for backport to the next 1.23 minor release.

@gopherbot Please open backport to 1.23

This is a simple program that broke with some sendfile work in the Go 1.23 release. Earlier releases are OK.

@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/635397 mentions this issue: [release-branch.go1.23] net: don't use sendfile for irregular files; handle EOPNOTSUPP/ENOTSUP

@dr2chase dr2chase added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Dec 18, 2024
gopherbot pushed a commit that referenced this issue Dec 18, 2024
…handle EOPNOTSUPP/ENOTSUP

This is not a cherry pick, because the code has changed on tip.

For #70763
Fixes #70789

Change-Id: If9fcfee17e86a746cf8c72293dc34f80b430f6e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/635397
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@gopherbot
Copy link
Contributor Author

Closed by merging CL 635397 (commit 1576793) to release-branch.go1.23.

yangjuncode pushed a commit to yangjuncode/go that referenced this issue Dec 27, 2024
…handle EOPNOTSUPP/ENOTSUP

This is not a cherry pick, because the code has changed on tip.

For golang#70763
Fixes golang#70789

Change-Id: If9fcfee17e86a746cf8c72293dc34f80b430f6e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/635397
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
mpminardi pushed a commit to tailscale/go that referenced this issue Jan 28, 2025
…handle EOPNOTSUPP/ENOTSUP

This is not a cherry pick, because the code has changed on tip.

For golang#70763
Fixes golang#70789

Change-Id: If9fcfee17e86a746cf8c72293dc34f80b430f6e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/635397
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@wjkoh
Copy link

wjkoh commented Mar 30, 2025

For the record, in Go 1.24, io.Copy(w, os.Stdin) returns immediately when run inside a unit test. See the following example code.

package main

import (
	"bytes"
	"io"
	"os"
	"testing"
)

func TestCopyStdin(t *testing.T) {
	var b bytes.Buffer
        // NOTE: The io.Copy call returns immediately.
	_, err := io.Copy(&b, os.Stdin)
	if err != nil {
		t.Fatal(err)
	}
	t.Log(b.String())
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases
Projects
None yet
Development

No branches or pull requests

3 participants