Skip to content

x/tools/gopls: crash in buildPackageHandle (nil packageHandle) #66414

@rahukarmore

Description

@rahukarmore

When I try to use ctrl + click in VS Code, it doesn't work. I suspect there's an error.

gopls version: v0.15.2/go1.20.2
gopls flags:
update flags: proxy
extension version: 0.41.2
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Tue, 19 Mar 2024 13:29:56 GMT
restart history:
Tue, 19 Mar 2024 13:29:44 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

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

goroutine 4057 [running]:
golang.org/x/tools/gopls/internal/cache.(*packageHandleBuilder).getOneTransitiveRefLocked(0xc003c7e100, {0xc004b398c0%3F, {0xc0006675e8%3F, 0x16%3F}})
	  check.go:1088  0x2df
golang.org/x/tools/gopls/internal/cache.(*packageHandleBuilder).getTransitiveRefs(0xc003c7e100, {0xc000c1bc80%3F, 0x4%3F})
	  check.go:1026  0x4ee
golang.org/x/tools/gopls/internal/cache.(*packageHandleBuilder).evaluatePackageHandle(0xc003c7e100, 0x66%3F, 0xc0046a6870)
	  check.go:1206  0x2e5
golang.org/x/tools/gopls/internal/cache.(*packageHandleBuilder).buildPackageHandle(0xc003c7e100, {0x124ce30%3F, 0xc0046a7180%3F}, 0xc0046a6870)
	  check.go:1138  0x4cf
golang.org/x/tools/gopls/internal/cache.(*Snapshot).getPackageHandles.func2.1()
	  check.go:932  0xed
golang.org/x/sync/errgroup.(*Group).Go.func1()
	  errgroup.go:78  0x64
created by golang.org/x/sync/errgroup.(*Group).Go
	  errgroup.go:75  0xa5
gopls stats -anon gopls stats -anon failed after 1191 ms. Please check if gopls is killed by OS.

OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.

NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

<OPTIONAL: ATTACH LOGS HERE>

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.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