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: fatal error: concurrent map iteration and map write #36006

Closed
ian-mi opened this issue Dec 5, 2019 · 5 comments
Closed

x/tools/gopls: fatal error: concurrent map iteration and map write #36006

ian-mi opened this issue Dec 5, 2019 · 5 comments
Labels
Milestone

Comments

@ian-mi
Copy link

@ian-mi ian-mi commented Dec 5, 2019

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

$ go version
go version go1.12.9 linux/amd64

Does this issue reproduce with the latest release?

Yes.

$ gopls version
golang.org/x/tools/gopls 0.2.0
    golang.org/x/tools/gopls@v0.2.1 h1:qXHEqJw4CqROYvoDXinY1ZOkyAFS+jcPOvLRK76dvwY=

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ian/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ian/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="x86_64-pc-linux-gnu-gcc"
CXX="x86_64-pc-linux-gnu-g++"
CGO_ENABLED="1"
GOMOD=""
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-build667548593=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Restarted gopls using M-x lsp-workspace-restart.

What did you expect to see?

A new gopls process would start without crashing.

What did you see instead?

stderr
Process gopls stderr finished
fatal error: concurrent map iteration and map write

goroutine 61 [running]:
runtime.throw(0xc6e2c8, 0x26)
/usr/lib/go/src/runtime/panic.go:617 +0x72 fp=0xc0000f7358 sp=0xc0000f7328 pc=0x42eec2
runtime.mapiternext(0xc0000f75c8)
/usr/lib/go/src/runtime/map.go:860 +0x597 fp=0xc0000f73e0 sp=0xc0000f7358 pc=0x410917
golang.org/x/tools/internal/lsp/cache.(*view).invalidateContent(0xc00039a000, 0xd8b260, 0xc001886200, 0x7fa7787c8108, 0xc0049843c0, 0x0, 0x3ff0000000000000, 0xc004905900)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/snapshot.go:351 +0x6f5 fp=0xc0000f7878 sp=0xc0000f73e0 pc=0xa88135
golang.org/x/tools/internal/lsp/cache.(*view).getFile.func1(0x3ff0000000000000, 0xc0018861f0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/view.go:370 +0xfb fp=0xc0000f7908 sp=0xc0000f7878 pc=0xa8f58b
golang.org/x/tools/internal/lsp/cache.(*WatchMap).Notify(0xc0002862a0, 0xb4f640, 0xc0000f79c8, 0x3ff0000000000000, 0xc8d3a8)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/watcher.go:63 +0x169 fp=0xc0000f79a0 sp=0xc0000f7908 pc=0xa8b959
golang.org/x/tools/internal/lsp/cache.(*session).openOverlay.func1(0xc0002aa000, 0xc005a8bab0, 0x65)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/session.go:312 +0x81 fp=0xc0000f79e8 sp=0xc0000f79a0 pc=0xa8ed71
golang.org/x/tools/internal/lsp/cache.(*session).openOverlay(0xc0002aa000, 0xd8ab20, 0xc001864ed0, 0xc005a8bab0, 0x65, 0x0, 0xc00189c000, 0xe2a, 0x1000)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/session.go:328 +0x239 fp=0xc0000f7a70 sp=0xc0000f79e8 pc=0xa84659
golang.org/x/tools/internal/lsp/cache.(*session).DidOpen(0xc0002aa000, 0xd8ab20, 0xc000289b30, 0xc005a8bab0, 0x65, 0x0, 0xc00189c000, 0xe2a, 0x1000, 0xb031e0, ...)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/session.go:243 +0x3c8 fp=0xc0000f7b10 sp=0xc0000f7a70 pc=0xa83cf8
golang.org/x/tools/internal/lsp.(*Server).didOpen(0xc00028e540, 0xd8ab20, 0xc000289b30, 0xc001866540, 0x0, 0xc005a850e0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/text_synchronization.go:29 +0x160 fp=0xc0000f7ba0 sp=0xc0000f7b10 pc=0xa6c520
golang.org/x/tools/internal/lsp.(*Server).DidOpen(0xc00028e540, 0xd8ab20, 0xc000289b30, 0xc001866540, 0xc001866540, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/server.go:135 +0x49 fp=0xc0000f7be0 sp=0xc0000f7ba0 pc=0xa69fc9
golang.org/x/tools/internal/lsp/protocol.serverHandler.Deliver(0xda3ca0, 0xc00028e540, 0xd8ab20, 0xc000289b30, 0xc000281440, 0xc000289b00, 0xc00029c3c0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsserver.go:111 +0x1b86 fp=0xc0000f7ee0 sp=0xc0000f7be0 pc=0x61afb6
golang.org/x/tools/internal/lsp/protocol.(*serverHandler).Deliver(0xc000282240, 0xd8ab20, 0xc000289b30, 0xc000281440, 0xd8ab00, 0xc000289b00)
:1 +0x6c fp=0xc0000f7f28 sp=0xc0000f7ee0 pc=0x62215c
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc00029e540, 0xc000281440, 0xc00028e5a0, 0xd8ab20, 0xc000289b30, 0x0, 0x0, 0xc000282860)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:370 +0x13a fp=0xc0000f7fa0 sp=0xc0000f7f28 pc=0x5fc88a
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc0000f7fa8 sp=0xc0000f7fa0 pc=0x45e111
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:354 +0x8e5

goroutine 1 [syscall]:
syscall.Syscall(0x0, 0x0, 0xc0002a8000, 0x1000, 0x42dc3f, 0x8, 0xc00009a080)
/usr/lib/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.read(0x0, 0xc0002a8000, 0x1000, 0x1000, 0x0, 0x8, 0x67)
/usr/lib/go/src/syscall/zsyscall_linux_amd64.go:732 +0x5a
syscall.Read(...)
/usr/lib/go/src/syscall/syscall_unix.go:172
internal/poll.(*FD).Read(0xc00009c060, 0xc0002a8000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/usr/lib/go/src/internal/poll/fd_unix.go:165 +0x131
os.(*File).read(...)
/usr/lib/go/src/os/file_unix.go:263
os.(*File).Read(0xc000010010, 0xc0002a8000, 0x1000, 0x1000, 0x12af540, 0xb68e80, 0xc0003900b0)
/usr/lib/go/src/os/file.go:108 +0x70
bufio.(*Reader).fill(0xc00028e4e0)
/usr/lib/go/src/bufio/bufio.go:100 +0x10f
bufio.(*Reader).ReadSlice(0xc00028e4e0, 0xc0002af50a, 0xc0002af5b0, 0x0, 0x0, 0xbe8fe0, 0xc000390090)
/usr/lib/go/src/bufio/bufio.go:356 +0x3d
bufio.(*Reader).ReadBytes(0xc00028e4e0, 0xa, 0x407100, 0x430cdc, 0xc0001f36f8, 0x45abc0, 0xc0002c2180)
/usr/lib/go/src/bufio/bufio.go:434 +0x70
bufio.(*Reader).ReadString(...)
/usr/lib/go/src/bufio/bufio.go:474
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Read(0xc000286260, 0xd8ab20, 0xc000288ab0, 0xc00030b3e8, 0xc000390090, 0x0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:97 +0x99
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run(0xc00028e5a0, 0xd8ab20, 0xc000288ab0, 0x2, 0xc000286280)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:316 +0xa5
golang.org/x/tools/internal/lsp.(*Server).Run(...)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/server.go:61
golang.org/x/tools/internal/lsp/cmd.(*Serve).Run(0xc000296130, 0xd8aaa0, 0xc0000380e8, 0xc0000321b0, 0x0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cmd/serve.go:100 +0x5c7
golang.org/x/tools/internal/tool.Run(0xd8aaa0, 0xc0000380e8, 0xd8dea0, 0xc000296130, 0xc0000321b0, 0x0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/tool/tool.go:147 +0x244
golang.org/x/tools/internal/lsp/cmd.(*Application).Run(0xc000296100, 0xd8aaa0, 0xc0000380e8, 0xc0000321b0, 0x0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cmd/cmd.go:126 +0x861
golang.org/x/tools/internal/tool.Run(0xd8aaa0, 0xc0000380e8, 0xd8de60, 0xc000296100, 0xc0000321b0, 0x0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/tool/tool.go:147 +0x244
golang.org/x/tools/internal/tool.Main(0xd8aaa0, 0xc0000380e8, 0xd8de60, 0xc000296100, 0xc0000321b0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/tool/tool.go:91 +0x12f
main.main()
/home/ian/go/pkg/mod/golang.org/x/tools/gopls@v0.2.1/main.go:22 +0xdc

goroutine 5 [chan receive]:
golang.org/x/tools/internal/telemetry/stats.init.0.func1()
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/telemetry/stats/worker.go:20 +0x5f
created by golang.org/x/tools/internal/telemetry/stats.init.0
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/telemetry/stats/worker.go:19 +0x35

goroutine 7 [syscall]:
os/signal.signal_recv(0x0)
/usr/lib/go/src/runtime/sigqueue.go:139 +0x9c
os/signal.loop()
/usr/lib/go/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
/usr/lib/go/src/os/signal/signal_unix.go:29 +0x41

goroutine 29 [runnable]:
reflect.Value.Addr(0xb27dc0, 0xc0018ecbc0, 0x198, 0xda1300, 0xb27dc0, 0x198)
/usr/lib/go/src/reflect/value.go:243 +0x9e
encoding/json.indirect(0xb27dc0, 0xc0018ecbc0, 0x198, 0xc001910200, 0x15, 0x15, 0x1, 0x0, 0xb27dc0, 0xc0018ecbb0, ...)
/usr/lib/go/src/encoding/json/decode.go:452 +0x69c
encoding/json.(*decodeState).literalStore(0xc000504448, 0xc00515d1c0, 0x12, 0x6c40, 0xb27dc0, 0xc0018ecbc0, 0x198, 0xc0004c8500, 0x48c582, 0x197)
/usr/lib/go/src/encoding/json/decode.go:853 +0x269
encoding/json.(*decodeState).value(0xc000504448, 0xb27dc0, 0xc0018ecbc0, 0x198, 0xb27dc0, 0xc0018ecbc0)
/usr/lib/go/src/encoding/json/decode.go:395 +0x1ef
encoding/json.(*decodeState).array(0xc000504448, 0xb1d6c0, 0xc0018fa3c0, 0x197, 0xc000504470, 0x5b)
/usr/lib/go/src/encoding/json/decode.go:560 +0x1a9
encoding/json.(*decodeState).value(0xc000504448, 0xb1d6c0, 0xc0018fa3c0, 0x197, 0xb1d6c0, 0xc0018fa3c0)
/usr/lib/go/src/encoding/json/decode.go:371 +0xff
encoding/json.(*decodeState).object(0xc000504448, 0xb01520, 0xc0018fa240, 0x16, 0xc000504470, 0x7b)
/usr/lib/go/src/encoding/json/decode.go:763 +0x18bc
encoding/json.(*decodeState).value(0xc000504448, 0xb01520, 0xc0018fa240, 0x16, 0xc00185b420, 0xa)
/usr/lib/go/src/encoding/json/decode.go:381 +0x6e
encoding/json.(*decodeState).unmarshal(0xc000504448, 0xb01520, 0xc0018fa240, 0x0, 0x12a3a01)
/usr/lib/go/src/encoding/json/decode.go:179 +0x209
encoding/json.(*Decoder).Decode(0xc000504420, 0xb01520, 0xc0018fa240, 0x0, 0xc00185b4e8)
/usr/lib/go/src/encoding/json/stream.go:73 +0x187
golang.org/x/tools/go/packages.golistDriver(0xc000392008, 0xc0002fe1e0, 0xc000178750, 0x1, 0x1, 0xb2f600, 0x75, 0x76)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/go/packages/golist.go:761 +0x1de
golang.org/x/tools/go/packages.goListDriver.func5(0xc000392008, 0xc000178750, 0x1, 0x1, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/go/packages/golist.go:138 +0x52
golang.org/x/tools/go/packages.runContainsQueries(0xc000392008, 0xc000032490, 0xc0004c9700, 0xc0000324b0, 0x1, 0x1, 0xc0002fe1e0, 0x1, 0x126b6a0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/go/packages/golist.go:289 +0x9b4
golang.org/x/tools/go/packages.goListDriver(0xc000392008, 0xc000032450, 0x1, 0x1, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/go/packages/golist.go:202 +0x1034
golang.org/x/tools/go/packages.defaultDriver(0xc000392008, 0xc000032450, 0x1, 0x1, 0xc0000de480, 0xc000348200, 0x57)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/go/packages/packages.go:225 +0x68
golang.org/x/tools/go/packages.Load(0xc000362100, 0xc000032450, 0x1, 0x1, 0x1, 0xc00029e0c0, 0x57, 0xd8ab20, 0xc0000beb10)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/go/packages/packages.go:210 +0x6f
golang.org/x/tools/internal/lsp/cache.(*snapshot).load(0xc00035c3c0, 0xd8ab20, 0xc0000beb10, 0xc0003f0120, 0x59, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/load.go:41 +0x2e0
golang.org/x/tools/internal/lsp/cache.(*snapshot).CheckPackageHandles(0xc00035c3c0, 0xd8ab20, 0xc0000be8a0, 0x7fa7787c8108, 0xc00042f140, 0xac50e10, 0x12ae260, 0xc000085aa0, 0x42dc3f, 0xbf727e9d00000000)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/gofile.go:42 +0x4e6
golang.org/x/tools/internal/lsp/cache.(*view).CheckPackageHandles(0xc00039a000, 0xd8ab20, 0xc0000be8a0, 0x7fa7787c8108, 0xc00042f140, 0x1, 0x1, 0xd8ab20, 0xc0000be8a0, 0xc0002fe0c0, ...)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/gofile.go:20 +0x76
golang.org/x/tools/internal/lsp/source.Diagnostics(0xd8ab20, 0xc0000be8a0, 0xd9c4c0, 0xc00039a000, 0x7fa7787c8108, 0xc00042f140, 0x0, 0x0, 0x0, 0x0, ...)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/source/diagnostics.go:46 +0x1d6
golang.org/x/tools/internal/lsp.(*Server).diagnostics(0xc00028e540, 0xd9c4c0, 0xc00039a000, 0xc0003f0120, 0x59, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/diagnostics.go:30 +0x2ce
created by golang.org/x/tools/internal/lsp.(*Server).didOpen
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/text_synchronization.go:34 +0x1ca

goroutine 261 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc000a215c0, 0xc0048c8d80, 0x83, 0x90, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8ab20, 0xc000a215c0, 0xc55db3, 0x11, 0xb03c60, 0xc0002fe2a0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:120 +0x36f
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc004ee18d0, 0xc0002fe2a0, 0x6bbf92, 0xc0004cd5f0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

goroutine 262 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc00c038360, 0xc0001c4680, 0x18e, 0x1a0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8ab20, 0xc00c038360, 0xc55db3, 0x11, 0xb03c60, 0xc0002fe320, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:120 +0x36f
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc004ee1930, 0xc0002fe320, 0x10, 0xc004ee18c0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

goroutine 247 [syscall]:
syscall.Syscall(0x1, 0x1, 0xc00baba000, 0x5409a4, 0x42dc3f, 0x80000000008, 0xc00034cc40)
/usr/lib/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.write(0x1, 0xc00baba000, 0x5409a4, 0x542000, 0x0, 0x0, 0x0)
/usr/lib/go/src/syscall/zsyscall_linux_amd64.go:1005 +0x5a
syscall.Write(...)
/usr/lib/go/src/syscall/syscall_unix.go:191
internal/poll.(*FD).Write(0xc00009c0c0, 0xc00baba000, 0x5409a4, 0x542000, 0x0, 0x0, 0x0)
/usr/lib/go/src/internal/poll/fd_unix.go:268 +0x179
os.(*File).write(...)
/usr/lib/go/src/os/file_unix.go:280
os.(*File).Write(0xc000010018, 0xc00baba000, 0x5409a4, 0x542000, 0xc00041ae50, 0x1, 0x1)
/usr/lib/go/src/os/file.go:145 +0x76
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc0007c83f0, 0xc00baba000, 0x5409a4, 0x542000, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:146 +0x1b0
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8ab20, 0xc0007c83f0, 0xc55db3, 0x11, 0xb03c60, 0xc000430000, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:120 +0x36f
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc00021e010, 0xc000430000, 0x0, 0x12ccfb0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

goroutine 59 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc000289890, 0xc0017f6000, 0xc9, 0xd0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Request).Reply(0xc000281240, 0xd8ab20, 0xc000289890, 0xb1a580, 0x12cc320, 0xd79cc0, 0xc0017d7500, 0xd79cc0, 0xc0017d7500)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:267 +0x277
golang.org/x/tools/internal/lsp/protocol.serverHandler.Deliver(0xda3ca0, 0xc00028e540, 0xd8ab20, 0xc000289890, 0xc000281240, 0xc000289800, 0xc00029c320)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsserver.go:388 +0x3bc4
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc00029e480, 0xc000281240, 0xc00028e5a0, 0xd8ab20, 0xc000289890, 0x0, 0x0, 0xc000282780)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:370 +0x13a
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:354 +0x8e5

goroutine 60 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc0002899e0, 0xc0016b0d00, 0x8b7, 0x900, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Request).Reply(0xc000281340, 0xd8ab20, 0xc0002899e0, 0xb1a540, 0xc0048a0e60, 0x0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:267 +0x277
golang.org/x/tools/internal/lsp/protocol.serverHandler.Deliver(0xda3ca0, 0xc00028e540, 0xd8ab20, 0xc0002899e0, 0xc000281340, 0xc000289900, 0xc00029c370)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsserver.go:443 +0x3989
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc00029e4e0, 0xc000281340, 0xc00028e5a0, 0xd8ab20, 0xc0002899e0, 0x0, 0x0, 0xc0002827f0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:370 +0x13a
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:354 +0x8e5

goroutine 62 [chan receive]:
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc00029e5a0, 0xc000281540, 0xc00028e5a0, 0xd8ab20, 0xc000289c80, 0x0, 0x0, 0xc0002828d0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:355 +0x38
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:354 +0x8e5

goroutine 63 [chan receive]:
golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc00029e600, 0xc000281640, 0xc00028e5a0, 0xd8ab20, 0xc000289dd0, 0x0, 0x0, 0xc000282940)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:355 +0x38
created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:354 +0x8e5

goroutine 185 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc0040f60f0, 0xc005a0f320, 0x83, 0x90, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8ab20, 0xc0040f60f0, 0xc55db3, 0x11, 0xb03c60, 0xc0006a1b80, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:120 +0x36f
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc00503f8b0, 0xc0006a1b80, 0x6bbf92, 0xc00067f5f0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

goroutine 137 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc001764de0, 0xc005a94fc0, 0x83, 0x90, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8ab20, 0xc001764de0, 0xc55db3, 0x11, 0xb03c60, 0xc0008b54e0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:120 +0x36f
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc000a32e40, 0xc0008b54e0, 0x6bbf92, 0xc0001eef48)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

goroutine 260 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc00c065380, 0xc0052e0000, 0x54f2d0, 0x550000, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8ab20, 0xc00c065380, 0xc55db3, 0x11, 0xb03c60, 0xc000430020, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:120 +0x36f
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc00021e040, 0xc000430020, 0x0, 0x12ccfb0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

goroutine 93 [semacquire]:
sync.runtime_SemacquireMutex(0xc00039a0f4, 0x1)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc00039a0f0)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/lsp/cache.(*view).GetFile(0xc00039a000, 0xd8ab20, 0xc00025e720, 0xc005c7b080, 0x2d, 0x0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/view.go:347 +0x50
golang.org/x/tools/internal/lsp/cache.(*snapshot).parseGoHandles(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc00c0a28c0, 0x1, 0xc000446680, 0xc0004e2780, 0x7, 0x8, 0xc0016bba70)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:212 +0x100
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc00062a326, 0x3, 0x1, 0x445612, 0xc0050e6ae0, 0xc001865170, 0x30)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:109 +0xab
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc00062a326, 0x3, 0x1, 0x2, 0x4, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc000260b90, 0x4c, 0x1, 0x414494, 0xc00067ebe0, 0x322c4da0, 0x897b5599fe67856a)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc000260b90, 0x4c, 0x1, 0xc001717590, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc000260e10, 0x43, 0x1, 0x414494, 0xc00067ee20, 0x8cff8027, 0x11bab3cfb358244e)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc000260e10, 0x43, 0x1, 0xc001801c70, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc0001636d0, 0x49, 0x1, 0x414494, 0xc00067f060, 0x6ba3c99e, 0xeb4348e8f7d1c796)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc0001636d0, 0x49, 0x1, 0xc0001f79f0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc0050ec280, 0x37, 0x1, 0x445612, 0xc00049ff20, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc0050ec280, 0x37, 0x1, 0x0, 0x1, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc00018bb40, 0x34, 0x1, 0x445612, 0xc0015d0570, 0xc00049fe00, 0x18)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc00018bb40, 0x34, 0x1, 0x1, 0x2, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc007f98980, 0x36, 0x1, 0x445612, 0xc001606ed0, 0xc0076e6e60, 0x18)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc007f98980, 0x36, 0x1, 0x1, 0x2, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc005dcfec0, 0x3b, 0x2, 0xd7aa80, 0xc0006a1b40, 0xb27dc0, 0xc000354220)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00025e720, 0xc005dcfec0, 0x3b, 0x2, 0x1, 0x1, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).CheckPackageHandles(0xc00035c3c0, 0xd8ab20, 0xc00025e6c0, 0x7fa7787c8108, 0xc00034c200, 0xae36830, 0x12ae260, 0xc00042daa0, 0x42dc3f, 0xbf727e9d00000000)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/gofile.go:55 +0x260
golang.org/x/tools/internal/lsp/cache.(*view).CheckPackageHandles(0xc00039a000, 0xd8ab20, 0xc00025e6c0, 0x7fa7787c8108, 0xc00034c200, 0x1, 0x1, 0xd8ab20, 0xc00025e6c0, 0xc0003e4f40, ...)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/gofile.go:20 +0x76
golang.org/x/tools/internal/lsp/source.Diagnostics(0xd8ab20, 0xc00025e6c0, 0xd9c4c0, 0xc00039a000, 0x7fa7787c8108, 0xc00034c200, 0x0, 0x0, 0x0, 0x0, ...)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/source/diagnostics.go:46 +0x1d6
golang.org/x/tools/internal/lsp.(*Server).diagnostics(0xc00028e540, 0xd9c4c0, 0xc00039a000, 0xc0003b2000, 0x5e, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/diagnostics.go:30 +0x2ce
created by golang.org/x/tools/internal/lsp.(*Server).didOpen
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/text_synchronization.go:34 +0x1ca

goroutine 163 [runnable]:
golang.org/x/tools/internal/span.isWindowsDriveURI(0xc005c88777, 0x5f, 0xc001924180)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/span/uri.go:147 +0xa9
golang.org/x/tools/internal/span.filename(0xc005c88770, 0x66, 0xc005c88770, 0x66, 0x12cc320, 0x600a6e)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/span/uri.go:44 +0x1bf
golang.org/x/tools/internal/span.URI.Filename(...)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/span/uri.go:26
golang.org/x/tools/internal/lsp/cache.(*view).findFile(0xc00039a000, 0xc005c88770, 0x66, 0xc0018e5860, 0xc001924100, 0xc0004cc630, 0x75a8ec)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/view.go:387 +0xc8
golang.org/x/tools/internal/lsp/cache.(*view).getFile(0xc00039a000, 0xd8ab20, 0xc00044a2d0, 0xc005c88770, 0x66, 0x0, 0x1, 0xc005c7ac60, 0x2f, 0xc0018eaa20)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/view.go:357 +0x49
golang.org/x/tools/internal/lsp/cache.(*view).GetFile(0xc00039a000, 0xd8ab20, 0xc00044a2d0, 0xc005c88770, 0x66, 0x0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/view.go:352 +0x105
golang.org/x/tools/internal/lsp/cache.(*snapshot).parseGoHandles(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc00c0a2320, 0x1, 0xc005926d18, 0xd0, 0x203003, 0x203003, 0xc001906330)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:212 +0x100
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc00062a1b0, 0xb, 0x1, 0x414494, 0xc0004cc9a0, 0x44c33a64, 0xfcdd906f789c3dda)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:109 +0xab
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc00062a1b0, 0xb, 0x1, 0xc00035c870, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc00062a326, 0x3, 0x1, 0x445612, 0xc004b3ec60, 0xc0018b4090, 0x30)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc00062a326, 0x3, 0x1, 0x2, 0x4, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc000260b90, 0x4c, 0x1, 0x414494, 0xc0004cce20, 0xe74e78de, 0xff32a54e0a497b88)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc000260b90, 0x4c, 0x1, 0xc001717590, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc000260e10, 0x43, 0x1, 0x414494, 0xc0004cd060, 0xf8ee8126, 0xa77002a7e29c2bae)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc000260e10, 0x43, 0x1, 0xc001716c30, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc0001636d0, 0x49, 0x1, 0x414494, 0xc0004cd2a0, 0x3ed84d2c, 0xd69b255b9f87c23a)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc0001636d0, 0x49, 0x1, 0xc0017980a0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc0050ec280, 0x37, 0x1, 0x445612, 0xc0008584c0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc0050ec280, 0x37, 0x1, 0x0, 0x1, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc00018bb40, 0x34, 0x1, 0x445612, 0xc004b3e660, 0xc001698a20, 0x30)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc00018bb40, 0x34, 0x1, 0x2, 0x4, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).buildKey(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc005153400, 0x3f, 0x2, 0xd7aa80, 0xc0002fe260, 0xb27dc0, 0xc0001784e0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:130 +0x32e
golang.org/x/tools/internal/lsp/cache.(*snapshot).checkPackageHandle(0xc00035c3c0, 0xd8ab20, 0xc00044a2d0, 0xc005153400, 0x3f, 0x2, 0x1, 0x1, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/check.go:66 +0xc7
golang.org/x/tools/internal/lsp/cache.(*snapshot).CheckPackageHandles(0xc00035c3c0, 0xd8ab20, 0xc00044a2a0, 0x7fa7787c8108, 0xc000418080, 0xb0dac40, 0x12ae260, 0xc000420aa0, 0x42dc3f, 0xbf727e9d00000000)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/gofile.go:55 +0x260
golang.org/x/tools/internal/lsp/cache.(*view).CheckPackageHandles(0xc00039a000, 0xd8ab20, 0xc00044a2a0, 0x7fa7787c8108, 0xc000418080, 0x1, 0x1, 0xd8ab20, 0xc00044a2a0, 0xc0004a08c0, ...)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/cache/gofile.go:20 +0x76
golang.org/x/tools/internal/lsp/source.Diagnostics(0xd8ab20, 0xc00044a2a0, 0xd9c4c0, 0xc00039a000, 0x7fa7787c8108, 0xc000418080, 0x0, 0x0, 0x0, 0x0, ...)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/source/diagnostics.go:46 +0x1d6
golang.org/x/tools/internal/lsp.(*Server).diagnostics(0xc00028e540, 0xd9c4c0, 0xc00039a000, 0xc00049c000, 0x68, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/diagnostics.go:30 +0x2ce
created by golang.org/x/tools/internal/lsp.(*Server).didOpen
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/text_synchronization.go:34 +0x1ca

goroutine 248 [runnable]:
encoding/json.stateInStringEsc(0xc0047ba040, 0xc0047ba022, 0x0)
/usr/lib/go/src/encoding/json/scanner.go:316 +0x258
encoding/json.compact(0xc00014a150, 0xc00b3a4000, 0x653f5d, 0x654000, 0x1, 0x0, 0x0)
/usr/lib/go/src/encoding/json/indent.go:39 +0x32e
encoding/json.marshalerEncoder(0xc00014a150, 0xb68e80, 0xc0047b4030, 0x196, 0x100)
/usr/lib/go/src/encoding/json/encode.go:457 +0x1d0
encoding/json.structEncoder.encode(0xc00030e900, 0x4, 0x4, 0xc00014a150, 0xbcfac0, 0xc0047b4020, 0x199, 0x5e0100)
/usr/lib/go/src/encoding/json/encode.go:660 +0x304
encoding/json.ptrEncoder.encode(0xc00032a440, 0xc00014a150, 0xb01b60, 0xc0047b4020, 0x16, 0xb00100)
/usr/lib/go/src/encoding/json/encode.go:806 +0xb2
encoding/json.(*encodeState).reflectValue(0xc00014a150, 0xb01b60, 0xc0047b4020, 0x16, 0x12a0100)
/usr/lib/go/src/encoding/json/encode.go:334 +0x82
encoding/json.(*encodeState).marshal(0xc00014a150, 0xb01b60, 0xc0047b4020, 0xb50100, 0x0, 0x0)
/usr/lib/go/src/encoding/json/encode.go:306 +0xee
encoding/json.Marshal(0xb01b60, 0xc0047b4020, 0xc0047b4000, 0x0, 0x0, 0xc0002c6eb8, 0x0)
/usr/lib/go/src/encoding/json/encode.go:160 +0x52
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8b260, 0xc0001784e0, 0xc55db3, 0x11, 0xb03c60, 0xc001a645a0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:108 +0x1d6
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc0001784e0, 0xc001a645a0, 0x0, 0x12ccfb0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

goroutine 186 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc00c0654a0, 0xc00017a1e0, 0x1d0, 0x1e0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8ab20, 0xc00c0654a0, 0xc55db3, 0x11, 0xb03c60, 0xc0006a1c00, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:120 +0x36f
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc00503f920, 0xc0006a1c00, 0x10, 0xc00503f8a0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

goroutine 136 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc00c038240, 0xc006de4000, 0x5409a4, 0x542000, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8ab20, 0xc00c038240, 0xc55db3, 0x11, 0xb03c60, 0xc0002fe040, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:120 +0x36f
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc00065e020, 0xc0002fe040, 0x0, 0x12ccfb0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

goroutine 138 [semacquire]:
sync.runtime_SemacquireMutex(0xc00028626c, 0x407d00)
/usr/lib/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc000286268)
/usr/lib/go/src/sync/mutex.go:134 +0x109
golang.org/x/tools/internal/jsonrpc2.(*headerStream).Write(0xc000286260, 0xd8ab20, 0xc001607fb0, 0xc0001c4820, 0x18e, 0x1a0, 0x0, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/stream.go:141 +0x86
golang.org/x/tools/internal/jsonrpc2.(*Conn).Notify(0xc00028e5a0, 0xd8ab20, 0xc001607fb0, 0xc55db3, 0x11, 0xb03c60, 0xc0008b5560, 0x0, 0x0)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/jsonrpc2/jsonrpc2.go:120 +0x36f
golang.org/x/tools/internal/lsp/protocol.(*clientDispatcher).LogMessage(0xc00028a070, 0xd8b260, 0xc000a32ea0, 0xc0008b5560, 0x10, 0xc000a32e30)
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/tsclient.go:157 +0x6d
created by golang.org/x/tools/internal/lsp/protocol.logExporter.Log
/home/ian/go/pkg/mod/golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe/internal/lsp/protocol/context.go:44 +0x1ec

Process gopls stderr finished

@gopherbot gopherbot added this to the Unreleased milestone Dec 5, 2019
@gopherbot gopherbot added the Tools label Dec 5, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 5, 2019

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added the gopls label Dec 5, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 6, 2019

Change https://golang.org/cl/210199 mentions this issue: internal/lsp: fix concurrent map write in file invalidation

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Dec 6, 2019

Thank you for the report! Just mailed a fix for this, and I'll cherry-pick it and make a release with it ASAP.

@ian-mi

This comment has been minimized.

Copy link
Author

@ian-mi ian-mi commented Dec 6, 2019

Awesome, ty!

gopherbot pushed a commit to golang/tools that referenced this issue Dec 6, 2019
The invalidateContent function does not acquire a snapshot's mutex to
avoid blocking other work (even though it probably should since it's
only called after a context is canceled). A case was added to iterate
through files when a file is created, and it did not respect the fact
that the snapshot's mutex was not locked, resulting in a concurrent map
read and write. This change makes sure that the access of the snapshot's
files map is guarded by a mutex.

As a follow-up, we should just acquire snapshot.mu in invalidateContent.

Updates golang/go#36006

Change-Id: Idd904ae582055ce786062df50875ac7f0896fd1c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/210199
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 6, 2019

Change https://golang.org/cl/210203 mentions this issue: internal/lsp: fix concurrent map write in file invalidation

gopherbot pushed a commit to golang/tools that referenced this issue Dec 6, 2019
The invalidateContent function does not acquire a snapshot's mutex to
avoid blocking other work (even though it probably should since it's
only called after a context is canceled). A case was added to iterate
through files when a file is created, and it did not respect the fact
that the snapshot's mutex was not locked, resulting in a concurrent map
read and write. This change makes sure that the access of the snapshot's
files map is guarded by a mutex.

As a follow-up, we should just acquire snapshot.mu in invalidateContent.

Updates golang/go#36006

Change-Id: Idd904ae582055ce786062df50875ac7f0896fd1c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/210199
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
(cherry picked from commit db903f3)
Reviewed-on: https://go-review.googlesource.com/c/tools/+/210203
@stamblerre stamblerre closed this Dec 10, 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.