-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
This crash was observed on one builder run when the panic/recover was removed from analysis in gopls:
panic: nil type [recovered]
panic: /workdir/gopath/src/golang.org/x/tools/internal/lsp/bug/bug.go:56: analysis SA4016 for package golang.org/x/tools/internal/lsp/rename/generics panicked: nil type
goroutine 93005 [running]:
golang.org/x/tools/internal/lsp/bug.Report({0xc009028900, 0x5e}, 0x0)
/workdir/gopath/src/golang.org/x/tools/internal/lsp/bug/bug.go:71 +0x594
golang.org/x/tools/internal/lsp/bug.Errorf({0x1488298, 0x27}, {0xc00cdc6d38, 0x3, 0x3})
/workdir/gopath/src/golang.org/x/tools/internal/lsp/bug/bug.go:56 +0x73
golang.org/x/tools/internal/lsp/cache.runAnalysis.func8.1()
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cache/analysis.go:368 +0x165
panic({0x12f23a0, 0x17aee00})
/workdir/go/src/runtime/panic.go:890 +0x262
golang.org/x/exp/typeparams.computeTermSetInternal({0x0, 0x0}, 0x1385b00?, 0x0)
/workdir/gopath/pkg/mod/golang.org/x/exp/[email protected]/normalize.go:111 +0x1058
golang.org/x/exp/typeparams.NormalTerms({0x0?, 0x0})
/workdir/gopath/pkg/mod/golang.org/x/exp/[email protected]/normalize.go:78 +0x16e
honnef.co/go/tools/go/types/typeutil.NewTypeSet({0x0, 0x0})
/workdir/gopath/pkg/mod/honnef.co/go/[email protected]/go/types/typeutil/typeparams.go:16 +0x3b
honnef.co/go/tools/go/types/typeutil.All({0x0, 0x0}, 0xc0021c1ce0?)
/workdir/gopath/pkg/mod/honnef.co/go/[email protected]/go/types/typeutil/typeparams.go:99 +0x3c
honnef.co/go/tools/staticcheck.CheckSillyBitwiseOps.func1({0x17b3b48?, 0xc0021c1ce0})
/workdir/gopath/pkg/mod/honnef.co/go/[email protected]/staticcheck/lint.go:2902 +0xc5
golang.org/x/tools/go/ast/inspector.(*Inspector).Preorder(0xc00a1fe600, {0xc00243d5b0?, 0x1, 0x431a70?}, 0xc00cdc75c0)
/workdir/gopath/src/golang.org/x/tools/go/ast/inspector/inspector.go:77 +0x103
honnef.co/go/tools/analysis/code.Preorder(...)
/workdir/gopath/pkg/mod/honnef.co/go/[email protected]/analysis/code/visit.go:16
honnef.co/go/tools/staticcheck.CheckSillyBitwiseOps(0xc008345110)
/workdir/gopath/pkg/mod/honnef.co/go/[email protected]/staticcheck/lint.go:2966 +0xe5
golang.org/x/tools/internal/lsp/cache.runAnalysis.func8(0xc008b3e9a0, 0xc000487a00, 0xc001c5d440, 0xc008345110)
/workdir/gopath/src/golang.org/x/tools/internal/lsp/cache/analysis.go:371 +0x117
FAIL golang.org/x/tools/gopls/test 47.513s
The apparent cause is TypeOf(BinaryExpr) returning nil, which is then passed to NewTypeSet. The BinaryExpr in question is a "|" union operator over type constraints. Questions:
- why isn't this deterministic? Is it a race against process exit, hence it only shows up on slower builders?
- Is it a go/types bug? The analysis has RunDespiteErrors=false, so every expression should have a type.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.