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: TestZeroByteRead breaks Plan 9 build #15741

Closed
mikioh opened this issue May 19, 2016 · 4 comments
Closed

net: TestZeroByteRead breaks Plan 9 build #15741

mikioh opened this issue May 19, 2016 · 4 comments

Comments

@mikioh
Copy link
Contributor

mikioh commented May 19, 2016

See https://build.golang.org/log/17b76202a3b136ca6f462aa408094e95db6152f5

panic: test timed out after 3m0s

goroutine 129 [running]:
panic(0x1b43c0, 0x105ae6f0)
    /tmp/workdir/go/src/runtime/panic.go:500 +0x32f
testing.startAlarm.func1()
    /tmp/workdir/go/src/testing/testing.go:855 +0xf4
created by time.goFunc
    /tmp/workdir/go/src/time/sleep.go:129 +0x35

goroutine 1 [chan receive]:
testing.(*T).Run(0x105adc00, 0x1e1186, 0x10, 0x207738, 0x27601)
    /tmp/workdir/go/src/testing/testing.go:584 +0x2c3
testing.RunTests.func1(0x104ce380)
    /tmp/workdir/go/src/testing/testing.go:730 +0x97
testing.tRunner(0x104ce380, 0x104f7ecc)
    /tmp/workdir/go/src/testing/testing.go:547 +0x8b
testing.RunTests(0x2072f8, 0x2a2fe0, 0x93, 0x93, 0x1)
    /tmp/workdir/go/src/testing/testing.go:736 +0x331
testing.(*M).Run(0x104f7f7c, 0x304be000)
    /tmp/workdir/go/src/testing/testing.go:680 +0x78
net.TestMain(0x104f7f7c)
    /tmp/workdir/go/src/net/main_test.go:48 +0x25
main.main()
    net/_test/_testmain.go:388 +0xff

goroutine 126 [syscall]:
syscall.Syscall6(0x4, 0x2b4468, 0x0, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x3, 0x2, 0x3e9db, ...)
    /tmp/workdir/go/src/syscall/asm_plan9_386.s:57 +0x5
syscall.Pread(0x4, 0x0, 0x0, 0x0, 0xffffffff, 0xffffffff, 0x710a3, 0x0, 0x0)
    /tmp/workdir/go/src/syscall/zsyscall_plan9_386.go:228 +0x72
syscall.Read(0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /tmp/workdir/go/src/syscall/syscall_plan9.go:124 +0x54
os.(*File).read(0x105ae6d8, 0x0, 0x0, 0x0, 0x4da80, 0x0, 0x0)
    /tmp/workdir/go/src/os/file_plan9.go:247 +0x49
os.(*File).Read(0x105ae6d8, 0x0, 0x0, 0x0, 0x105ae690, 0x0, 0x0)
    /tmp/workdir/go/src/os/file.go:97 +0x6e
net.(*netFD).Read(0x105baa80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /tmp/workdir/go/src/net/fd_plan9.go:79 +0xf6
net.(*conn).Read(0x105ae6e8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /tmp/workdir/go/src/net/net.go:173 +0x88
net.TestZeroByteRead(0x105adc00)
    /tmp/workdir/go/src/net/net_test.go:402 +0x49d
testing.tRunner(0x105adc00, 0x207738)
    /tmp/workdir/go/src/testing/testing.go:547 +0x8b
created by testing.(*T).Run
    /tmp/workdir/go/src/testing/testing.go:583 +0x2a4

goroutine 25 [syscall]:
syscall.Syscall6(0x3, 0x104d9dec, 0x19, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x104d58d8, 0x2, 0x3ea76, ...)
    /tmp/workdir/go/src/syscall/asm_plan9_386.s:57 +0x5
syscall.Pwrite(0x3, 0x104d9dec, 0x19, 0x20, 0xffffffff, 0xffffffff, 0x19, 0x0, 0x0)
    /tmp/workdir/go/src/syscall/zsyscall_plan9_386.go:245 +0x72
syscall.Write(0x3, 0x104d9dec, 0x19, 0x20, 0x2, 0x0, 0x0)
    /tmp/workdir/go/src/syscall/syscall_plan9.go:128 +0x54
os.(*File).write(0x104de6e0, 0x104d9dec, 0x19, 0x20, 0x104d9e58, 0x0, 0x0)
    /tmp/workdir/go/src/os/file_plan9.go:265 +0x64
os.(*File).Write(0x104de6e0, 0x104d9dec, 0x19, 0x20, 0x19, 0x0, 0x0)
    /tmp/workdir/go/src/os/file.go:138 +0x6e
os.(*File).WriteString(0x104de6e0, 0x104d9e58, 0x19, 0x104d1a2f, 0x0, 0x0)
    /tmp/workdir/go/src/os/file.go:199 +0x9a
net.dialPlan9Blocking(0x28e980, 0x104d19e0, 0x1de47b, 0x3, 0x28e440, 0x0, 0x28e440, 0x104d1a00, 0x0, 0x0, ...)
    /tmp/workdir/go/src/net/ipsock_plan9.go:200 +0x132
net.dialPlan9.func2(0x28e980, 0x104d19e0, 0x1de47b, 0x3, 0x28e440, 0x0, 0x28e440, 0x104d1a00, 0x104fb440)
    /tmp/workdir/go/src/net/ipsock_plan9.go:178 +0x85
created by net.dialPlan9
    /tmp/workdir/go/src/net/ipsock_plan9.go:186 +0x113
FAIL    net 180.052s
@mikioh mikioh added this to the Go1.7 milestone May 19, 2016
@bradfitz
Copy link
Contributor

This isn't a Go 1.7 issue, since Plan 9 is not a First Class Port: https://github.com/golang/go/wiki/PortingPolicy#first-class-ports

/cc @0intro

@bradfitz
Copy link
Contributor

I will also look into fixing this. I didn't mean to assign it to @0intro. I meant to cc him.

@mikioh
Copy link
Contributor Author

mikioh commented May 19, 2016

Simply 5bcdd63 forgot to tweak fd_plan9.go.

diff --git a/src/net/fd_plan9.go b/src/net/fd_plan9.go
index a92f514..55e7a03 100644
--- a/src/net/fd_plan9.go
+++ b/src/net/fd_plan9.go
@@ -75,6 +75,9 @@ func (fd *netFD) Read(b []byte) (n int, err error) {
        if err := fd.readLock(); err != nil {
                return 0, err
        }
+       if len(b) == 0 {
+               return 0, nil
+       }
        defer fd.readUnlock()
        if len(p) == 0 {
                // If the caller wanted a zero byte read, return immediately

@bradfitz
Copy link
Contributor

@mikioh, that looks like you're missing the unlock then. Move it down after the defer unlock. But really, just send a CL.

@golang golang locked and limited conversation to collaborators May 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants