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/internal/imports: invalid memory address or nil pointer dereference (crash) #57622

Closed
ankurcha opened this issue Dec 24, 2022 · 1 comment
Labels
FrozenDueToAge 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

@ankurcha
Copy link

gopls version: v0.11.0 (go1.19.4)
gopls flags:
update flags: proxy
extension version: 2022.12.1919
go version: 1.19.4
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Sat, 24 Dec 2022 08:08:57 GMT
restart history:
Sat, 24 Dec 2022 03:10:24 GMT: activation (enabled: true)
Sat, 24 Dec 2022 06:22:09 GMT: manual (enabled: true)
Sat, 24 Dec 2022 07:32:12 GMT: manual (enabled: true)
Sat, 24 Dec 2022 08:07:10 GMT: manual (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=0x6ff262]

goroutine 33809 [running]:
golang.org/x/tools/internal/imports.(*dirInfoCache).Load(0xc017c323e8%3F, {0xc00513e360%3F, 0xd75be0%3F})
	  mod_cache.go:184  0x62
golang.org/x/tools/internal/imports.(*ModuleResolver).cacheLoad(0xc00f1734a0, {0xc00513e360, 0x56})
	  mod.go:284  0xa6
golang.org/x/tools/internal/imports.(*ModuleResolver).findPackage(0xc00f1734a0, {0xc000531d10, 0x25})
	  mod.go:246  0x1f1
golang.org/x/tools/internal/imports.(*ModuleResolver).scoreImportPath(0x0%3F, {0x0%3F, 0x0%3F}, {0xc000531d10, 0x25})
	  mod.go:533  0x6a
golang.org/x/tools/internal/imports.ScoreImportPaths({0x10e0a08, 0xc01986a000}, 0xc017c32898%3F, {0xc01782e800, 0x4d, 0xe1d4a0%3F})
	  fix.go:670  0xef
golang.org/x/tools/gopls/internal/lsp/source/completion.(*completer).unimportedPackages.func1(0xd15080%3F)
	  completion.go:1492  0x3f
golang.org/x/tools/gopls/internal/lsp/cache.(*importsState).runProcessEnvFunc(0xc0005e98c0, {0x10e0a08, 0xc01986a000}, 0xc0013ad340, 0xc00a5c0300)
	  imports.go:104  0x6a8
golang.org/x/tools/gopls/internal/lsp/cache.(*snapshot).RunProcessEnvFunc(0xc017c32c38%3F, {0x10e0a08%3F, 0xc01986a000%3F}, 0x0%3F)
	  view.go:391  0x34
golang.org/x/tools/gopls/internal/lsp/source/completion.(*completer).unimportedPackages(0xc00a70e000, {0x10e0a08, 0xc01986a000}, 0xc00a5c01e0)
	  completion.go:1490  0x41c
golang.org/x/tools/gopls/internal/lsp/source/completion.(*completer).lexical(0xc00a70e000, {0x10e0a08, 0xc01986a000})
	  completion.go:1395  0x6ca
golang.org/x/tools/gopls/internal/lsp/source/completion.(*completer).collectCompletions(0xc00a70e000, {0x10e0a08%3F, 0xc01986a000%3F})
	  completion.go:636  0x4c6
golang.org/x/tools/gopls/internal/lsp/source/completion.Completion({0x10e0998%3F, 0xc01b758080%3F}, {0x10ecdb8%3F, 0xc0013ad340}, {0x10e0ca8%3F, 0xc02032db90}, {0xa800%3F, 0x0%3F}, {0x1, {0x0, ...}})
	  completion.go:561  0x1266
golang.org/x/tools/gopls/internal/lsp.(*Server).completion(0xcfb960%3F, {0x10e0998, 0xc01b758080}, 0xc02041c000)
	  completion.go:32  0x1c5
golang.org/x/tools/gopls/internal/lsp.(*Server).Completion(0xc003ae3440%3F, {0x10e0998%3F, 0xc01b758080%3F}, 0xcfb960%3F)
	  server_gen.go:28  0x25
golang.org/x/tools/gopls/internal/lsp/protocol.serverDispatch({0x10e0998, 0xc01b758080}, {0x10f0780, 0xc00016cc00}, 0xc017976000, {0x10e0d88, 0xc01b758000})
	  tsserver.go:269  0x20c2
golang.org/x/tools/gopls/internal/lsp/protocol.ServerHandler.func1({0x10e0998, 0xc01b758080}, 0xc017976000, {0x10e0d88, 0xc01b758000})
	  protocol.go:157  0x90
golang.org/x/tools/gopls/internal/lsp/lsprpc.handshaker.func1({0x10e0998, 0xc01b758080}, 0xc017976000, {0x10e0d88%3F, 0xc01b758000%3F})
	  lsprpc.go:519  0xa39
golang.org/x/tools/internal/jsonrpc2.MustReplyHandler.func1({0x10e0998, 0xc01b758080}, 0xc00dc443c0, {0x10e0d88%3F, 0xc01b758000%3F})
	  handler.go:35  0xf6
golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2()
	  handler.go:103  0xa3
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
	  handler.go:100  0x20a
[Error - 12:08:53 AM] 

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>

@suzmue suzmue added the gopls Issues related to the Go language server, gopls. label Dec 27, 2022
@hyangah hyangah changed the title gopls: automated issue report (crash) x/tools/internal/imports: invalid memory address or nil pointer dereference (crash) Jan 5, 2023
@hyangah hyangah transferred this issue from golang/vscode-go Jan 5, 2023
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jan 5, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jan 5, 2023
@findleyr
Copy link
Member

findleyr commented Jan 5, 2023

Dupe of #49396.

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2023
@golang golang locked and limited conversation to collaborators Jan 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

4 participants