Skip to content

x/tools/gopls: SIGSEGV during renaming #42170

@asdine

Description

@asdine

gopls version: v0.5.1
gopls flags:

Describe what you observed.

I was renaming a type used across the whole codebase, but I kept seeing "Connection got disposed" errors, until gopls crashed.
I'm on WSL 2 with Ubuntu 20.04 64bits

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

goroutine 15463 [running]:
golang.org/x/tools/internal/lsp/source.pathEnclosingInterval(0xc0002ccc00, 0x0, 0x0, 0x183ca, 0x183ca, 0x29eee67e60eac8ac, 0x9, 0x0, 0x0, 0x0, ...)
	  rename_check.go:850  0x5a
golang.org/x/tools/internal/lsp/source.(*renamer).checkStructField(0xc00b38b360, 0xc00b1bcd70)
	  rename_check.go:393  0xaf
golang.org/x/tools/internal/lsp/source.(*renamer).check(0xc00b38b360, 0xefb480, 0xc00b1bcd70)
	  rename_check.go:44  0x37a
golang.org/x/tools/internal/lsp/source.Rename(0xeebc60, 0xc012f6c150, 0xefcb80, 0xc0092c2a80, 0xeebe60, 0xc008972180, 0x407b900000000000, 0x4008000000000000, 0xc009ce67d3, 0x9, ...)
	  rename.go:126  0x605
golang.org/x/tools/internal/lsp.(*Server).rename(0xc0001dc140, 0xeebba0, 0xc001bbe3c0, 0xc001ec8980, 0x0, 0x0, 0x0)
	  rename.go:20  0x186
golang.org/x/tools/internal/lsp.(*Server).Rename(0xc0001dc140, 0xeebba0, 0xc001bbe3c0, 0xc001ec8980, 0xc001ec8980, 0x0, 0x0)
	  server_gen.go:148  0x49
golang.org/x/tools/internal/lsp/protocol.serverDispatch(0xeebba0, 0xc001bbe3c0, 0xeff700, 0xc0001dc140, 0xc012f6c000, 0xeebde0, 0xc001bbe080, 0x0, 0xed9140, 0xc000816000)
	  tsserver.go:399  0x14e2
golang.org/x/tools/internal/lsp/protocol.ServerHandler.func1(0xeebba0, 0xc001bbe3c0, 0xc012f6c000, 0xeebde0, 0xc001bbe080, 0x223fbcd85, 0x1344da0)
	  protocol.go:63  0xc5
golang.org/x/tools/internal/lsp/lsprpc.handshaker.func1(0xeebba0, 0xc001bbe3c0, 0xc012f6c000, 0xeebde0, 0xc001bbe080, 0x0, 0x0)
	  lsprpc.go:557  0x452
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1(0xeebba0, 0xc001bbe3c0, 0xc008538d00, 0xeebde0, 0xc001bbe080, 0xb5ff0e, 0xc003c978c8)
	  handler.go:35  0xcf
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc0123cc240, 0xc012f4ac00, 0xc000382500, 0xeebba0, 0xc001bbe3c0, 0xc008538d00, 0xeebde0, 0xc001bbe080)
	  handler.go:103  0x86
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
	  handler.go:100  0x173
[Error - 8:26:59 PM] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions