Skip to content

intrange causing panic #4629

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
5 tasks done
koblas opened this issue Apr 9, 2024 · 4 comments
Closed
5 tasks done

intrange causing panic #4629

koblas opened this issue Apr 9, 2024 · 4 comments
Labels
bug Something isn't working dependencies Relates to an upstream dependency

Comments

@koblas
Copy link

koblas commented Apr 9, 2024

Welcome

Description of the problem

https://github.com/ckaznocha/intrange should be updated to the 0.1.2 version

Currently experiencing a crash that mirrors the 0.1.1 -> 0.1.2 fix.

ckaznocha/intrange#16

Version of golangci-lint

$ golangci-lint --version
# Paste output here

Configuration

golangci-lint has version 1.57.2 built with go1.22.1 from 77a8601 on 2024-03-28T18:39:06Z

Go environment

go version go1.22.2 darwin/arm64
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/koblas/Library/Caches/go-build'
GOENV='/Users/koblas/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/koblas/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/koblas/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.2/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/koblas/repos/github.com/koblas/content_buddy/go/go.mod'
GOWORK='/Users/koblas/repos/github.com/koblas/content_buddy/go.work'
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 -ffile-prefix-map=/var/folders/jv/51g_1pw53kn_29p1s2z22h8c0000gn/T/go-build620875179=/tmp/go-build -gno-record-gcc-switches -fno-common'```

</details>

### Verbose output of running

<details>

```console

INFO [config_reader] Config search paths: [./ /Users/koblas/repos/github.com/koblas/content_buddy/go /Users/koblas/repos/github.com/koblas/content_buddy /Users/koblas/repos/github.com/koblas /Users/koblas/repos/github.com /Users/koblas/repos /Users/koblas /Users /] 
INFO [config_reader] Used config file .golangci.yaml 
INFO [lintersdb] Active 83 linters: [asasalint asciicheck bidichk bodyclose containedctx contextcheck copyloopvar decorder dogsled dupword durationcheck errcheck errchkjson errname errorlint execinquery exhaustive exportloopref forbidigo gci ginkgolinter gocheckcompilerdirectives gochecksumtype gocritic godot goerr113 gofmt gofumpt goheader goimports gomoddirectives gomodguard goprintffuncname gosec gosimple gosmopolitan govet grouper importas inamedparam ineffassign interfacebloat intrange lll loggercheck maintidx makezero mirror misspell musttag nakedret nilerr nilnil noctx nolintlint nonamedreturns nosprintfhostport perfsprint prealloc predeclared promlinter reassign revive rowserrcheck sloglint spancheck sqlclosecheck staticcheck stylecheck tagalign tenv testableexamples testifylint thelper tparallel unconvert unparam unused usestdlibvars wastedassign whitespace wrapcheck zerologlint] 
INFO [loader] Go packages loading at mode 575 (imports|types_sizes|compiled_files|deps|exports_file|files|name) took 465.947208ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 15.14925ms 
INFO [linters_context] importas settings found, but no aliases listed. List aliases under alias: key. 
INFO [linters_context/goanalysis] analyzers took 6m42.822309227s with top 10 stages: buildir: 51.664308337s, buildssa: 16.762798544s, wastedassign: 16.085580743s, the_only_name: 13.272174117s, bidichk: 7.433157408s, musttag: 6.062694963s, exhaustive: 5.546524407s, unconvert: 4.762067668s, unparam: 4.41060488s, printf: 4.266245959s 
ERRO [runner] Panic: intrange: package "confmgr" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: ast.Expr is *ast.SelectorExpr, not *ast.Ident: goroutine 32161 [running]:
runtime/debug.Stack()
        runtime/debug/stack.go:24 +0x64
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe.func1()
        github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:108 +0x214
panic({0x103add240?, 0x1406cde1ad0?})
        runtime/panic.go:770 +0x124
github.com/ckaznocha/intrange.findNExpr({0x103c59608?, 0x1403ca5a8c0?})
        github.com/ckaznocha/[email protected]/intrange.go:237 +0x1a0
github.com/ckaznocha/intrange.run.check.func1({0x103c55450?, 0x1403ca5b000})
        github.com/ckaznocha/[email protected]/intrange.go:95 +0x1c4
golang.org/x/tools/go/ast/inspector.(*Inspector).Preorder(0x1406914da70, {0x140463d7c78?, 0x1044bfd40?, 0x14002ec59e0?}, 0x14045243c68)
        golang.org/x/[email protected]/go/ast/inspector/inspector.go:82 +0x90
github.com/ckaznocha/intrange.run(0x1406d93b450)
        github.com/ckaznocha/[email protected]/intrange.go:47 +0x124
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyze(0x14004f3b500)
        github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:190 +0x8c4
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe.func2()
        github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:112 +0x20
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0x140023760a0, {0x1036c98d5, 0x8}, 0x14005843730)
        github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe(0x0?)
        github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:111 +0x78
github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze.func2(0x14004f3b500)
        github.com/golangci/golangci-lint/pkg/goanalysis/runner_loadingpackage.go:80 +0xb0
created by github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze in goroutine 785
        github.com/golangci/golangci-lint/pkg/goanalysis/runner_loadingpackage.go:75 +0x184 
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: intrange: package "confmgr" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: ast.Expr is *ast.SelectorExpr, not *ast.Ident 
INFO [runner] processing took 1.329µs with stages: max_same_issues: 459ns, skip_dirs: 166ns, cgo: 125ns, max_from_linter: 125ns, nolint: 42ns, fixer: 42ns, sort_results: 42ns, path_prettifier: 41ns, skip_files: 41ns, uniq_by_line: 41ns, source_code: 41ns, exclude: 41ns, exclude-rules: 41ns, identifier_marker: 41ns, diff: 41ns, severity-rules: 0s, filename_unadjuster: 0s, path_shortener: 0s, autogenerated_exclude: 0s, max_per_file_from_linter: 0s, invalid_issue: 0s, path_prefixer: 0s 
INFO [runner] linters took 10.552233792s with stages: goanalysis_metalinter: 10.552200333s 
ERRO Running error: can't run linter goanalysis_metalinter
goanalysis_metalinter: intrange: package "confmgr" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: ast.Expr is *ast.SelectorExpr, not *ast.Ident 
INFO Memory: 110 samples, avg is 1322.8MB, max is 2669.4MB 
INFO Execution took 11.040166833s                 

A minimal reproducible example or link to a public repository

// Unable to provide specific line

Validation

  • Yes, I've included all information above (version, config, etc.).
@koblas koblas added the bug Something isn't working label Apr 9, 2024
Copy link

boring-cyborg bot commented Apr 9, 2024

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

@ldez ldez added the dependencies Relates to an upstream dependency label Apr 9, 2024
@ldez
Copy link
Member

ldez commented Apr 9, 2024

already fixed by #4601

@koblas
Copy link
Author

koblas commented Apr 29, 2024

@ldez trying not to nag, but is there an ETA for the release containing this fix?

@poojavp95

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Relates to an upstream dependency
Projects
None yet
Development

No branches or pull requests

3 participants