Skip to content

x/tools/gopls: panic in internal/golang.activeParameter #69552

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

Closed
danp opened this issue Sep 20, 2024 · 5 comments
Closed

x/tools/gopls: panic in internal/golang.activeParameter #69552

danp opened this issue Sep 20, 2024 · 5 comments
Assignees
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@danp
Copy link
Contributor

danp commented Sep 20, 2024

Using gopls golang/tools@e603756:

goroutine 11966428 gp=0x140197a5180 m=45 mp=0x1402512c008 [running]:
panic({0x101c5cf20?, 0x102415050?})
	/usr/local/go/src/runtime/panic.go:804 +0x154 fp=0x14026e293f0 sp=0x14026e29340 pc=0x100f97294
runtime.panicmem(...)
	/usr/local/go/src/runtime/panic.go:262
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:900 +0x300 fp=0x14026e29450 sp=0x14026e293f0 pc=0x100f99760
golang.org/x/tools/gopls/internal/golang.activeParameter(0x101d98488?, 0x1400d9ae540?, 0xa0?, 0x101880df1?)
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/golang/signature_help.go:192 +0x18 fp=0x14026e294b0 sp=0x14026e29460 pc=0x1017ec4b8
golang.org/x/tools/gopls/internal/golang.builtinSignature({0x101d98488?, 0x1400d9ae540?}, 0x1403f35e5a0, 0x0, {0x101880df1?, 0x0?}, 0x6c328350)
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/golang/signature_help.go:183 +0x158 fp=0x14026e29570 sp=0x14026e294b0 pc=0x1017ec358
golang.org/x/tools/gopls/internal/golang.SignatureHelp({0x101d98488?, 0x1400d9ae3f0?}, 0x1403f35e5a0, {0x101d9b1e0, 0x1401cfcc900}, {0x108f6b4?, 0x1?})
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/golang/signature_help.go:123 +0x98c fp=0x14026e297d0 sp=0x14026e29570 pc=0x1017ebcec
golang.org/x/tools/gopls/internal/server.(*server).SignatureHelp(0x1400018c780, {0x101d984c0, 0x1400d74abe0}, 0x1400d9ae300)
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/server/signature_help.go:31 +0x194 fp=0x14026e298f0 sp=0x14026e297d0 pc=0x101859674
golang.org/x/tools/gopls/internal/protocol.serverDispatch({0x101d984c0, 0x1400d74abe0}, {0x101db3920, 0x1400018c780}, 0x1400d9ae2d0, {0x101d98680, 0x14031016500})
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/protocol/tsserver.go:712 +0x3d5c fp=0x14026e29bd0 sp=0x14026e298f0 pc=0x1012c694c
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3({0x101d984c0, 0x1400d74abe0}, 0x1400d9ae2d0, {0x101d98680, 0x14031016500})
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/protocol/protocol.go:160 +0x74 fp=0x14026e29c30 sp=0x14026e29bd0 pc=0x101862384
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4({0x101d984c0, 0x1400d74abe0}, 0x1400d9ae2d0, {0x101d98680, 0x14031016500})
	/Users/dan/go/src/golang.org/x/tools/gopls/internal/lsprpc/lsprpc.go:509 +0x6b8 fp=0x14026e29ee0 sp=0x14026e29c30 pc=0x101862198
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1({0x101d984c0, 0x1400d74abe0}, 0x1404d3c5b60, {0x101d98680, 0x14031016500})
	/Users/dan/go/src/golang.org/x/tools/internal/jsonrpc2/handler.go:35 +0xc0 fp=0x14026e29f40 sp=0x14026e29ee0 pc=0x1012b49c0
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2()
	/Users/dan/go/src/golang.org/x/tools/internal/jsonrpc2/handler.go:103 +0x90 fp=0x14026e29fd0 sp=0x14026e29f40 pc=0x1012b47f0
runtime.goexit({})
	/usr/local/go/src/runtime/asm_arm64.s:1223 +0x4 fp=0x14026e29fd0 sp=0x14026e29fd0 pc=0x100fa0464
created by golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2 in goroutine 109
	/Users/dan/go/src/golang.org/x/tools/internal/jsonrpc2/handler.go:100 +0x19c

Think I was in the middle of changing something like x.y(len(z), nil) to x.y(int64(len(z)), nil).

(I don't see this in local telemetry data so filing this issue)

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Sep 20, 2024
@gopherbot gopherbot added this to the Unreleased milestone Sep 20, 2024
@adonovan
Copy link
Member

adonovan commented Sep 20, 2024

Thanks for the report. This looks like a recent regression caused by https://go.dev/cl/605983, which changed callExpr to become potentially nil.

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.17.0 Sep 24, 2024
@findleyr findleyr self-assigned this Sep 24, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/616216 mentions this issue: internal/golang: fix panic in signatureHelp over builtin name

@danp
Copy link
Contributor Author

danp commented Sep 27, 2024

Thanks for the fix!

Checking: is this something that telemetry should have caught and logged locally? I have similar stacks in my local data from the 2023-11-03 timeframe but not since then.

@findleyr
Copy link
Member

@danp yes this should have been caught by telemetry, though it wouldn't have been uploaded due to the development version.

I'll write a test to ensure we're capturing local crashes. There may be some nondeterminism (races at process exit) that we need to sort out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants