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

Panic: buildssa: package "db" #732

Closed
cornelk opened this issue Sep 24, 2019 · 5 comments
Closed

Panic: buildssa: package "db" #732

cornelk opened this issue Sep 24, 2019 · 5 comments
Labels
bug Something isn't working dependencies Relates to an upstream dependency

Comments

@cornelk
Copy link

cornelk commented Sep 24, 2019

Version: golangci-lint has version v1.19.0 built from (unknown, mod sum: "h1:ioXGJ8cIM78dqnHwlfegYLmrsE+N+sU7Vsfy0b6Yhrk=") on (unknown)

go version: go version go1.12.9 linux/amd64

log output:

INFO [lintersdb] Active 26 linters: [bodyclose deadcode depguard dogsled errcheck goconst gocritic gocyclo godox gofmt goimports golint gosimple ineffassign maligned misspell nakedret staticcheck structcheck stylecheck typecheck unconvert unparam unused varcheck whitespace] 
INFO [lintersdb] Optimized sublinters [staticcheck gosimple unused stylecheck] into metalinter megacheck 
INFO [loader] Go packages loading at mode 1023 (deps|name|syntax|types_info|compiled_files|exports_file|files|imports|types|types_sizes) took 9.585569159s 
INFO [loader] SSA repr building timing: packages building 47.174149ms, total 1.645289637s 
....
WARN [linters context] Panic: buildssa: package "db" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: *ssa.UnOp is not interface { ssa.setNum(int) }: missing method setNum: goroutine 21305 [running]:
runtime/debug.Stack(0xf457c8, 0x3c, 0xc02cf0d6b0)
	/home/user/go/src/xxx/_tooling/go/current/src/runtime/debug/stack.go:24 +0x9d
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1(0xc05eb99740)
	/home/user/go/src/xxx/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go:404 +0x1af
panic(0xda0520, 0xc05f17b1a0)
	/home/user/go/src/xxx/_tooling/go/current/src/runtime/panic.go:522 +0x1b5
honnef.co/go/tools/ssa.numberRegisters(0xc05e947180)
	/home/user/go/src/xxx/vendor/honnef.co/go/tools/ssa/func.go:278 +0x114
honnef.co/go/tools/ssa.(*Function).finishBody(0xc05e947180)
	/home/user/go/src/xxx/vendor/honnef.co/go/tools/ssa/func.go:410 +0x746
honnef.co/go/tools/ssa.(*Package).build(0xc05f143920)
	/home/user/go/src/xxx/vendor/honnef.co/go/tools/ssa/builder.go:2352 +0x94e
sync.(*Once).Do(0xc05f14394c, 0xc004bfbc70)
	/home/user/go/src/xxx/_tooling/go/current/src/sync/once.go:44 +0xb3
honnef.co/go/tools/ssa.(*Package).Build(0xc05f143920)
	/home/user/go/src/xxx/vendor/honnef.co/go/tools/ssa/builder.go:2260 +0x54
honnef.co/go/tools/internal/passes/buildssa.run(0xc05f1875e0, 0x2abf99cc9, 0x18b43a0, 0x2, 0x2)
	/home/user/go/src/xxx/vendor/honnef.co/go/tools/internal/passes/buildssa/buildssa.go:70 +0x27b
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc05eb99740)
	/home/user/go/src/xxx/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go:495 +0x85b
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc05eb99740)
	/home/user/go/src/xxx/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go:407 +0x51
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func3(0xc05eeed9e0, 0xc05eb99740)
	/home/user/go/src/xxx/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go:961 +0x5f
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
	/home/user/go/src/xxx/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go:956 +0x2cd 
@jirfag
Copy link
Member

jirfag commented Sep 24, 2019

hi, how did you build golangci-lint? I guess you didn't use binary releases and didn't use replacements from go.mod. And because of missing golang/tools#162 you are getting panic

@jirfag jirfag closed this as completed Sep 24, 2019
@sebrandon1
Copy link

I'm hitting this same thing. I'm following the README (replacing 1.18.0 with 1.19.1):

GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/[email protected]

And I'm getting the same failure when linting my project.

WARN [linters context] Panic: buildssa: package "server" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: *ssa.FieldAddr is not interface { ssa.setNum(int) }: missing method setNum: goroutine 13769 [running]:

@jirfag
Copy link
Member

jirfag commented Oct 7, 2019

Just use binary releases: its the known go compiler bug, I guess you are using old version of Go.

@sebrandon1
Copy link

I'm using Go 1.12.10. I got it working using a binary release of v1.19.1.

@tpounds tpounds added bug Something isn't working dependencies Relates to an upstream dependency labels Oct 7, 2019
@jirfag
Copy link
Member

jirfag commented Oct 8, 2019

yep, the bug was fixed only in Go 1.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Relates to an upstream dependency
Projects
None yet
Development

No branches or pull requests

4 participants