Open husamettinarabaci opened 8 months ago
Hi, thanks very much for the report.
Is this reproducible on your end, or did restarting the language server make it go away?
Hi, No, It wasn't. It was solved after restarting the language server.
Hi, reopening since all crashes warrant investigation. If it didn't reoccur upon restart, that may just suggest that there is an internal race that is rare.
@adonovan the crash is on this line:
In makeNode
, we verify that the metadata is non-nil (hooray for such assertions!):
https://cs.opensource.google/go/x/tools/+/refs/tags/gopls/v0.14.1:gopls/internal/lsp/cache/analysis.go;l=236;drc=b9b97d982b0a16d0bc8d95fb1dc654120b0d4940
Therefore, it seems that it must be the case that the analysisNode.summary
is nil... but I'll admit I stared at the code for 10m and did not see a bug: a node should not run until its successors have completed, all deps should be present in the succs map, there can be at most one per ID, and once a successor has completed its summary must be present. Perhaps I'm missing something, but there didn't appear to be an obvious bug.
How can I help with your investigation?
@husamettinarabaci do you happen to use Bazel/rules_go in the project that was having this issue?
@JamyDev https://bazel.build/ did you mean this?
Yeah, I mentioned this because we had the exact same error with the bazel toolchain active. But if you're not using it, it's unlikely to be the root cause.
~@JamyDev on the bazel/rules_go side, potentially related, I started hitting this crash after upgrading rules_go to 0.43 today, but only immediately after I open a test file that uses an xtest package.~
EDIT: nevermind, I see now that that was addressed in bazelbuild/rules_go#3777
The possible dup at https://github.com/golang/vscode-go/issues/3126 raises the question of whether this is a package cycle that somehow slipped through the cycle breaking in detectImportCycles.
So, one observation: the repro in golang/vscode-go#3126 had a self-cycle, and detectImportCycles/breakImportCycles appears not to work for 1-cycles. Furthermore, an.allDeps
has an explicit self-reference (it is the reflexive transitive closure).
If (1) go/packages could be tricked to return a 1-cycle, or (2) we somehow got a self reference in the export data manifest, it would result in this crash.
But of course I only need such a long explanation because I don't have a repro, despite my attempts.
Change https://go.dev/cl/560463 mentions this issue: gopls/internal/cache/metadata: assert graph is acyclic
gopls version: v0.14.1 (go1.21.3) gopls flags: update flags: proxy extension version: 0.39.1 go version: 1.21.3 environment: code-server linux initialization error: undefined issue timestamp: Mon, 06 Nov 2023 07:04:10 GMT restart history: Mon, 06 Nov 2023 07:03:37 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.