Skip to content
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

net: testSpliceReaderAtEOF closed connection: got err = splice: invalid argument #27355

Closed
mikesmitty opened this issue Aug 30, 2018 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mikesmitty
Copy link

When running tests against the new splice code in the net package from 1.11 the syscall appears to be returning an error on CentOS 6.

What version of Go are you using (go version)?

go version go1.11 linux/amd64

Does this issue reproduce with the latest release?

Yes, it appears to have been introduced with 1.11

What operating system and processor architecture are you using (go env)?

The error appears to only occur on CentOS 6 with the standard 2.6.32 kernel. The test passed successfully in a CentOS 6 chroot under a CentOS 7 kernel however, so it seems like it may be related to the older kernel. Also passed on a variety of newer CentOS/Fedora distros without issue.

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mockbuild/go"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build794142517=/tmp/go-build"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

./run.bash --no-rebuild -v -v -v -k

What did you expect to see?

All tests pass successfully

What did you see instead?

--- FAIL: TestSplice (0.02s)
    --- FAIL: TestSplice/readerAtEOF (0.00s)
        splice_test.go:228: closed connection: got err = splice: invalid argument, handled = false, want handled = true
FAIL
FAIL	net	2.046s
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 30, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.11.1 milestone Aug 30, 2018
@ianlancetaylor
Copy link
Contributor

CC @acln0

@acln0
Copy link
Contributor

acln0 commented Aug 30, 2018

I'm a little confused. Does 92bdfab not handle this correctly by disabling splice on old kernels, or am I reading that commit incorrectly? I don't understand if 2.6.29 or 2.6.35 is the cut-off.

Perhaps @benburkert could clarify?

@joenall
Copy link

joenall commented Aug 30, 2018

I am seeing the same issue.

@acln0
Copy link
Contributor

acln0 commented Aug 30, 2018

I'm currently investigating on CentOS 6, and I can reproduce the issue.

When I run the readerAtEOF test cold, I get closed connection: got err = fcntl: invalid argument, handled = false, want handled = true. If I run other tests before it, I get closed connection: got err = splice: invalid argument, handled = false, want handled = true as originally reported.

I'll continue investigating.

@gopherbot
Copy link

Change https://golang.org/cl/132096 mentions this issue: net: refactor readerAtEOF splice test

@gopherbot
Copy link

Change https://golang.org/cl/132281 mentions this issue: [release-branch.go1.11] net: refactor readerAtEOF splice test

gopherbot pushed a commit that referenced this issue Aug 30, 2018
Refactor TestSplice/readerAtEOF to handle cases where we disable
splice on older kernels better.

If splice is disabled, net.splice and poll.Splice do not get to
observe EOF on the reader, because poll.Splice returns immediately
with EINVAL. The test fails unexpectedly, because the splice operation
is reported as not handled.

This change refactors the test to handle the aforementioned case
correctly, by not calling net.splice directly, but using a higher
level check.

Fixes #27355.

Change-Id: I0d5606b4775213f2dbbb84ef82ddfc3bab662a31
Reviewed-on: https://go-review.googlesource.com/132096
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit bd49b3d)
Reviewed-on: https://go-review.googlesource.com/132281
Reviewed-by: Andrew Bonventre <andybons@golang.org>
@golang golang locked and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants