x/tools/gopls: call to IsGenerated ocassionally has nil Snapshot causing panic #41778
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
What did you do?
This is sporadic, and I'm not entirely sure how to reliably repoduce it; my current approach to reproduction is to to open new files and make modifications. About 1/20 times, this will cause this crash.
I am using gopls with sublimelsp/LSP as recommended. ST3.
What did you expect to see?
No crash.
What did you see instead?
A crash.
This is a consequence of filling
snapshotByURI
withnil
Snaphot
s here and then if asnapshot
value isnil
here leaving it there. Finally, the check for valid snaphots here uses map presence rather thanSnapshot
nil
-ness as the check for validity.Either the validity check in the generated code check loop should be for non-
nil
Snapshot
sor probably better, remove the
snapshotByURI
elements that are nil in the check above.Maybe both.
Build info
golang/tools@9647ced
The text was updated successfully, but these errors were encountered: