Skip to content

x/tools/internal/jsonrpc2_v2: test failures with "goroutine leak detected" #46047

Closed
@dmitshur

Description

@dmitshur
#!watchflakes
post <- pkg == "golang.org/x/tools/internal/jsonrpc2_v2" && `goroutine leak detected`

Observed the following test failure on a openbsd-amd64-68 TryBot in https://go-review.googlesource.com/c/tools/+/313097/7#message-05b2ee7a7f430f763806057296bde561b9777f07:

--- FAIL: TestIdleTimeout (2.10s)
    serve_test.go:38: dial tcp 127.0.0.1:1954: connect: connection reset by peer
    stacktest.go:48: goroutine leak detected:
        [IO wait]: $101
        /tmp/workdir/go/src/runtime/netpoll.go:229:                                   runtime_pollWait
        /tmp/workdir/go/src/internal/poll/fd_poll_runtime.go:84:                      (*pollDesc).wait
        /tmp/workdir/go/src/internal/poll/fd_poll_runtime.go:89:                      (*pollDesc).waitRead
        /tmp/workdir/go/src/internal/poll/fd_unix.go:167:                             (*FD).Read
        /tmp/workdir/go/src/net/fd_posix.go:56:                                       (*netFD).Read
        /tmp/workdir/go/src/net/net.go:183:                                           (*conn).Read
        /tmp/workdir/go/src/bufio/bufio.go:101:                                       (*Reader).fill
        /tmp/workdir/go/src/bufio/bufio.go:360:                                       (*Reader).ReadSlice
        /tmp/workdir/go/src/bufio/bufio.go:435:                                       (*Reader).collectFragments
        /tmp/workdir/go/src/bufio/bufio.go:483:                                       (*Reader).ReadString
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/frame.go:122: (*headerReader).Read
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/conn.go:294:  (*Connection).readIncoming
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/conn.go:112:  newConnection
        
        [IO wait]: $125
        /tmp/workdir/go/src/runtime/netpoll.go:229:                                   runtime_pollWait
        /tmp/workdir/go/src/internal/poll/fd_poll_runtime.go:84:                      (*pollDesc).wait
        /tmp/workdir/go/src/internal/poll/fd_poll_runtime.go:89:                      (*pollDesc).waitRead
        /tmp/workdir/go/src/internal/poll/fd_unix.go:167:                             (*FD).Read
        /tmp/workdir/go/src/net/fd_posix.go:56:                                       (*netFD).Read
        /tmp/workdir/go/src/net/net.go:183:                                           (*conn).Read
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/serve.go:187: (*idleCloser).Read
        /tmp/workdir/go/src/bufio/bufio.go:101:                                       (*Reader).fill
        /tmp/workdir/go/src/bufio/bufio.go:360:                                       (*Reader).ReadSlice
        /tmp/workdir/go/src/bufio/bufio.go:435:                                       (*Reader).collectFragments
        /tmp/workdir/go/src/bufio/bufio.go:483:                                       (*Reader).ReadString
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/frame.go:122: (*headerReader).Read
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/conn.go:294:  (*Connection).readIncoming
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/conn.go:112:  newConnection
        
        [chan receive]: $102, $126
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/conn.go:363: (*Connection).manageQueue
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/conn.go:113: newConnection
        
        [chan receive]: $103, $127
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/conn.go:398: (*Connection).deliverMessages
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/conn.go:114: newConnection
        
        [chan receive]: $123
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/jsonrpc2.go:81: (*async).wait
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/conn.go:269:    (*Connection).Wait
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/serve.go:113:   (*Server).run
        /tmp/workdir/gopath/src/golang.org/x/tools/internal/jsonrpc2_v2/serve.go:70:    Serve
        
        7 goroutines, 5 unique
FAIL
FAIL	golang.org/x/tools/internal/jsonrpc2_v2	2.472s

https://storage.googleapis.com/go-build-log/af6123a8/openbsd-amd64-68_8cf10eb0.log

It did not recur after restarting TryBots a second time. I'm not finding many other instances of this on the build dashboard, so it looks like a rare failure. Reporting in case this is helpful.

CC @ianthehat.

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions