-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
bodyclose: panic "interface conversion: interface {} is nil, not *buildssa.SSA" #3086
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
This is most likely fixed via dep bumps when I look at https://github.com/golangci/golangci-lint/blob/master/go.mod and timakin/bodyclose#38 (comment) I think it is worth to retest. FYI @ldez |
We're also hitting this on OUTPUTERRO [runner] Panic: bodyclose: package "ent" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildssa.SSA: goroutine 236677 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x65
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:102 +0x155
panic({0xfa2540, 0xc01d6a37d0})
runtime/panic.go:884 +0x213
github.com/timakin/bodyclose/passes/bodyclose.runner.run({0xc0677cbc20, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0, 0x0}, 0xc0677cbc20)
github.com/timakin/[email protected]/passes/bodyclose/bodyclose.go:45 +0x665
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc00368af40)
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:188 +0x9df
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:106 +0x1d
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc002cdfc70, {0x10e8b16, 0x9}, 0xc0062e6748)
github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x4a
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc01cf46f38?)
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:105 +0x85
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc00368af40)
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb4
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1eb
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: bodyclose: package "ent" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildssa.SSA
ERRO Running error: 1 error occurred:
* can't run linter goanalysis_metalinter |
@pellared, hi! I think there is a
I created a demo and grep the list of broken linters: Looks like it's worth renaming the current issue (or create the new one) and making the issue in (cc) @ldez UPD: Issue in |
@ldez Hello! When to expect the new |
@Antonboom it is coming 😄 I wanted to wait for gocritic (because I was aware of a current rework) and time to review one other PR. |
@ldez Hi! I tested Some of the broken linters now are ok, but some of the linters are still errored. The last list of bad linters: - asciicheck
- bodyclose
- bidichk
- contextcheck
- cyclop
- decorder
- depguard
- dupl
- dupword
- errorlint
- gocyclo
- gosec
- gosimple
- govet
- importas
- ineffassign
- nilnil
- lll
- makezero
- misspell
- nakedret
- nilerr
- noctx
- tparallel
- unparam Current list of "bad" linters: # Error `interface {} is nil, not *buildssa.SSA`
- bodyclose # go 1.12, x/tools v0.2.0
- contextcheck # go 1.20, x/tools v0.7.0
- nilerr # go 1.15, x/tools v0.0.0-20201023174141-c8cfbd0f21e6
- rowserrcheck # go 1.13, x/tools v0.1.11
- unparam # go 1.19, x/tools v0.7.0
# Error `ent.withHooks$1: cannot convert *t0 (M) to PM`
- noctx # go 1.20, x/tools v0.7.0
- sqlclosecheck # go 1.19, x/tools v0.5.0
- tparallel # go 1.20, x/tools v0.7.0
- wastedassign # go 1.14, x/tools v0.7.0 Do you have any ideas? What unites them? Are there any patterns? Which side is the problem on? P.S. Maybe on the |
Remender that we use only one version of x/tools and we don't care about the go version inside the go.Mod of linters so your matrix is off-topic. |
yep, I just tried to find some corner cases of MVS process 🤷♂️
yes, but not pre-process? :) |
MVS, in this simple case, cannot have a problem, it's not npm, and it's easy to validate by using a simple I was trapped, I was thinking that you have tried the impact of the upgrade of x/tools, so I trusted you. (I tested on the chconn repo before the release but maybe it was not the right version of chconn) I already spend some time on this issue (I kept it open in my browser since it was opened). With your test repo: v1.51.2
v1.52.0
|
Let me add some clarity. Remember I wrote above there are two issues:
Pair But I didn’t say anywhere that this update would save from problem 1), although as far as I remember, I stopped seeing it too. Anyway I was surprised when you closed this issue. Now I surprised, confused and truly don't understand why 1) error still appears. Moreover, if I clear the cache and repeat the run, I see different results. For example, once I faced the new error TraceERRO [runner] Panic: noctx: package "ent" (isInitialPkg: true, needAnalyzeSource: true): <nil> is not *buildssa.SSA: goroutine 5088 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x64
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:102 +0x108
panic({0x1032b96e0, 0x1400ce83360})
runtime/panic.go:884 +0x1f4
github.com/sonatard/noctx/reqwithoutctx.NewAnalyzer(0x140046bb860)
github.com/sonatard/[email protected]/reqwithoutctx/ssa.go:27 +0x1a8
github.com/sonatard/noctx/reqwithoutctx.Run(0x140012b4ce8?)
github.com/sonatard/[email protected]/reqwithoutctx/main.go:8 +0x20
github.com/sonatard/noctx.run(0x1032fab20?)
github.com/sonatard/[email protected]/noctx.go:30 +0x78
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0x140025fe620)
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:188 +0x94c
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:106 +0x20
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0x14000643630, {0x102fca49d, 0x5}, 0x140012b4f30)
github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0x1400da39688?)
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:105 +0x74
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0x140025fe620)
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb0
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x17c
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: noctx: package "ent" (isInitialPkg: true, needAnalyzeSource: true): <nil> is not *buildssa.SSA
INFO [runner] processing took 2.541µs with stages: max_same_issues: 542ns, nolint: 334ns, skip_dirs: 250ns, autogenerated_exclude: 208ns, cgo: 208ns, max_from_linter: 125ns, source_code: 125ns, diff: 84ns, max_per_file_from_linter: 84ns, sort_results: 84ns, path_prefixer: 83ns, identifier_marker: 83ns, path_prettifier: 42ns, uniq_by_line: 42ns, skip_files: 42ns, exclude: 41ns, filename_unadjuster: 41ns, severity-rules: 41ns, path_shortener: 41ns, exclude-rules: 41ns
INFO [runner] linters took 6.075075125s with stages: goanalysis_metalinter: 6.075029791s
ERRO Running error: 1 error occurred:
* can't run linter goanalysis_metalinter: goanalysis_metalinter: noctx: package "ent" (isInitialPkg: true, needAnalyzeSource: true): <nil> is not *buildssa.SSA
Remember that golang/go#58633 still waiting feedback from
I'll try to debug
Please, don't blame me for the new release:
|
Remember that we have been forced, one month ago, to drop the old Team Discussion because Github drop this. I created a private announcement 12 hours before the release as usual.
I don't want to blame you, I'm just disappointed, I should have spent more time validating the impact of the various changes, and don't let me be swayed by your calls for a release. |
Why did I close the issue? It's not the end of the world, but I don't like this kind of situation. |
The last point, we will be more strict with this issue:
|
I spend some to analyze once again the problem based on your project. |
@ldez, thank u for your comments. I feel terribly stupid 🤦 . I tried to repeat my tests again and I really don't understand how I managed to NOT get the panics above. I apologize and will try to be more careful, my desire to make I will try to contribute in |
I created PR #3710 to improve the output when panic happens inside buildssa. The error |
I will close this issue, not because the underlying problem is fixed but just because the issue is too generic, and we will have multiple, not related, problems in this issue. So I recommend opening dedicated issues in the future. When my PR is merged, I will create a bugfix release (if the team agrees with that as usual) |
Welcome
Description of the problem
I ran the linter on the chconn repo
https://github.com/vahid-sohrabloo/chconn
Version of golangci-lint
Configuration file
Go environment
Verbose output of running
Code example or link to a public repository
https://github.com/vahid-sohrabloo/chconn
The text was updated successfully, but these errors were encountered: