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

gosimple + go 1.23 consume all available RAM #4908

Closed
6 of 7 tasks
olegrok opened this issue Aug 14, 2024 · 3 comments
Closed
6 of 7 tasks

gosimple + go 1.23 consume all available RAM #4908

olegrok opened this issue Aug 14, 2024 · 3 comments
Labels
question Further information is requested

Comments

@olegrok
Copy link

olegrok commented Aug 14, 2024

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

Description of the problem

It is quite inadequate to use more than 60 GB of RAM.

изображение

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version 1.60.1 built with go1.22.5 from v1.60.1 on 19700101-00:00:00

Configuration

golangci-lint run -j 4 -v --go 1.23 --enable-only gosimple

Go environment

$ go version && go env
go version go1.23.0 linux/amd64
GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='/tmp/sha256-PObLD2gU7qm3qL3G4JqrBtqTw5i08ab+oNSM+GAQu60=/go-cache'
GOENV='/home/oleg/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS='-modcacherw -mod=vendor -trimpath'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/tmp/sha256-PObLD2gU7qm3qL3G4JqrBtqTw5i08ab+oNSM+GAQu60=/go/mod/cache'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/tmp/nix-shell.S8T84v/go'
GOPRIVATE=''
GOPROXY='off'
GOROOT='/nix/store/0k144pnsvy0wa3dcl1y3df7d4zskylc4-go-1.23.0/share/go'
GOSUMDB='off'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/nix/store/0k144pnsvy0wa3dcl1y3df7d4zskylc4-go-1.23.0/share/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.0'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/oleg/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/home/oleg/Projects/toy-cluster/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/nix-shell.S8T84v/go-build1273801823=/tmp/go-build -gno-record-gcc-switches'

Verbose output of running

golangci-lint run -j 4 -v --go 1.23 --enable-only gosimple
INFO golangci-lint has version 1.60.1 built with go1.22.5 from v1.60.1 on 19700101-00:00:00 
INFO [config_reader] Config search paths: [./ /home/oleg/Projects/toy-cluster /home/oleg/Projects /home/oleg /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 1 linters: [gosimple]     
INFO [loader] Using build tags: [test]            
INFO [loader] Go packages loading at mode 575 (types_sizes|compiled_files|exports_file|imports|deps|files|name) took 1.697405389s 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 14.087863ms 
INFO Memory: 577 samples, avg is 18567.3MB, max is 34902.9MB 
INFO Execution took 1m0.053878382s                
Killed

A minimal reproducible example or link to a public repository

I run linter over my private project

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

@olegrok olegrok added the bug Something isn't working label Aug 14, 2024
Copy link

boring-cyborg bot commented Aug 14, 2024

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@olegrok
Copy link
Author

olegrok commented Aug 14, 2024

I have the same story with govet, staticcheck:

(nix:nil-env) oleg@pop-os:~/Projects/toy-cluster$ golangci-lint run -j 4 -v --go 1.23 --enable-only govet   
INFO golangci-lint has version 1.60.1 built with go1.22.5 from v1.60.1 on 19700101-00:00:00 
INFO [config_reader] Config search paths: [./ /home/oleg/Projects/toy-cluster /home/oleg/Projects /home/oleg /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 1 linters: [govet]        
INFO [loader] Using build tags: [test]            
INFO [loader] Go packages loading at mode 575 (name|compiled_files|exports_file|files|imports|types_sizes|deps) took 679.035264ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 16.054009ms 
^C
(nix:nil-env) oleg@pop-os:~/Projects/toy-cluster$ golangci-lint run -j 4 -v --go 1.23 --enable-only ineffassign
INFO golangci-lint has version 1.60.1 built with go1.22.5 from v1.60.1 on 19700101-00:00:00 
INFO [config_reader] Config search paths: [./ /home/oleg/Projects/toy-cluster /home/oleg/Projects /home/oleg /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 1 linters: [ineffassign]  
INFO [loader] Using build tags: [test]            
INFO [loader] Go packages loading at mode 7 (compiled_files|name|files) took 844.743252ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 15.391253ms 
INFO [linters_context/goanalysis] analyzers took 13.58796ms with top 10 stages: ineffassign: 13.47511ms, typecheck: 112.85µs 
INFO [runner] processing took 1.599µs with stages: max_same_issues: 342ns, skip_dirs: 236ns, identifier_marker: 127ns, filename_unadjuster: 106ns, cgo: 99ns, exclude-rules: 99ns, skip_files: 90ns, invalid_issue: 87ns, nolint: 45ns, max_from_linter: 45ns, source_code: 29ns, fixer: 29ns, sort_results: 28ns, path_shortener: 28ns, path_prefixer: 27ns, path_prettifier: 27ns, diff: 26ns, max_per_file_from_linter: 26ns, autogenerated_exclude: 26ns, exclude: 26ns, uniq_by_line: 26ns, severity-rules: 25ns 
INFO [runner] linters took 27.391897ms with stages: goanalysis_metalinter: 27.3628ms 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 10 samples, avg is 28.2MB, max is 43.0MB 
INFO Execution took 890.860109ms                  
(nix:nil-env) oleg@pop-os:~/Projects/toy-cluster$ golangci-lint run -j 4 -v --go 1.23 --enable-only ineffassign
INFO golangci-lint has version 1.60.1 built with go1.22.5 from v1.60.1 on 19700101-00:00:00 
INFO [config_reader] Config search paths: [./ /home/oleg/Projects/toy-cluster /home/oleg/Projects /home/oleg /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 1 linters: [ineffassign]  
INFO [loader] Using build tags: [test]            
INFO [loader] Go packages loading at mode 7 (name|compiled_files|files) took 892.19424ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 21.31641ms 
INFO [linters_context/goanalysis] analyzers took 0s with no stages 
INFO [runner] processing took 1.457µs with stages: max_same_issues: 261ns, exclude-rules: 244ns, cgo: 98ns, identifier_marker: 88ns, source_code: 88ns, path_prettifier: 86ns, invalid_issue: 84ns, autogenerated_exclude: 74ns, skip_dirs: 55ns, max_from_linter: 43ns, nolint: 42ns, filename_unadjuster: 40ns, path_shortener: 27ns, sort_results: 26ns, skip_files: 26ns, diff: 26ns, max_per_file_from_linter: 25ns, fixer: 25ns, severity-rules: 25ns, path_prefixer: 25ns, exclude: 25ns, uniq_by_line: 24ns 
INFO [runner] linters took 3.33798ms with stages: goanalysis_metalinter: 3.320434ms 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 11 samples, avg is 28.1MB, max is 39.3MB 
INFO Execution took 920.73805ms                   
(nix:nil-env) oleg@pop-os:~/Projects/toy-cluster$ golangci-lint run -j 4 -v --go 1.23 --enable-only staticcheck
INFO golangci-lint has version 1.60.1 built with go1.22.5 from v1.60.1 on 19700101-00:00:00 
INFO [config_reader] Config search paths: [./ /home/oleg/Projects/toy-cluster /home/oleg/Projects /home/oleg /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 1 linters: [staticcheck]  
INFO [loader] Using build tags: [test]            
INFO [loader] Go packages loading at mode 575 (files|imports|types_sizes|compiled_files|deps|exports_file|name) took 881.479872ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 11.203462ms 
^C
(nix:nil-env) oleg@pop-os:~/Projects/toy-cluster$ golangci-lint run -j 4 -v --go 1.23 --enable-only unused     
INFO golangci-lint has version 1.60.1 built with go1.22.5 from v1.60.1 on 19700101-00:00:00 
INFO [config_reader] Config search paths: [./ /home/oleg/Projects/toy-cluster /home/oleg/Projects /home/oleg /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 1 linters: [unused]       
INFO [loader] Using build tags: [test]            
INFO [loader] Go packages loading at mode 575 (deps|imports|name|types_sizes|compiled_files|exports_file|files) took 981.796679ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 15.09607ms 
INFO [linters_context/goanalysis] analyzers took 132.992512ms with top 10 stages: unused: 105.748999ms, directives: 22.437547ms, isgenerated: 4.581738ms, typecheck: 224.228µs 
INFO [runner] Issues before processing: 5, after processing: 0 
INFO [runner] Processors filtering stat (in/out): invalid_issue: 5/5, skip_files: 5/5, nolint: 5/0, path_prettifier: 5/5, skip_dirs: 5/5, autogenerated_exclude: 5/5, identifier_marker: 5/5, exclude-rules: 5/5, cgo: 5/5, exclude: 5/5, filename_unadjuster: 5/5 
INFO [runner] processing took 353.262µs with stages: nolint: 226.286µs, exclude-rules: 50.642µs, identifier_marker: 29.267µs, skip_dirs: 21.976µs, autogenerated_exclude: 10.487µs, path_prettifier: 10.238µs, invalid_issue: 1.58µs, cgo: 730ns, filename_unadjuster: 349ns, max_same_issues: 249ns, sort_results: 192ns, fixer: 189ns, max_from_linter: 165ns, uniq_by_line: 156ns, skip_files: 155ns, exclude: 153ns, source_code: 110ns, diff: 77ns, max_per_file_from_linter: 71ns, path_prefixer: 66ns, path_shortener: 64ns, severity-rules: 60ns 
INFO [runner] linters took 242.775106ms with stages: goanalysis_metalinter: 242.390594ms 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 14 samples, avg is 62.5MB, max is 238.9MB 
INFO Execution took 1.245005918s

@ldez ldez added question Further information is requested and removed bug Something isn't working labels Aug 14, 2024
@ldez
Copy link
Member

ldez commented Aug 14, 2024

You are using golangci-lint built with go1.22.5 to analyze go1.23 code, this cannot work.

You should use go1.23 to compile it.

Related to #4837

Duplicate of #4874, #4909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants