-
Notifications
You must be signed in to change notification settings - Fork 18k
os: io.Copy(net.Conn, os.Stdin) on MacOS terminate immediately without waiting for input #70763
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
Comments
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
consider checking the error on the copy operation |
@seankhliao there is no error, io.Copy returns I ran the same code on a linux machine, and it worked as expected, so this only happens on MacOS. |
and how are you running this? |
@seankhliao I'm using |
I tried it on a Darwin system using Go tip and
|
CC @panjf2000 |
Marking as release blocker since we shouldn't get a sendfile error from an I haven't tested earlier Go releases. |
With Go 1.22 the program works as expected. With Go 1.23 the program exits immediately with no error, as reported by this bug report. |
In Go 1.23 the program fails because it uses In Go 1.24 it makes it into calling |
@gopherbot Please open backport to 1.23 This is a simple program that broke with some |
Backport issue(s) opened: #70789 (for 1.23). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
CC @neild |
Sorry, it's not |
Change https://go.dev/cl/635396 mentions this issue: |
Change https://go.dev/cl/635397 mentions this issue: |
Change https://go.dev/cl/635815 mentions this issue: |
Testing on the freebsd-386 gomote seems to show that sendfile returns a non-zero number of bytes written even when it returns EINVAL. This confuses the caller. Change the Go code to only return non-zero on success or EINTR or EAGAIN, which are the only cases where the man page says that sendfile updates the number of bytes. For #70763 Change-Id: Icc04e6286b5b29a2029237711d50fe4973234f0a Reviewed-on: https://go-review.googlesource.com/c/go/+/635815 Reviewed-by: Ian Lance Taylor <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]> Reviewed-by: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
…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]>
…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]>
…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]>
Go version
go version go1.23.3 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Running a server: https://go.dev/play/p/5I1sJlo64VB
And a client: https://go.dev/play/p/fOMykC2RbYs
What did you see happen?
The client exits immediately without waiting for the input
What did you expect to see?
The client wait for the input
The text was updated successfully, but these errors were encountered: