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

--fast panics #40

Closed
dallbee opened this issue May 29, 2018 · 2 comments
Closed

--fast panics #40

dallbee opened this issue May 29, 2018 · 2 comments
Labels
area: CLI Related to CLI area: config Related to .golangci.yml and/or cli options bug Something isn't working

Comments

@dallbee
Copy link

dallbee commented May 29, 2018

First of all, awesome project. The pretty-printed output is very helpful, and I'm definitely seeing performance improvements over gometalinter.

I encountered some problems while trying this tool out. It works fine when run with --enable-all, but panics when passed --fast, as well as some combinations involving --disable-all.

Version Info

Go version 1.10
golangci-lint version:

$ golangci-lint --version
golangci-lint has version master built from ? on

Not sure what that output means to you...

$ cd $GOPATH/src/github.com/golangci/golangci-lint/
$ git rev-parse HEAD
0eb6aa7c59aab27a316af0b18acd023faf814c72

Which appears to be the latest master version as of this moment.

Stack Traces

$ golangci-lint run --fast
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xa41543]

goroutine 1 [running]:
github.com/golangci/golangci-lint/pkg/commands.separateNotCompilingPackages(0xc420186a00)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:199 +0x43
github.com/golangci/golangci-lint/pkg/commands.buildLintCtx(0xc8e360, 0xc42009ac60, 0xc420114e80, 0x8, 0x8, 0xc42013b1e0, 0xc4204b5a40, 0x49aeff, 0xbc7742)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:264 +0x39a
github.com/golangci/golangci-lint/pkg/commands.(*Executor).runAnalysis(0xc42011eb90, 0xc8e360, 0xc42009ac60, 0xc420495b70, 0x0, 0x1, 0x0, 0x0, 0x0)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:277 +0xf3
github.com/golangci/golangci-lint/pkg/commands.(*Executor).runAndPrint(0xc42011eb90, 0xc8e360, 0xc42009ac60, 0xc420495b70, 0x0, 0x1, 0x0, 0x0)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:331 +0xe0
github.com/golangci/golangci-lint/pkg/commands.(*Executor).executeRun(0xc42011eb90, 0xc4204b6280, 0xc420495b70, 0x0, 0x1)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:379 +0x23e
github.com/golangci/golangci-lint/pkg/commands.(*Executor).(github.com/golangci/golangci-lint/pkg/commands.executeRun)-fm(0xc4204b6280, 0xc420495b70, 0x0, 0x1)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:40 +0x52
github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra.(*Command).execute(0xc4204b6280, 0xc420495b60, 0x1, 0x1, 0xc4204b6280, 0xc420495b60)
        /opt/go/src/github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra/command.go:760 +0x2c1
github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4204b6000, 0xa, 0xbcb5ec, 0xc4204b6a00)
        /opt/go/src/github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra/command.go:846 +0x30a
github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4204b6000, 0xc42013b1e0, 0xc42011eb90)
        /opt/go/src/github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra/command.go:794 +0x2b
github.com/golangci/golangci-lint/pkg/commands.Executor.Execute(0xc4204b6000, 0xc42013b1e0, 0x0, 0xbc48a7, 0x6, 0xbc1d5f, 0x1, 0x0, 0x0, 0xc4204b5f78, ...)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/executor.go:35 +0x2b
main.main()
        /opt/go/src/github.com/golangci/golangci-lint/cmd/golangci-lint/main.go:16 +0x9a

And a variant with --disable-all, but failing to use --enable=xx correctly produces a similar response.

$ golangci-lint run -v --no-config --disable-all --enable govet
INFO[0000] Concurrency: 4, machine cpus count: 4
INFO[0000] Active linters: [govet]
INFO[0000] set GOROOT="/usr/local/go"
INFO[0000] Found paths for analysis for 2.69556ms: [. ./cmd ./dbal ./env ./lib/async ./lib/auditlog ./lib/classify ./lib/conn ./lib/daemon ./lib/locker ./lib/log ./lib/schedule ./lib/trie ./pipe ./pipe/msg ./pipe/plugin/core ./pipe/plugin/frhc ./pipe/plugin/rabbitmq ./pipe/plugin/reports ./pipe/plugin/salesforce ./pipe/plugin/telcor]
INFO[0000] Memory: 1 samples, avg is 14.7MB, max is 14.7MB
INFO[0000] Execution took 19.662404ms
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xa41543]

goroutine 1 [running]:
github.com/golangci/golangci-lint/pkg/commands.separateNotCompilingPackages(0xc420da3ea0)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:199 +0x43
github.com/golangci/golangci-lint/pkg/commands.buildLintCtx(0xc8e360, 0xc4200d8cc0, 0xc42013d4f0, 0x1, 0x1, 0xc4200e1380, 0xc420369a40, 0x49aeff, 0xbc7742)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:264 +0x39a
github.com/golangci/golangci-lint/pkg/commands.(*Executor).runAnalysis(0xc420148af0, 0xc8e360, 0xc4200d8cc0, 0xc420148c30, 0x0, 0x5, 0x0, 0x0, 0x0)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:277 +0xf3
github.com/golangci/golangci-lint/pkg/commands.(*Executor).runAndPrint(0xc420148af0, 0xc8e360, 0xc4200d8cc0, 0xc420148c30, 0x0, 0x5, 0x0, 0x0)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:331 +0xe0
github.com/golangci/golangci-lint/pkg/commands.(*Executor).executeRun(0xc420148af0, 0xc42036c280, 0xc420148c30, 0x0, 0x5)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:379 +0x23e
github.com/golangci/golangci-lint/pkg/commands.(*Executor).(github.com/golangci/golangci-lint/pkg/commands.executeRun)-fm(0xc42036c280, 0xc420148c30, 0x0, 0x5)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/run.go:40 +0x52
github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra.(*Command).execute(0xc42036c280, 0xc420148be0, 0x5, 0x5, 0xc42036c280, 0xc420148be0)
        /opt/go/src/github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra/command.go:760 +0x2c1
github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc42036c000, 0xa, 0xbcb5ec, 0xc42036c780)
        /opt/go/src/github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra/command.go:846 +0x30a
github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra.(*Command).Execute(0xc42036c000, 0xc4200e1380, 0xc420148af0)
        /opt/go/src/github.com/golangci/golangci-lint/vendor/github.com/spf13/cobra/command.go:794 +0x2b
github.com/golangci/golangci-lint/pkg/commands.Executor.Execute(0xc42036c000, 0xc4200e1380, 0x0, 0xbc48a7, 0x6, 0xbc1d5f, 0x1, 0x0, 0x0, 0xc420369f78, ...)
        /opt/go/src/github.com/golangci/golangci-lint/pkg/commands/executor.go:35 +0x2b
main.main()
        /opt/go/src/github.com/golangci/golangci-lint/cmd/golangci-lint/main.go:16 +0x9a

Other Notes

I'm guessing it's related to enabling a default linter which was disabled with disable-all:
golangci-lint run --no-config --deadline=30s --disable-all --enable=deadcode works
golangci-lint run --no-config --deadline=30s --disable-all --enable=govet is broken

golangci pushed a commit that referenced this issue May 30, 2018
golangci pushed a commit that referenced this issue May 30, 2018
@golangci
Copy link
Collaborator

@dallbee thank you very much, fixed in master, check please

@golangci golangci added bug Something isn't working awaiting_for_check_by_author labels May 30, 2018
@dallbee
Copy link
Author

dallbee commented Jun 2, 2018

This looks fixed. Thank you!

@ldez ldez added area: config Related to .golangci.yml and/or cli options area: CLI Related to CLI labels Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CLI Related to CLI area: config Related to .golangci.yml and/or cli options bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants