-
-
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
false staticcheck reports not reproducible with standalone staticcheck #1768
Comments
Currently it produces false reports with Go1.16: tools/syz-runtest/runtest.go:271:6: SA5011: possible nil pointer dereference req.Output = a.Output ^ tools/syz-runtest/runtest.go:272:6: SA5011: possible nil pointer dereference req.Info = a.Info ^ sys/fuchsia/fidlgen/main.go:27:17: SA5011: possible nil pointer dereference arch := target.KernelHeaderArch ^ All these are preceeded with log.Fatalf, which is strange... Update #2446
|
Isn't it only about reporting context/related info? |
Maybe I misread. I'm trying to reproduce. |
One thing I forgot to mention: |
Currently, I followed your steps, but I'm not able to run the linter on your project $ golangci-lint run ./tools/syz-runtest
WARN [runner] Can't run linter goanalysis_metalinter: deadcode: analysis skipped: errors in package: [/home/ldez/sources/go/src/github.com/google/syzkaller/tools/syz-runtest/runtest.go:21:2: could not import github.com/google/syzkaller/pkg/instance (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/instance/instance.go:18:2: could not import github.com/google/syzkaller/pkg/build (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/build/build.go:17:2: could not import github.com/google/syzkaller/pkg/report (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/report/fuzz.go:9:2: could not import github.com/google/syzkaller/pkg/mgrconfig (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/mgrconfig/load.go:18:4: could not import github.com/google/syzkaller/sys (/home/ldez/sources/go/src/github.com/google/syzkaller/sys/sys.go:8:4: could not import github.com/google/syzkaller/sys/akaros/gen (sys/sys.go:8:2: cannot find package "." in:
/home/ldez/sources/go/src/github.com/google/syzkaller/sys/akaros/gen)))))) /home/ldez/sources/go/src/github.com/google/syzkaller/tools/syz-runtest/runtest.go:22:2: could not import github.com/google/syzkaller/pkg/mgrconfig (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/mgrconfig/load.go:18:4: could not import github.com/google/syzkaller/sys (/home/ldez/sources/go/src/github.com/google/syzkaller/sys/sys.go:8:4: could not import github.com/google/syzkaller/sys/akaros/gen (sys/sys.go:8:2: cannot find package "." in:
/home/ldez/sources/go/src/github.com/google/syzkaller/sys/akaros/gen))) /home/ldez/sources/go/src/github.com/google/syzkaller/tools/syz-runtest/runtest.go:24:2: could not import github.com/google/syzkaller/pkg/report (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/report/fuzz.go:9:2: could not import github.com/google/syzkaller/pkg/mgrconfig (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/mgrconfig/load.go:18:4: could not import github.com/google/syzkaller/sys (/home/ldez/sources/go/src/github.com/google/syzkaller/sys/sys.go:8:4: could not import github.com/google/syzkaller/sys/akaros/gen (sys/sys.go:8:2: cannot find package "." in:
/home/ldez/sources/go/src/github.com/google/syzkaller/sys/akaros/gen)))) /home/ldez/sources/go/src/github.com/google/syzkaller/tools/syz-runtest/runtest.go:25:2: could not import github.com/google/syzkaller/pkg/rpctype (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/rpctype/rpctype.go:9:2: could not import github.com/google/syzkaller/pkg/host (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/host/features.go:10:2: could not import github.com/google/syzkaller/pkg/csource (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/csource/options.go:14:2: could not import github.com/google/syzkaller/pkg/mgrconfig (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/mgrconfig/load.go:18:4: could not import github.com/google/syzkaller/sys (/home/ldez/sources/go/src/github.com/google/syzkaller/sys/sys.go:8:4: could not import github.com/google/syzkaller/sys/akaros/gen (sys/sys.go:8:2: cannot find package "." in:
/home/ldez/sources/go/src/github.com/google/syzkaller/sys/akaros/gen)))))) /home/ldez/sources/go/src/github.com/google/syzkaller/tools/syz-runtest/runtest.go:26:2: could not import github.com/google/syzkaller/pkg/runtest (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/runtest/run.go:27:2: could not import github.com/google/syzkaller/pkg/csource (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/csource/options.go:14:2: could not import github.com/google/syzkaller/pkg/mgrconfig (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/mgrconfig/load.go:18:4: could not import github.com/google/syzkaller/sys (/home/ldez/sources/go/src/github.com/google/syzkaller/sys/sys.go:8:4: could not import github.com/google/syzkaller/sys/akaros/gen (sys/sys.go:8:2: cannot find package "." in:
/home/ldez/sources/go/src/github.com/google/syzkaller/sys/akaros/gen))))) /home/ldez/sources/go/src/github.com/google/syzkaller/tools/syz-runtest/runtest.go:28:4: could not import github.com/google/syzkaller/sys (/home/ldez/sources/go/src/github.com/google/syzkaller/sys/sys.go:8:4: could not import github.com/google/syzkaller/sys/akaros/gen (sys/sys.go:8:2: cannot find package "." in:
/home/ldez/sources/go/src/github.com/google/syzkaller/sys/akaros/gen)) /home/ldez/sources/go/src/github.com/google/syzkaller/tools/syz-runtest/runtest.go:29:2: could not import github.com/google/syzkaller/vm (/home/ldez/sources/go/src/github.com/google/syzkaller/vm/vm.go:18:2: could not import github.com/google/syzkaller/pkg/mgrconfig (/home/ldez/sources/go/src/github.com/google/syzkaller/pkg/mgrconfig/load.go:18:4: could not import github.com/google/syzkaller/sys (/home/ldez/sources/go/src/github.com/google/syzkaller/sys/sys.go:8:4: could not import github.com/google/syzkaller/sys/akaros/gen (sys/sys.go:8:2: cannot find package "." in:
/home/ldez/sources/go/src/github.com/google/syzkaller/sys/akaros/gen)))) /home/ldez/sources/go/src/github.com/google/syzkaller/tools/syz-runtest/runtest.go:15:2: "net" imported but not used]
WARN [runner] Can't run linter unused: buildir: failed to load package : could not load export data: no export data for "github.com/google/syzkaller/sys/akaros/gen"
ERRO Running error: buildir: failed to load package : could not load export data: no export data for "github.com/google/syzkaller/sys/akaros/gen" |
oh, sorry, please run |
The problem will be fixed by the next version. $ golangci-lint run ./tools/syz-runtest
tools/syz-runtest/runtest.go:271:6: SA5011: possible nil pointer dereference
req.Output = a.Output
^
tools/syz-runtest/runtest.go:272:6: SA5011: possible nil pointer dereference
req.Info = a.Info
^
$ ./golangci-lint run ./tools/syz-runtest |
So it's not a duplicate 😉 For now, I don't know if it's related to the update of staticcheck #1756 or to something else |
You tried to trick me 😄 :
But I also tried with |
I confirm the problem has been fixed by #1756 |
That was @dominikh who tried to trick both me and you :) So I need to wait for new golangci-lint version. |
Thank you for creating the issue!
Please include the following information:
Version of golangci-lint
Config file
Go environment
Verbose output of running
Repro instructions:
Apply the following change:
Then:
These are false reports, the line is preceded by
log.Fatalf
and standalone staticcheck does not produce these warnings:I've found #1189 but it seems to be only about reporting context/related info.
@dominikh
The text was updated successfully, but these errors were encountered: