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: panic in findWorkspaceDirectories during Initialized #40714

Closed
leitzler opened this issue Aug 12, 2020 · 2 comments
Closed

x/tools/gopls: panic in findWorkspaceDirectories during Initialized #40714

leitzler opened this issue Aug 12, 2020 · 2 comments
Labels
Milestone

Comments

@leitzler
Copy link
Contributor

@leitzler leitzler commented Aug 12, 2020

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

$ go version
(1.13.12)

golang.org/x/tools v0.0.0-20200811215021-48a8ffc5b207
golang.org/x/tools/gopls v0.0.0-20200811215021-48a8ffc5b207

What did you do?

After updating x/tools in govim from ace63f8701f5 to 48a8ffc5b207 we ran into a flake in the tests:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0xb4b2fa]

goroutine 83 [running]:
golang.org/x/tools/internal/lsp/cache.(*snapshot).findWorkspaceDirectories(0xc0003724d0, 0xf0a780, 0xc0002f5d10, 0xf0a940, 0xc00008a8a0, 0xf0a940)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/cache/snapshot.go:1118 +0xda
golang.org/x/tools/internal/lsp/cache.(*Session).createView(0xc0002deb60, 0xf0a780, 0xc0002f5d10, 0xc0000957d3, 0x28, 0xc0000959e0, 0x5b, 0x3ff0000000000000, 0x10101, 0xc0002f1ff0, ...)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/cache/session.go:213 +0x7b1
golang.org/x/tools/internal/lsp/cache.(*Session).NewView(0xc0002deb60, 0xf0a780, 0xc0002f5d10, 0xc0000957d3, 0x28, 0xc0000959e0, 0x5b, 0x3ff0000000000000, 0x10101, 0xc0002f1ff0, ...)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/cache/session.go:144 +0x155
golang.org/x/tools/internal/lsp.(*Server).addView(0xc0003060a0, 0xf0a780, 0xc0002f5d10, 0xc0000957d3, 0x28, 0xc0000959e0, 0x5b, 0xc0002e7700, 0xb, 0x10, ...)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/workspace.go:41 +0x20d
golang.org/x/tools/internal/lsp.(*Server).addFolders(0xc0003060a0, 0xf0a780, 0xc0002f5d10, 0xc00031db60, 0x1, 0x1, 0x0, 0x0)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/general.go:199 +0x25d
golang.org/x/tools/internal/lsp.(*Server).initialized(0xc0003060a0, 0xf0a780, 0xc0002f5d10, 0x149e5c0, 0x0, 0x0)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/general.go:167 +0x28e
golang.org/x/tools/internal/lsp.(*Server).Initialized(0xc0003060a0, 0xf0a780, 0xc0002f5d10, 0x149e5c0, 0x149e5c0, 0x0)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/server_gen.go:112 +0x49
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0xf0a780, 0xc0002f5d10, 0xf29420, 0xc0003060a0, 0xc000346840, 0x7f3a515791a8, 0xc0002f5cb0, 0x0, 0x0, 0xef6900)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/protocol/tsserver.go:92 +0x672
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0xf0a780, 0xc0002f5d10, 0xc000346840, 0x7f3a515791a8, 0xc0002f5cb0, 0xbfc505dc05971f39, 0x3730bbf)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/protocol/protocol.go:62 +0xc0
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0xf0a780, 0xc0002f5d10, 0xc000346840, 0x7f3a515791a8, 0xc0002f5cb0, 0x0, 0x0)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/lsp/lsprpc/lsprpc.go:521 +0x443
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0xf0a780, 0xc0002f5d10, 0xc0002d9860, 0x7f3a515791a8, 0xc0002f5cb0, 0x4073af, 0xc000094718)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/jsonrpc2/handler.go:35 +0xd3
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc0000371a0, 0xc00031e150, 0xc0002ea600, 0xf0a780, 0xc0002f5d10, 0xc0002d9860, 0x7f3a515791a8, 0xc0002f5cb0)
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/jsonrpc2/handler.go:103 +0x86
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
        /home/runner/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20200811215021-48a8ffc5b207/internal/jsonrpc2/handler.go:100 +0x171

Logs: https://gist.github.com/leitzler/6ae995c465dacf1098351e6ec7a7c84a

@gopherbot gopherbot added this to the Unreleased milestone Aug 12, 2020
@leitzler
Copy link
Contributor Author

@leitzler leitzler commented Aug 12, 2020

/cc @heschik

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Aug 12, 2020

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v.0.4.5 Aug 12, 2020
@stamblerre stamblerre closed this Aug 12, 2020
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.