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

gopls: automated issue report (crash) #3014

Closed
lkonst2 opened this issue Oct 18, 2023 · 8 comments
Closed

gopls: automated issue report (crash) #3014

lkonst2 opened this issue Oct 18, 2023 · 8 comments
Labels
automatedReport Automatically created issues Duplicate Make it obvious when issues are closed as duplicate gopls gopls related issues
Milestone

Comments

@lkonst2
Copy link

lkonst2 commented Oct 18, 2023

gopls version: v0.13.2 (go1.21.0)
gopls flags:
update flags: proxy
extension version: 0.39.1
go version: 1.21.1
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Wed, 18 Oct 2023 13:51:08 GMT
restart history:
Wed, 18 Oct 2023 13:48:45 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=0x0 pc=0xbe722b]

goroutine 2191 [running]:
golang.org/x/tools/gopls/internal/lsp/cache.localPackageKey({{0xc000556d40, 0x32}, {0xc000556d80, 0x3c}, {0xc000502e30, 0xb}, {0xc00246b440, 0x1, 0x1}, {0xc00246b460, ...}, ...})
	  check.go:1402  0x6eb
golang.org/x/tools/gopls/internal/lsp/cache.(*packageHandleBuilder).buildPackageHandle(0xc0022ad860, {0x1161920, 0xc000b95ae0}, 0xc000b959a0)
	  check.go:1090  0x2be
golang.org/x/tools/gopls/internal/lsp/cache.(*snapshot).getPackageHandles.func2.1()
	  check.go:891  0xd7
golang.org/x/sync/errgroup.(*Group).Go.func1()
	  errgroup.go:75  0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 2131
	  errgroup.go:72  0x96
[Error - 4:50:36 PM] 

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>

@gopherbot gopherbot added this to the Untriaged milestone Oct 18, 2023
@hyangah
Copy link
Contributor

hyangah commented Oct 20, 2023

@lkonst2 Can you try to rebuild the gopls with go1.21.1 or a newer version of go, and see if the crash still happens?

Either you can use "Go: Install/Update Go Tools" vscode command, or use
GOTOOLCHAIN=go1.21.3 go install golang.org/x/tools/gopls@latest.

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 20, 2023
@hg-hg
Copy link

hg-hg commented Oct 23, 2023

Hi team, I've tried the gopls built with go1.21.3 with the repo I'm working on, and I'm still seeing the same issue. (i.e., SIGSEGV at golang.org/x/tools/gopls@v0.13.2/internal/lsp/cache/check.go:1402.)

@findleyr
Copy link
Contributor

@hg-hg can you please try the latest gopls prerelease, which contains a fix?

go install golang.org/x/tools/gopls@v0.14.0-pre.5

Let us know if that resolves the problem.

@findleyr
Copy link
Contributor

@hg-hg and @lkonst2, could you share if you are using a non-empty GOPACKAGESDRIVER in your environment?

@hg-hg
Copy link

hg-hg commented Oct 26, 2023

Yes, my local environment uses GOPACKAGESDRIVER from rules_go@v0.42.0 with bazel@6.4.0.

It seems to me that there was an issue about the GOPACKAGESDRIVER since rules_go@v0.40.0, and the issue should be fixed from Bazel side at bazel@6.4.0: bazelbuild/rules_go#3604 (comment). But with that issue has been fixed, this issue starts occurring.

@hyangah
Copy link
Contributor

hyangah commented Nov 1, 2023

@hg-hg @lkonst2 gopls v0.14.1 was released, and it has some workarounds for incompatible GOPACKAGESDRIVER. Are you still experiencing the issue after upgrading gopls?

@hg-hg
Copy link

hg-hg commented Nov 1, 2023

@hyangah I was following golang/go#63751, and found that both v0.14.1-pre.1 and v0.14.1 could solve the issue. Thanks a lot for your help!

@hyangah
Copy link
Contributor

hyangah commented Nov 1, 2023

Great to hear that v0.14.1 addressed it! Thank you!
Closing.

Duplicate of golang/go#63751

@hyangah hyangah closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
@hyangah hyangah added Duplicate Make it obvious when issues are closed as duplicate automatedReport Automatically created issues gopls gopls related issues and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automatedReport Automatically created issues Duplicate Make it obvious when issues are closed as duplicate gopls gopls related issues
Projects
None yet
Development

No branches or pull requests

5 participants