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

execution error with go 1.20 #3549

Closed
4 tasks done
danteay opened this issue Feb 2, 2023 · 2 comments
Closed
4 tasks done

execution error with go 1.20 #3549

danteay opened this issue Feb 2, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@danteay
Copy link

danteay commented Feb 2, 2023

Welcome

  • 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.).
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.). (https://golangci-lint.run/usage/linters/)

Description of the problem

As Go 1.20 was just released golangci-lint get stuck and overload CPU

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version 1.50.1 built from 8926a95 on 2022-10-22T10:48:48Z

Configuration file

$ cat .golangci.yml
run:
  timeout: 5m
  skip-files:
    - generated.*
    - mage.*

linters:
  enable:
    - asciicheck
    - depguard
    - gocritic
    - gofmt
    - goimports
    - goprintffuncname
    - gosimple
    - govet
    - ineffassign
    - misspell
    - staticcheck
    - stylecheck
    - typecheck
    - unconvert
    - unused
    - whitespace
    - errcheck
  disable:
    - unparam
    - bodyclose
    - structcheck
    - rowserrcheck

Go environment

$ go version && go env
go version go1.20 darwin/arm64
GO111MODULE="on"
GOARCH="arm64"
GOBIN="/Users/eduardoay/go/bin"
GOCACHE="/Users/eduardoay/Library/Caches/go-build"
GOENV="/Users/eduardoay/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/eduardoay/go/pkg/mod"
GONOPROXY="github.com/Drafteame"
GONOSUMDB="github.com/Drafteame"
GOOS="darwin"
GOPATH="/Users/eduardoay/go"
GOPRIVATE="github.com/Drafteame"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/eduardoay/apps/draftea/game-engine/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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3c/1g85bc_j7tz32fhy_g9lfstw0000gn/T/go-build216042722=/tmp/go-build -gno-record-gcc-switches -fno-common"

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /Users/eduardoay/apps/draftea/inject /Users/eduardoay/apps/draftea /Users/eduardoay/apps /Users/eduardoay /Users /] 
INFO [lintersdb] Active 7 linters: [errcheck gosimple govet ineffassign staticcheck typecheck unused] 
INFO [loader] Go packages loading at mode 575 (types_sizes|compiled_files|deps|name|exports_file|files|imports) took 355.273542ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 1.86ms 
INFO [linters_context/goanalysis] analyzers took 5.901635856s with top 10 stages: SA5012: 275.852662ms, typedness: 214.856329ms, fact_purity: 211.397616ms, nilness: 196.082582ms, S1029: 142.152542ms, SA4023: 126.486333ms, SA4005: 116.297377ms, SA4017: 114.543335ms, SA4015: 103.070207ms, SA1028: 98.138167ms 
INFO [runner/max_same_issues] 39/42 issues with text "e.WriteByte undefined (type *encodeState has no field or method WriteByte)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 25/28 issues with text "e.WriteString undefined (type *encodeState has no field or method WriteString)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 18/21 issues with text "inst.Out undefined (type *onePassInst has no field or method Out)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 10/13 issues with text "String not declared by package unsafe" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 6/9 issues with text "e.Write undefined (type *encodeState has no field or method Write)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 5/8 issues with text "StringData not declared by package unsafe" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 4/7 issues with text "inst.Rune undefined (type *onePassInst has no field or method Rune)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 4/7 issues with text "inst.Arg undefined (type *onePassInst has no field or method Arg)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 3/6 issues with text "dc.Unlock undefined (type *driverConn has no field or method Unlock)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 3/6 issues with text "inst.Op undefined (type *onePassInst has no field or method Op)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 2/5 issues with text "c.out.Unlock undefined (type halfConn has no field or method Unlock)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 2/5 issues with text "missing return" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 2/5 issues with text "invalid operation: cannot compare r.Body == nil (operator == not defined on untyped nil)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 2/5 issues with text "c.out.Lock undefined (type halfConn has no field or method Lock)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 2/5 issues with text "invalid operation: cannot compare req.Body == nil (operator == not defined on untyped nil)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 2/5 issues with text "dc.Lock undefined (type *driverConn has no field or method Lock)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 1/4 issues with text "zoneCache.RUnlock undefined (type ipv6ZoneCache has no field or method RUnlock)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 1/4 issues with text "zoneCache.RLock undefined (type ipv6ZoneCache has no field or method RLock)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 1/4 issues with text "invalid operation: cannot compare r.Form == nil (operator == not defined on untyped nil)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 1/4 issues with text "rs.dc.Unlock undefined (type *driverConn has no field or method Unlock)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 1/4 issues with text "rs.dc.Lock undefined (type *driverConn has no field or method Lock)" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 1/4 issues with text "invalid operation: cannot compare r.PostForm == nil (operator == not defined on untyped nil)" were hidden, use --max-same-issues 
INFO [runner/max_from_linter] 156/206 issues from linter typecheck were hidden, use --max-issues-per-linter 
INFO [runner] Issues before processing: 14493, after processing: 50 
INFO [runner] Processors filtering stat (out/in): skip_dirs: 14493/14493, nolint: 14493/14493, source_code: 50/50, path_prefixer: 50/50, filename_unadjuster: 14493/14493, identifier_marker: 14493/14493, max_per_file_from_linter: 341/341, sort_results: 50/50, cgo: 14493/14493, skip_files: 14493/14493, exclude: 14493/14493, uniq_by_line: 341/14493, severity-rules: 50/50, path_prettifier: 14493/14493, autogenerated_exclude: 14493/14493, exclude-rules: 14493/14493, diff: 341/341, max_same_issues: 206/341, max_from_linter: 50/206, path_shortener: 50/50 
INFO [runner] processing took 298.82429ms with stages: exclude-rules: 155.603292ms, identifier_marker: 93.203334ms, nolint: 39.534332ms, path_prettifier: 5.1205ms, skip_dirs: 2.254ms, cgo: 628.833µs, max_same_issues: 605.25µs, source_code: 520.376µs, filename_unadjuster: 490.583µs, autogenerated_exclude: 479.75µs, uniq_by_line: 357.374µs, max_per_file_from_linter: 12.667µs, max_from_linter: 7.375µs, path_shortener: 5.375µs, sort_results: 292ns, diff: 250ns, skip_files: 208ns, exclude: 208ns, severity-rules: 208ns, path_prefixer: 83ns 
INFO [runner] linters took 1.127317584s with stages: goanalysis_metalinter: 828.308916ms 
dependency/mocks/builder.go:14:12: _m.Called undefined (type *Builder has no field or method Called) (typecheck)
        ret := _m.Called()
                  ^
dependency/mocks/builder.go:45:26: mock.AssertExpectations undefined (type *Builder has no field or method AssertExpectations) (typecheck)
        t.Cleanup(func() { mock.AssertExpectations(t) })
                                ^
dependency/mocks/container.go:17:12: _m.Called undefined (type *Container has no field or method Called) (typecheck)
        ret := _m.Called(name)
                  ^
dependency/mocks/container.go:48:26: mock.AssertExpectations undefined (type *Container has no field or method AssertExpectations) (typecheck)
        t.Cleanup(func() { mock.AssertExpectations(t) })
                                ^
../../../../../usr/local/go/src/runtime/debuglog.go:296:20: StringData not declared by package unsafe (typecheck)
        strData := unsafe.StringData(x)
                          ^
../../../../../usr/local/go/src/runtime/heapdump.go:159:37: StringData not declared by package unsafe (typecheck)
        dumpmemrange(unsafe.Pointer(unsafe.StringData(s)), uintptr(len(s)))
                                           ^
../../../../../usr/local/go/src/runtime/heapdump.go:202:32: StringData not declared by package unsafe (typecheck)
                dwrite(unsafe.Pointer(unsafe.StringData(pkgpath)), uintptr(len(pkgpath)))
                                             ^
../../../../../usr/local/go/src/runtime/proc.go:658:16: String not declared by package unsafe (typecheck)
                        s := unsafe.String(p, findnull(p))
                                    ^
../../../../../usr/local/go/src/runtime/string.go:105:17: String not declared by package unsafe (typecheck)
                return unsafe.String((*byte)(p), 1)
                              ^
../../../../../usr/local/go/src/runtime/string.go:115:16: String not declared by package unsafe (typecheck)
        return unsafe.String((*byte)(p), n)
                      ^
../../../../../usr/local/go/src/internal/fmtsort/sort.go:182:1: missing return (typecheck)
}
^
../../../../../usr/local/go/src/io/pipe.go:22:4: a.Lock undefined (type *onceError has no field or method Lock) (typecheck)
        a.Lock()
          ^
../../../../../usr/local/go/src/io/pipe.go:23:10: a.Unlock undefined (type *onceError has no field or method Unlock) (typecheck)
        defer a.Unlock()
                ^
../../../../../usr/local/go/src/io/pipe.go:30:4: a.Lock undefined (type *onceError has no field or method Lock) (typecheck)
        a.Lock()
          ^
../../../../../usr/local/go/src/io/pipe.go:31:10: a.Unlock undefined (type *onceError has no field or method Unlock) (typecheck)
        defer a.Unlock()
                ^
../../../../../usr/local/go/src/os/file_unix.go:416:15: invalid operation: cannot compare d.info != nil (operator != not defined on untyped nil) (typecheck)
        if d.info != nil {
                     ^
../../../../../usr/local/go/src/syscall/syscall_unix.go:63:4: m.Lock undefined (type *mmapper has no field or method Lock) (typecheck)
        m.Lock()
          ^
../../../../../usr/local/go/src/syscall/syscall_unix.go:64:10: m.Unlock undefined (type *mmapper has no field or method Unlock) (typecheck)
        defer m.Unlock()
                ^
../../../../../usr/local/go/src/syscall/syscall_unix.go:76:4: m.Lock undefined (type *mmapper has no field or method Lock) (typecheck)
        m.Lock()
          ^
../../../../../usr/local/go/src/syscall/syscall_unix.go:77:10: m.Unlock undefined (type *mmapper has no field or method Unlock) (typecheck)
        defer m.Unlock()
                ^
../../../go/pkg/mod/github.com/stretchr/[email protected]/mock/mock.go:296:19: invalid operation: cannot compare m.testData == nil (operator == not defined on untyped nil) (typecheck)
        if m.testData == nil {
                         ^
../../../go/pkg/mod/github.com/stretchr/[email protected]/mock/mock.go:991:1: missing return (typecheck)
}
^
../../../../../usr/local/go/src/regexp/exec.go:78:26: invalid operation: cannot compare i.reader.r != nil (operator != not defined on untyped nil) (typecheck)
        } else if i.reader.r != nil {
                                ^
../../../../../usr/local/go/src/regexp/exec.go:432:48: inst.Arg undefined (type *onePassInst has no field or method Arg) (typecheck)
        if pos == 0 && flag.match(syntax.EmptyOp(inst.Arg)) &&
                                                      ^
../../../../../usr/local/go/src/regexp/exec.go:446:17: inst.Out undefined (type *onePassInst has no field or method Out) (typecheck)
                pc = int(inst.Out)
                              ^
../../../../../usr/local/go/src/regexp/exec.go:447:15: inst.Op undefined (type *onePassInst has no field or method Op) (typecheck)
                switch inst.Op {
                            ^
../../../../../usr/local/go/src/regexp/exec.go:458:13: inst.MatchRune undefined (type *onePassInst has no field or method MatchRune) (typecheck)
                        if !inst.MatchRune(r) {
                                 ^
../../../../../usr/local/go/src/regexp/exec.go:462:17: inst.Rune undefined (type *onePassInst has no field or method Rune) (typecheck)
                        if r != inst.Rune[0] {
                                     ^
../../../../../usr/local/go/src/regexp/exec.go:480:39: inst.Arg undefined (type *onePassInst has no field or method Arg) (typecheck)
                        if !flag.match(syntax.EmptyOp(inst.Arg)) {
                                                           ^
../../../../../usr/local/go/src/regexp/exec.go:485:16: inst.Arg undefined (type *onePassInst has no field or method Arg) (typecheck)
                        if int(inst.Arg) < len(m.matchcap) {
                                    ^
../../../../../usr/local/go/src/regexp/onepass.go:76:12: i.MatchRunePos undefined (type *onePassInst has no field or method MatchRunePos) (typecheck)
        next := i.MatchRunePos(r)
                  ^
../../../../../usr/local/go/src/regexp/onepass.go:80:7: i.Op undefined (type *onePassInst has no field or method Op) (typecheck)
        if i.Op == syntax.InstAltMatch {
             ^
../../../../../usr/local/go/src/regexp/onepass.go:81:12: i.Out undefined (type *onePassInst has no field or method Out) (typecheck)
                return i.Out
                         ^
../../../../../usr/local/go/src/regexp/onepass.go:238:21: p.Inst[pc].Op undefined (type onePassInst has no field or method Op) (typecheck)
                switch p.Inst[pc].Op {
                                  ^
../../../../../usr/local/go/src/regexp/onepass.go:243:29: p.Inst[pc].Out undefined (type onePassInst has no field or method Out) (typecheck)
                        p_A_Other := &p.Inst[pc].Out
                                                 ^
../../../../../usr/local/go/src/regexp/onepass.go:244:27: p.Inst[pc].Arg undefined (type onePassInst has no field or method Arg) (typecheck)
                        p_A_Alt := &p.Inst[pc].Arg
                                               ^
../../../../../usr/local/go/src/regexp/onepass.go:247:17: instAlt.Op undefined (type onePassInst has no field or method Op) (typecheck)
                        if !(instAlt.Op == syntax.InstAlt || instAlt.Op == syntax.InstAltMatch) {
                                     ^
../../../../../usr/local/go/src/regexp/onepass.go:250:18: instAlt.Op undefined (type onePassInst has no field or method Op) (typecheck)
                                if !(instAlt.Op == syntax.InstAlt || instAlt.Op == syntax.InstAltMatch) {
                                             ^
../../../../../usr/local/go/src/regexp/onepass.go:256:17: instOther.Op undefined (type onePassInst has no field or method Op) (typecheck)
                        if instOther.Op == syntax.InstAlt || instOther.Op == syntax.InstAltMatch {
                                     ^
../../../../../usr/local/go/src/regexp/onepass.go:262:33: p.Inst[*p_A_Alt].Out undefined (type onePassInst has no field or method Out) (typecheck)
                        p_B_Alt := &p.Inst[*p_A_Alt].Out
                                                     ^
../../../../../usr/local/go/src/regexp/onepass.go:263:35: p.Inst[*p_A_Alt].Arg undefined (type onePassInst has no field or method Arg) (typecheck)
                        p_B_Other := &p.Inst[*p_A_Alt].Arg
                                                       ^
../../../../../usr/local/go/src/regexp/onepass.go:265:15: instAlt.Out undefined (type onePassInst has no field or method Out) (typecheck)
                        if instAlt.Out == uint32(pc) {
                                   ^
../../../../../usr/local/go/src/regexp/onepass.go:267:22: instAlt.Arg undefined (type onePassInst has no field or method Arg) (typecheck)
                        } else if instAlt.Arg == uint32(pc) {
                                          ^
../../../../../usr/local/go/src/regexp/onepass.go:322:15: inst.Op undefined (type *onePassInst has no field or method Op) (typecheck)
                switch inst.Op {
                            ^
../../../../../usr/local/go/src/regexp/onepass.go:324:20: inst.Out undefined (type *onePassInst has no field or method Out) (typecheck)
                        ok = check(inst.Out, m) && check(inst.Arg, m)
                                        ^
../../../../../usr/local/go/src/regexp/onepass.go:326:23: inst.Out undefined (type *onePassInst has no field or method Out) (typecheck)
                        matchOut := m[inst.Out]
                                           ^
../../../../../usr/local/go/src/regexp/onepass.go:339:10: inst.Op undefined (type *onePassInst has no field or method Op) (typecheck)
                                inst.Op = syntax.InstAltMatch
                                     ^
../../../../../usr/local/go/src/regexp/onepass.go:374:16: inst.Rune undefined (type *onePassInst has no field or method Rune) (typecheck)
                        if len(inst.Rune) == 0 {
                                    ^
../../../../../usr/local/go/src/regexp/onepass.go:380:16: inst.Rune undefined (type *onePassInst has no field or method Rune) (typecheck)
                        if len(inst.Rune) == 1 && syntax.Flags(inst.Arg)&syntax.FoldCase != 0 {
                                    ^
../../../../../usr/local/go/src/regexp/onepass.go:456:14: p.Inst[i].Rune undefined (type onePassInst has no field or method Rune) (typecheck)
                        p.Inst[i].Rune = onePassRunes[i]
                                  ^
INFO File cache stats: 13 entries of total size 325.5KiB 
INFO Memory: 16 samples, avg is 926.8MB, max is 2340.7MB 
INFO Execution took 1.49712375s   

Code example or link to a public repository

https://github.com/Drafteame/inject
@danteay danteay added the bug Something isn't working label Feb 2, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 2, 2023

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

@ldez
Copy link
Member

ldez commented Feb 2, 2023

duplicate of #3538, #3536, #3535, #3533, #3470

@ldez ldez closed this as completed Feb 2, 2023
@ldez ldez added duplicate This issue or pull request already exists and removed bug Something isn't working labels Feb 2, 2023
@golangci golangci locked and limited conversation to collaborators Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants