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

SIGSEGV in latest master #118

Closed
alecthomas opened this issue Jun 18, 2018 · 3 comments
Closed

SIGSEGV in latest master #118

alecthomas opened this issue Jun 18, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@alecthomas
Copy link
Contributor

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x148b7f9]

goroutine 858 [running]:
github.com/golangci/golangci-lint/pkg/lint/astcache.Cache.GetOrParse(0xc429a6e600, 0xc429a6e8d0, 0x5, 0x5, 0x0, 0x0, 0xc4200465ea, 0xb, 0x1cdb2e0)
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/lint/astcache/astcache.go:45 +0xe9
github.com/golangci/golangci-lint/pkg/result/processors.(*AutogeneratedExclude).getOrCreateFileSummary(0xc42b232620, 0xc425fca1e0, 0xc42a936001, 0x56, 0xc42ac1606a)
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go:86 +0x1d5
github.com/golangci/golangci-lint/pkg/result/processors.(*AutogeneratedExclude).shouldPassIssue(0xc42b232620, 0xc425fca1e0, 0x17a5120, 0x1, 0xc425fca1e0)
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go:45 +0x35
github.com/golangci/golangci-lint/pkg/result/processors.(*AutogeneratedExclude).(github.com/golangci/golangci-lint/pkg/result/processors.shouldPassIssue)-fm(0xc425fca1e0, 0xc425fca1e0, 0x2, 0xc420e348f0)
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go:41 +0x34
github.com/golangci/golangci-lint/pkg/result/processors.filterIssuesErr(0xc420e34790, 0x2, 0x2, 0xc42a779bd0, 0x2, 0x2, 0xc420e34790, 0x2, 0x2)
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/result/processors/utils.go:23 +0x177
github.com/golangci/golangci-lint/pkg/result/processors.(*AutogeneratedExclude).Process(0xc42b232620, 0xc420e34790, 0x2, 0x2, 0xbec1db586e30fd43, 0xbcd0619b8e992f53, 0xc42b96ec48, 0x1076a16, 0x5b26f5e1)
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go:41 +0x66
github.com/golangci/golangci-lint/pkg/lint.(*Runner).processIssues.func1()
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:261 +0x66
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc42acf0050, 0x181a467, 0x15, 0xc42b96ed68)
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:75 +0x53
github.com/golangci/golangci-lint/pkg/lint.(*Runner).processIssues(0xc429a6ec00, 0x18c3800, 0xc420193b60, 0xc420e34790, 0x2, 0x2, 0xc42acf0050, 0x1099042, 0xc42048ae40, 0x108c2ba)
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:260 +0x154
github.com/golangci/golangci-lint/pkg/lint.Runner.processLintResults.func1(0xc429a6ec00, 0xc422846960, 0xc422846900, 0x18c3800, 0xc420193b60)
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:201 +0x1b7
created by github.com/golangci/golangci-lint/pkg/lint.Runner.processLintResults
	/Users/aat/.go/src/github.com/golangci/golangci-lint/pkg/lint/runner.go:189 +0xde

PS. Thanks for all your work on golangci-lint, it's awesome!

golangci pushed a commit that referenced this issue Jun 18, 2018
1. Allow govet to work in 2 modes: fast and slow. Default is slow.
In fast mode golangci-lint runs `go install -i` and `go test -i`
for analyzed packages. But it's fast only when:
  - go >= 1.10
  - it's repeated run or $GOPATH/pkg or `go env GOCACHE` is cached
  between CI builds
In slow mode we load program from source code like for another linters
and do it only once for all linters.

3. Patch govet code to warn about any troubles with the type
information. Default behaviour of govet was to hide such warnings.
Fail analysis if there are any troubles with type loading: it will
prevent false-positives and false-negatives from govet.

4. Describe almost all options in .golangci.example.yml and
include it into README. Describe when to use slow or fast mode of govet.

5. Speed up govet: reuse AST parsing: it's already parsed once by
golangci-lint.
For "slow" runs (when we run at least one slow linter) speedup by
not loading type information second time.

6. Improve logging, debug logging

7. Fix crash in logging of AST cache warnings (#118)
jirfag added a commit that referenced this issue Jun 18, 2018
1. Allow govet to work in 2 modes: fast and slow. Default is slow.
In fast mode golangci-lint runs `go install -i` and `go test -i`
for analyzed packages. But it's fast only when:
  - go >= 1.10
  - it's repeated run or $GOPATH/pkg or `go env GOCACHE` is cached
  between CI builds
In slow mode we load program from source code like for another linters
and do it only once for all linters.

3. Patch govet code to warn about any troubles with the type
information. Default behaviour of govet was to hide such warnings.
Fail analysis if there are any troubles with type loading: it will
prevent false-positives and false-negatives from govet.

4. Describe almost all options in .golangci.example.yml and
include it into README. Describe when to use slow or fast mode of govet.

5. Speed up govet: reuse AST parsing: it's already parsed once by
golangci-lint.
For "slow" runs (when we run at least one slow linter) speedup by
not loading type information second time.

6. Improve logging, debug logging

7. Fix crash in logging of AST cache warnings (#118)
@jirfag
Copy link
Member

jirfag commented Jun 18, 2018

thank you for reporting, the crash was because of nil pointer to the logger in AST cache, I fixed it in #117,
update from master and re-run, please. But the issue isn't closed: there should be a warning printed and it's not ok. Attach this warning here, please.

@jirfag jirfag added the bug Something isn't working label Jun 18, 2018
@alecthomas
Copy link
Contributor Author

Thanks! The source code has subsequently changed, so I can no longer replicate it :(

If I see something like it again I'll let you know.

@jirfag
Copy link
Member

jirfag commented Jun 18, 2018

Ok, reopen or open new issue please when reproduces

@jirfag jirfag closed this as completed Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants