Skip to content

Increased memory usage in 1.24.0 causing out-of-memory #994

Closed
@invidian

Description

@invidian

It seems that after upgrading golangci-lint for my project to 1.24.0, Travis CI is no longer able to lint the project, as it fails with out-of-memory errors: https://travis-ci.org/github/flexkube/libflexkube/jobs/662847029#L1086

After reverting the same PR to 1.23.8, linting passes: https://travis-ci.org/github/flexkube/libflexkube/jobs/662848310?utm_medium=notification&utm_source=github_status.

PR affected by the issue: flexkube/libflexkube#82

Offending patch (now reverted):

diff --git Makefile Makefile
index bb0b33c..caa47b4 100644
--- Makefile
+++ Makefile
@@ -11,7 +11,7 @@ GORUN=$(GOCMD) run
 GOBUILD=CGO_ENABLED=$(CGO_ENABLED) $(GOCMD) build -v -buildmode=exe -ldflags $(LD_FLAGS)
 
 CC_TEST_REPORTER_ID=6e107e510c5479f40b0ce9166a254f3f1ee0bc547b3e48281bada1a5a32bb56d
-GOLANGCI_LINT_VERSION=v1.23.8
+GOLANGCI_LINT_VERSION=v1.24.0
 BIN_PATH=$$HOME/bin
 
 GO_PACKAGES=./...

Thank you for creating the issue!

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.24.0 built from 6fd4383 on 2020-03-15T11:38:02Z
Config file
$ cat .golangci.yml
cat: .golangci.yml: No such file or directory```

</details>

<details><summary>Go environment</summary>

```console
$ go version && go env
go version go1.14 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/invidian/.cache/go-build"
GOENV="/home/invidian/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/invidian/go"
GOPRIVATE=""
GOPROXY="http://localhost:8081,https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/invidian/repos/libflexkube/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build666784723=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint run --enable-all --disable=godox,lll,funlen --max-same-issues=0 --max-issues-per-linter=0 --build-tags integration --timeout 10m --exclude-use-default=false ./... -v
INFO [config_reader] Config search paths: [./ /home/invidian/repos/libflexkube/integration /home/invidian/repos/libflexkube /home/invidian/repos /home/invidian /home /] 
INFO [lintersdb] Active 38 linters: [bodyclose deadcode depguard dogsled dupl errcheck gochecknoglobals gochecknoinits gocognit goconst gocritic gocyclo gofmt goimports golint gomnd goprintffuncname gosec gosimple govet ineffassign interfacer maligned misspell nakedret prealloc rowserrcheck scopelint staticcheck structcheck stylecheck typecheck unconvert unparam unused varcheck whitespace wsl] 
INFO [lintersdb] Active 38 linters: [bodyclose deadcode depguard dogsled dupl errcheck gochecknoglobals gochecknoinits gocognit goconst gocritic gocyclo gofmt goimports golint gomnd goprintffuncname gosec gosimple govet ineffassign interfacer maligned misspell nakedret prealloc rowserrcheck scopelint staticcheck structcheck stylecheck typecheck unconvert unparam unused varcheck whitespace wsl] 
INFO [loader] Go packages loading at mode 575 (compiled_files|exports_file|files|imports|name|deps|types_sizes) took 607.943833ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 5.466128ms 
INFO [runner/unused/goanalysis] analyzers took 0s with no stages 
INFO [runner/goanalysis_metalinter/goanalysis] analyzers took 0s with no stages 
INFO [runner] Issues before processing: 12, after processing: 0 
INFO [runner] Processors filtering stat (out/in): filename_unadjuster: 12/12, path_prettifier: 12/12, skip_files: 12/12, autogenerated_exclude: 12/12, exclude-rules: 12/12, nolint: 0/12, skip_dirs: 12/12, cgo: 12/12, identifier_marker: 12/12, exclude: 12/12 
INFO [runner] processing took 6.995723ms with stages: nolint: 6.544171ms, identifier_marker: 206.175µs, path_prettifier: 120.378µs, autogenerated_exclude: 65.971µs, skip_dirs: 44.667µs, cgo: 4.006µs, max_same_issues: 3.183µs, uniq_by_line: 1.573µs, filename_unadjuster: 1.453µs, max_from_linter: 1.038µs, diff: 984ns, skip_files: 677ns, source_code: 435ns, path_shortener: 415ns, max_per_file_from_linter: 225ns, exclude: 198ns, exclude-rules: 174ns 
INFO [runner] linters took 238.006384ms with stages: unused: 219.300356ms, goanalysis_metalinter: 11.516494ms 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 10 samples, avg is 91.3MB, max is 138.3MB 
INFO Execution took 858.2966ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    cursedThis issue is doomed.topic: memoryHuge memory consumption

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions