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

cmd/compile: panic: dvarint: bad offset for funcdata #52697

Open
ddaa2000 opened this issue May 4, 2022 · 2 comments
Open

cmd/compile: panic: dvarint: bad offset for funcdata #52697

ddaa2000 opened this issue May 4, 2022 · 2 comments
Assignees
Labels
NeedsInvestigation
Milestone

Comments

@ddaa2000
Copy link

@ddaa2000 ddaa2000 commented May 4, 2022

What version of Go are you using (go version)?

$ go version
go version go1.18.1 windows/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\ddaa\AppData\Local\go-build
set GOENV=C:\Users\ddaa\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\ddaa\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\ddaa\go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18.1
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\programing\go\bugReview\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\ddaa\AppData\Local\Temp\go-build2453048728=/tmp/go-build -gno-rec
ord-gcc-switches

What did you do?

https://go.dev/play/p/SJUm7jbaIjh

What did you expect to see?

The compiler don't panic and compile successfully or report "stack frame too large (>1GB)"

What did you see instead?

panic: dvarint: bad offset for funcdata - 1087887713

goroutine 20 [running]:
cmd/compile/internal/ssagen.dvarint(0xc00031c200?, 0xc0000e8a08?, 0x11?)
/usr/local/go/src/cmd/compile/internal/ssagen/ssa.go:287 +0x205
cmd/compile/internal/ssagen.(*state).emitOpenDeferInfo(0xc0002ead00)
/usr/local/go/src/cmd/compile/internal/ssagen/ssa.go:326 +0xfe
cmd/compile/internal/ssagen.buildssa(0xc0003bef20, 0x1)
/usr/local/go/src/cmd/compile/internal/ssagen/ssa.go:605 +0x1ffd
cmd/compile/internal/ssagen.Compile(0xc0003bef20, 0xc00003cf90?)
/usr/local/go/src/cmd/compile/internal/ssagen/pgen.go:183 +0x4c
cmd/compile/internal/gc.compileFunctions.func4.1(0x0?)
/usr/local/go/src/cmd/compile/internal/gc/compile.go:153 +0x3a
cmd/compile/internal/gc.compileFunctions.func3.1()
/usr/local/go/src/cmd/compile/internal/gc/compile.go:140 +0x4d
created by cmd/compile/internal/gc.compileFunctions.func3
/usr/local/go/src/cmd/compile/internal/gc/compile.go:138 +0x78

Go build failed.

@ddaa2000 ddaa2000 changed the title affected/package: cmd/compile: panic: dvarint: bad offset for funcdata cmd/compile: panic: dvarint: bad offset for funcdata May 4, 2022
@dr2chase dr2chase added the NeedsInvestigation label May 4, 2022
@dr2chase dr2chase added this to the Backlog milestone May 4, 2022
@dr2chase
Copy link
Contributor

@dr2chase dr2chase commented May 4, 2022

@cherrymui @dr2chase This looks like one of ours, someone has been fuzzing the compiler. I don't know that it actually requires generics.

@dr2chase dr2chase self-assigned this May 19, 2022
@dr2chase
Copy link
Contributor

@dr2chase dr2chase commented May 20, 2022

This is failure to correctly complain about a ginormous stack frame, not generics -- generics just allow us to say "ginormous stack frame" in fewer words. This can be seen by replacing the array dimensions "10" and "6" with constants, and varying them between larger and smaller sizes and watch the error come and go.

That said, we should complain more gracefully.

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

No branches or pull requests

2 participants