Skip to content

nil pointer dereference #622

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

Closed
yaches opened this issue Jul 22, 2019 · 5 comments
Closed

nil pointer dereference #622

yaches opened this issue Jul 22, 2019 · 5 comments

Comments

@yaches
Copy link

yaches commented Jul 22, 2019

Running linter in gilab ci
golangci-lint:v1.17
go 1.12

err log:

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

goroutine 3142 [running]:
github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose.(*runner).run(0xc0000bcc40, 0xc0231add60, 0x10, 0xd1d9e0, 0x1d7, 0x1d8)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose/bodyclose.go:57 +0x1af
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.(*action).execOnce(0xc01c98a8c0)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:382 +0x68a
sync.(*Once).Do(0xc01c98a8c0, 0xc0003fc790)
	/home/travis/.gimme/versions/go1.12.5.linux.amd64/src/sync/once.go:44 +0xb3
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.(*action).exec(0xc01c98a8c0)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:303 +0x50
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll.func1(0xc01c98a8c0)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:291 +0x34
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:297 +0x11b
Makefile:56: recipe for target 'lint' failed
make: *** [lint] Error 2

.golangci.yml:

linters:
  enable-all: true
  disable:
    # Globals are OK
    - gochecknoglobals
    # So are inits
    - gochecknoinits
    # Cant disable some of go vet checks => disable all of them
    - govet
    # Useless
    - interfacer
    # Long lines are fine
    - lll
    # Using "weak" primitivies is fine when they're not used for crypto
    - gosec

run:
  tests: false
  issues-exit-code: 0
  skip-dirs:
    - vendor/
  skip-files:
    - _test.go
@ghost
Copy link

ghost commented Jul 22, 2019 via email

@TheHackerDev
Copy link

I'm getting this same nil pointer dereference. My stack trace is below.

OSX version 10.14.5
go version go1.12.7 darwin/amd64
golangci-lint has version 1.17.1 built from 4ba2155 on 2019-06-10T09:07:35Z

/usr/local/bin/golangci-lint run -c .golangci.yml ./...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1598484]

goroutine 1835 [running]:
go/types.(*object).Name(...)
	/home/travis/.gimme/versions/go1.12.5.linux.amd64/src/go/types/object.go:134
github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose.(*runner).isCloseCall(0xc00009e2c0, 0x1be0ea0, 0xc00798b700, 0xc0068132c0)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose/bodyclose.go:230 +0x234
github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose.(*runner).isopen(0xc00009e2c0, 0xc014b1f760, 0x9, 0xc01169dd00)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose/bodyclose.go:175 +0x2e9
github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose.(*runner).run(0xc00009e2c0, 0xc0000cbd60, 0x10, 0x191fec0, 0x4af2d33feb6c8001, 0xc012290720)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/vendor/github.com/timakin/bodyclose/passes/bodyclose/bodyclose.go:100 +0x641
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.(*action).execOnce(0xc00041d720)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:382 +0x68a
sync.(*Once).Do(0xc00041d720, 0xc000a83790)
	/home/travis/.gimme/versions/go1.12.5.linux.amd64/src/sync/once.go:44 +0xb3
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.(*action).exec(0xc00041d720)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:303 +0x50
github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll.func1(0xc00041d720)
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:291 +0x34
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker.execAll
	/home/travis/gopath/src/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/checker/checker.go:297 +0x11b

Process finished with exit code 2

@TheHackerDev
Copy link

I just noticed that this is also found in #608 too, so we should probably collect the issue in one spot. I'll be copying over my last comment with error details to there as well.

@Helcaraxan
Copy link
Contributor

Community suggestion: to help things as clear as possible for when the project picks up again it might be useful to close your issue as it seems the discussion has been transferred to the duplicate issue. 🙂

Based on my experience with GH issue curation this will literally save hours of maintainer time.

@jirfag
Copy link
Contributor

jirfag commented Sep 10, 2019

Hi, thank you for the issue and sorry for the slow response. Both of stack traces were fixed in the latest release v1.18.0.

If somehow panics continue to occur - let's continue the discussion in #608

@jirfag jirfag closed this as completed Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants