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

Panic: fatal error: stack overflow: generics code #1247

Closed
ardan-bkennedy opened this issue Apr 7, 2022 · 6 comments
Closed

Panic: fatal error: stack overflow: generics code #1247

ardan-bkennedy opened this issue Apr 7, 2022 · 6 comments
Labels

Comments

@ardan-bkennedy
Copy link
Sponsor

@ardan-bkennedy ardan-bkennedy commented Apr 7, 2022

$ staticcheck --version
staticcheck 2022.1 (v0.3.0)
$ staticcheck -debug.version
staticcheck 2022.1 (v0.3.0)

Compiled with Go version: go1.18
Main module:
	honnef.co/go/tools@v0.3.0 (sum: h1:2LdYUZ7CIxnYgskbUZfY7FPggmqnh6shBqfWa8Tn3XU=)
Dependencies:
	github.com/BurntSushi/toml@v0.4.1 (sum: h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=)
	golang.org/x/exp/typeparams@v0.0.0-20220218215828-6cf2b201936e (sum: h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM=)
	golang.org/x/mod@v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 (sum: h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=)
	golang.org/x/sys@v0.0.0-20211019181941-9d821ace8654 (sum: h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=)
	golang.org/x/tools@v0.1.11-0.20220316014157-77aa08bb151a (sum: h1:ofrrl6c6NG5/IOSx/R1cyiQxxjqlur0h/TvbUhkH0II=)
	golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 (sum: h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=)
$ go version
go version go1.18 darwin/amd64
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/bill/Library/Caches/go-build"
GOENV="/Users/bill/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/bill/code/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/bill/code/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/bill/code/go/src/github.com/ardanlabs/service/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/k6/bpxy86ts4yz4796zp3pj6wq00000gn/T/go-build180710246=/tmp/go-build -gno-record-gcc-switches -fno-common"
https://github.com/ardanlabs/blockchain
staticcheck -checks=all ./...

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc04de00388 stack=[0xc04de00000, 0xc06de00000]
fatal error: stack overflow
. . .
@ardan-bkennedy ardan-bkennedy added bug needs-triage Newly filed issue that needs triage labels Apr 7, 2022
@dominikh dominikh removed the needs-triage Newly filed issue that needs triage label Apr 8, 2022
@dominikh
Copy link
Owner

@dominikh dominikh commented Apr 8, 2022

I can reproduce the crash; will investigate.

@dominikh
Copy link
Owner

@dominikh dominikh commented Apr 8, 2022

Reproducer:

package merkle

type Tree[T any] struct {
	Root *Node[T]
}

type Node[T any] struct {
	Tree *Tree[T]
}

func (n *Node[T]) anyMethod() {}

@ainar-g
Copy link
Contributor

@ainar-g ainar-g commented Apr 8, 2022

Possibly the same as golang/go#51832?

@dominikh
Copy link
Owner

@dominikh dominikh commented Apr 8, 2022

@ainar-g Unfortunately not. This is a bug in U1000's own logic.

@dominikh
Copy link
Owner

@dominikh dominikh commented Apr 8, 2022

Fixed on master, will be part of next week's 2022.1.1 release.

dominikh added a commit that referenced this issue Apr 9, 2022
@fogfish
Copy link

@fogfish fogfish commented Jul 4, 2022

FYI: the issue is reproducible with GitHub Actions dominikh/staticcheck-action@v1.2.0 if major version is used

      - uses: dominikh/staticcheck-action@v1.2.0
        with:
          version: "2022.1"
          install-go: false

as fix, use either latest or version: "2022.1.2"

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

No branches or pull requests

4 participants