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

x/tools/gopls: unresponsive after CL 197117 #34519

Closed
myitcv opened this issue Sep 25, 2019 · 2 comments
Closed

x/tools/gopls: unresponsive after CL 197117 #34519

myitcv opened this issue Sep 25, 2019 · 2 comments

Comments

@myitcv
Copy link
Member

@myitcv myitcv commented Sep 25, 2019

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

$ go version
go version devel +1804bbab62 Tue Sep 24 18:20:52 2019 +0000 linux/amd64
$ go list -m golang.org/x/tools
golang.org/x/tools v0.0.0-20190925020647-22afafe3322a
$ go list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.1.8-0.20190925020647-22afafe3322a

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOENV="/home/myitcv/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/myitcv/gos"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/myitcv/gostuff/src/github.com/myitcv/govim/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build820930026=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Tried to run govim using gopls as usual, or run its tests.

What did you expect to see?

Something to happen!

What did you see instead?

Nothing happens. No log output, no messages received. Appears "stuck"

Go routine stack trace after kill -SIGABRT

SIGABRT: abort
PC=0x4781c9 m=0 sigcode=0

goroutine 1 [syscall]:
syscall.Syscall(0x0, 0x0, 0xc0002c8000, 0x1000, 0xf, 0x800000, 0x42f45a)
	/home/myitcv/gos/src/syscall/asm_linux_amd64.s:18 +0x5 fp=0xc000229318 sp=0xc000229310 pc=0x4781b5
syscall.read(0x0, 0xc0002c8000, 0x1000, 0x1000, 0x0, 0xc63343, 0x2)
	/home/myitcv/gos/src/syscall/zsyscall_linux_amd64.go:732 +0x5a fp=0xc000229370 sp=0xc000229318 pc=0x475d8a
syscall.Read(...)
	/home/myitcv/gos/src/syscall/syscall_unix.go:189
internal/poll.(*FD).Read(0xc0000b6000, 0xc0002c8000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/home/myitcv/gos/src/internal/poll/fd_unix.go:165 +0x164 fp=0xc000229400 sp=0xc000229370 pc=0x491e84
os.(*File).read(...)
	/home/myitcv/gos/src/os/file_unix.go:259
os.(*File).Read(0xc0000b4000, 0xc0002c8000, 0x1000, 0x1000, 0xc000229520, 0x407845, 0xc000080000)
	/home/myitcv/gos/src/os/file.go:116 +0x71 fp=0xc000229470 sp=0xc000229400 pc=0x499951
bufio.(*Reader).fill(0xc0002bcfc0)
	/home/myitcv/gos/src/bufio/bufio.go:100 +0x103 fp=0xc0002294c0 sp=0xc000229470 pc=0x5a6dd3
bufio.(*Reader).ReadSlice(0xc0002bcfc0, 0x20300a, 0x203000, 0x416fb8, 0x203000, 0x203000, 0x203000)
	/home/myitcv/gos/src/bufio/bufio.go:359 +0x3d fp=0xc000229508 sp=0xc0002294c0 pc=0x5a7aed
bufio.(*Reader).ReadBytes(0xc0002bcfc0, 0xa, 0x0, 0x203000, 0x203000, 0xc000229690, 0x40dc86)
	/home/myitcv/gos/src/bufio/bufio.go:437 +0x73 fp=0xc0002295c8 sp=0xc000229508 pc=0x5a7f83
bufio.(*Reader).ReadString(...)
	/home/myitcv/gos/src/bufio/bufio.go:477
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Read(0xc0000bf7a0, 0xd574a0, 0xc0002c55f0, 0x446dee, 0xc0000a3370, 0x0, 0xc0002296f8, 0xc0002296f8, 0x4073cf)
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/jsonrpc2/stream.go:97 +0x92 fp=0xc000229680 sp=0xc0002295c8 pc=0x6c2b12
golang.org/x/tools/internal/lsp/protocol.(*loggingStream).Read(0xc0000bf7c0, 0xd574a0, 0xc0002c55f0, 0x0, 0x1, 0xc0000a3370, 0x0, 0x1, 0x8)
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/lsp/protocol/log.go:26 +0x54 fp=0xc000229708 sp=0xc000229680 pc=0x6cdf74
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run(0xc0002bd080, 0xd574a0, 0xc0002c55f0, 0xc0002bef00, 0xd4be00)
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/jsonrpc2/jsonrpc2.go:316 +0xa5 fp=0xc000229860 sp=0xc000229708 pc=0x6c20e5
golang.org/x/tools/internal/lsp.(*Server).Run(...)
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/lsp/server.go:60
golang.org/x/tools/internal/lsp/cmd.(*Serve).Run(0xc0002bba30, 0xd57420, 0xc0000ae000, 0xc0000b8030, 0x0, 0x0, 0x0, 0x0)
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/lsp/cmd/serve.go:99 +0x485 fp=0xc0002299f8 sp=0xc000229860 pc=0xa7f0b5
golang.org/x/tools/internal/tool.Run(0xd57420, 0xc0000ae000, 0xd5a6e0, 0xc0002bba30, 0xc0000b8030, 0x0, 0x0, 0x0, 0x0)
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/tool/tool.go:147 +0x244 fp=0xc000229b60 sp=0xc0002299f8 pc=0xa72884
golang.org/x/tools/internal/lsp/cmd.(*Application).Run(0xc0002bba00, 0xd57420, 0xc0000ae000, 0xc0000b8030, 0x0, 0x0, 0x0, 0x0)
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/lsp/cmd/cmd.go:122 +0x5ee fp=0xc000229cf8 sp=0xc000229b60 pc=0xa75dfe
golang.org/x/tools/internal/tool.Run(0xd57420, 0xc0000ae000, 0xd5a6a0, 0xc0002bba00, 0xc0000b8010, 0x3, 0x3, 0x0, 0x0)
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/tool/tool.go:147 +0x244 fp=0xc000229e60 sp=0xc000229cf8 pc=0xa72884
golang.org/x/tools/internal/tool.Main(0xd57420, 0xc0000ae000, 0xd5a6a0, 0xc0002bba00, 0xc0000b8010, 0x3, 0x3)
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/tool/tool.go:91 +0x12f fp=0xc000229f08 sp=0xc000229e60 pc=0xa7247f
main.main()
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools/gopls@v0.1.8-0.20190925020647-22afafe3322a/main.go:23 +0xeb fp=0xc000229f60 sp=0xc000229f08 pc=0xa87ddb
runtime.main()
	/home/myitcv/gos/src/runtime/proc.go:203 +0x21e fp=0xc000229fe0 sp=0xc000229f60 pc=0x431ffe
runtime.goexit()
	/home/myitcv/gos/src/runtime/asm_amd64.s:1375 +0x1 fp=0xc000229fe8 sp=0xc000229fe0 pc=0x460051

goroutine 19 [chan receive]:
golang.org/x/tools/internal/telemetry/stats.init.0.func1()
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/telemetry/stats/worker.go:20 +0x5f
created by golang.org/x/tools/internal/telemetry/stats.init.0
	/home/myitcv/gostuff/pkg/mod/golang.org/x/tools@v0.0.0-20190925020647-22afafe3322a/internal/telemetry/stats/worker.go:19 +0x35

goroutine 35 [syscall]:
os/signal.signal_recv(0x0)
	/home/myitcv/gos/src/runtime/sigqueue.go:147 +0x9c
os/signal.loop()
	/home/myitcv/gos/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
	/home/myitcv/gos/src/os/signal/signal_unix.go:29 +0x41

rax    0x0
rbx    0xc00003a500
rcx    0x4781cb
rdx    0x1000
rdi    0x0
rsi    0xc0002c8000
rbp    0xc000229360
rsp    0xc000229310
r8     0x0
r9     0x2
r10    0xc0000985a0
r11    0x202
r12    0xffffffffffffffff
r13    0x10
r14    0xf
r15    0x55
rip    0x4781c9
rflags 0x202
cs     0x33
fs     0x0
gs     0x0

cc @stamblerre @ianthehat

@gopherbot gopherbot added this to the Unreleased milestone Sep 25, 2019
@gopherbot gopherbot added the Tools label Sep 25, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Sep 25, 2019

It looks like the commit hash you're using is actually for CL 197117. That was the CL that updated to the latest version of LSP. I know that you're vendoring our version of the LSP implementation for govim. It sounds likely that we have a bug that was revealed by the update (it should be backwards compatible). Does it work if you update the vendored copy?

@myitcv myitcv changed the title x/tools/gopls: unresponsive after CL 196984 x/tools/gopls: unresponsive after CL 197117 Sep 25, 2019
@myitcv

This comment has been minimized.

Copy link
Member Author

@myitcv myitcv commented Sep 25, 2019

Per our Slack exchange, the commit hash is right (just updated the title).

I've also tracked this down to be a govim issue... but it's strange because a nil pointer exception is apparently being "silently" swallowed. What's almost certainly the case though is that there's a bug :)

In any case, the nil pointer is coming about because the Hover field of TextDocumentClientCapabilities is now a pointer type. That's obviously easily fixed.

Sorry for the noise, and thanks for following up!

@myitcv myitcv closed this Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.