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: GOEXPERIMENT=unified <autogenerated>:1: internal compiler error: missing wrapper #52128

Closed
andig opened this issue Apr 3, 2022 · 10 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@andig
Copy link
Contributor

andig commented Apr 3, 2022

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

$ go version
go version go1.18 darwin/arm64

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
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/andig/Library/Caches/go-build"
GOENV="/Users/andig/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/andig/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/andig/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.18/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.18/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/andig/htdocs/evcc/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 arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build3960792540=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.18 darwin/arm64
GOROOT/bin/go tool compile -V: compile version go1.18
uname -v: Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101
ProductName:	macOS
ProductVersion:	12.3
BuildVersion:	21E230
lldb --version: lldb-1316.0.9.41
Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)

What did you do?

GOEXPERIMENT=unified go run main.go charger

on evcc-io/evcc@0420779

What did you expect to see?

No compiler error

What did you see instead?

# github.com/evcc-io/evcc/vehicle/vag/service
<autogenerated>:1: internal compiler error: missing wrapper for Refresh

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
@andig andig changed the title cmd/go: GOEXPERIMENT=unified <autogenerated>:1: internal compiler error: missing wrapper for Refresh cmd/go: GOEXPERIMENT=unified <autogenerated>:1: internal compiler error: missing wrapper Apr 3, 2022
@andig andig changed the title cmd/go: GOEXPERIMENT=unified <autogenerated>:1: internal compiler error: missing wrapper cmd/compile: GOEXPERIMENT=unified <autogenerated>:1: internal compiler error: missing wrapper Apr 3, 2022
@ianlancetaylor
Copy link
Contributor

CC @mdempsky

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 3, 2022
@ianlancetaylor ianlancetaylor added this to the Go1.19 milestone Apr 3, 2022
@andig
Copy link
Contributor Author

andig commented Apr 10, 2022

This also fails on tip but has a stack trace there:

goroutine 1 [running]:
runtime/debug.Stack()
	/Users/andig/sdk/gotip/src/runtime/debug/stack.go:24 +0x64
cmd/compile/internal/base.FatalfAt({0x772690?, 0x140?}, {0x10564c3f9, 0x16}, {0x140007e2e38, 0x1, 0x1})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/base/print.go:227 +0x224
cmd/compile/internal/walk.methodValueWrapper(0x14000a81e00)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/closure.go:231 +0x148
cmd/compile/internal/walk.walkMethodValue(0x14000a81e00, 0x140007e36d0)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/closure.go:191 +0x350
cmd/compile/internal/walk.walkExpr1({0x1058716a8, 0x14000a81e00}, 0x14000a81e00?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:320 +0xd4c
cmd/compile/internal/walk.walkExpr({0x1058716a8, 0x14000a81e00}, 0x140007e36d0)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:55 +0x370
cmd/compile/internal/walk.walkConv(0x14000c1efa0, 0x1050520c8?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/convert.go:23 +0x3c
cmd/compile/internal/walk.walkExpr1({0x105870340, 0x14000c1efa0}, 0x14000c1efa0?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:219 +0x570
cmd/compile/internal/walk.walkExpr({0x105870340, 0x14000c1efa0}, 0x140007e36d0)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:55 +0x370
cmd/compile/internal/walk.walkAssign(0x140007e36d0, {0x10586fb58, 0x14000c64e10?})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:72 +0x8c8
cmd/compile/internal/walk.walkExpr1({0x10586fb58, 0x14000c64e10}, 0x14000c64e10?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:179 +0x3e0
cmd/compile/internal/walk.walkExpr({0x10586fb58, 0x14000c64e10}, 0x140007e36d0)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:55 +0x370
cmd/compile/internal/walk.appendWalkStmt(0x140007e36d0, {0x10586fb58, 0x14000c64e10})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/walk.go:256 +0x64
cmd/compile/internal/walk.ascompatee(0x15, {0x14000bfde00?, 0x2, 0x2?}, {0x14000bfde60?, 0x2, 0x0?})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:372 +0x55c
cmd/compile/internal/walk.walkAssignList(0x140007e3a70, 0x14000a81f20)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:146 +0x128
cmd/compile/internal/walk.walkExpr1({0x10586f9e8, 0x14000a81f20}, 0x14000a81f20?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:183 +0x2ec
cmd/compile/internal/walk.walkExpr({0x10586f9e8, 0x14000a81f20}, 0x140007e3a70)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:55 +0x370
cmd/compile/internal/walk.walkStmt({0x10586f9e8, 0x14000a81f20?})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/stmt.go:57 +0x6ac
cmd/compile/internal/walk.walkStmtList(...)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/stmt.go:175
cmd/compile/internal/walk.Walk(0x14000c18b40)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/walk.go:43 +0x194
cmd/compile/internal/gc.prepareFunc(0x14000c18b40)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/gc/compile.go:92 +0x80
cmd/compile/internal/gc.enqueueFunc(0x14000c18b40)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/gc/compile.go:66 +0x29c
cmd/compile/internal/gc.Main(0x105868700)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/gc/main.go:295 +0x1044
main.main()
	/Users/andig/sdk/gotip/src/cmd/compile/main.go:55 +0xf4

@gopherbot
Copy link

Change https://go.dev/cl/407855 mentions this issue: cmd/compile: fix missing method value wrapper in unified IR

@gopherbot
Copy link

Change https://go.dev/cl/410339 mentions this issue: [dev.unified] cmd/compile: fix missing method value wrapper in unified IR

@gopherbot
Copy link

Change https://go.dev/cl/410344 mentions this issue: [dev.unified] cmd/compile: fix missing method value wrapper in unified IR

@ianlancetaylor
Copy link
Contributor

@mdempsky Is there anything else to do for this issue? It's currently in the 1.19 milestone. Thanks.

@dmitshur dmitshur added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 12, 2022
@mdempsky mdempsky modified the milestones: Go1.19, Go1.20 Jul 12, 2022
@andig
Copy link
Contributor Author

andig commented Aug 3, 2022

Current Go1.19 still shows same error- not sure if this is expected?

@cuonglm
Copy link
Member

cuonglm commented Aug 3, 2022

Current Go1.19 still shows same error- not sure if this is expected?

Should be fixed on tip with Unified IR enabled. Could you please try it?

@andig
Copy link
Contributor Author

andig commented Aug 3, 2022

I'm afraid not:

GOEXPERIMENT=unified gotip run main.go charger
# github.com/evcc-io/evcc/vehicle/vag/service
<autogenerated>:1: internal compiler error: missing wrapper for Refresh

goroutine 1 [running]:
runtime/debug.Stack()
	/Users/andig/sdk/gotip/src/runtime/debug/stack.go:24 +0x64
cmd/compile/internal/base.FatalfAt({0x816c40?, 0x140?}, {0x10555e153, 0x16}, {0x1400058eca8, 0x1, 0x1})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/base/print.go:227 +0x224
cmd/compile/internal/walk.methodValueWrapper(0x14000b10540)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/closure.go:231 +0x14c
cmd/compile/internal/walk.walkMethodValue(0x14000b10540, 0x1400058f530)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/closure.go:191 +0x31c
cmd/compile/internal/walk.walkExpr1({0x105792b08, 0x14000b10540}, 0x14000b10540?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:321 +0xad0
cmd/compile/internal/walk.walkExpr({0x105792b08, 0x14000b10540}, 0x1400058f530)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:56 +0x370
cmd/compile/internal/walk.walkConv(0x14000b1e320, 0x104f353d8?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/convert.go:23 +0x3c
cmd/compile/internal/walk.walkExpr1({0x1057917a0, 0x14000b1e320}, 0x14000b1e320?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:220 +0x450
cmd/compile/internal/walk.walkExpr({0x1057917a0, 0x14000b1e320}, 0x1400058f530)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:56 +0x370
cmd/compile/internal/walk.walkAssign(0x1400058f530, {0x105790fb8, 0x14000b6c190?})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:72 +0x8cc
cmd/compile/internal/walk.walkExpr1({0x105790fb8, 0x14000b6c190}, 0x14000b6c190?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:180 +0x32c
cmd/compile/internal/walk.walkExpr({0x105790fb8, 0x14000b6c190}, 0x1400058f530)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:56 +0x370
cmd/compile/internal/walk.appendWalkStmt(0x1400058f530, {0x105790fb8, 0x14000b6c190})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/walk.go:256 +0x64
cmd/compile/internal/walk.ascompatee(0x15, {0x14000b22100?, 0x2, 0x2?}, {0x14000b22160?, 0x2, 0x0?})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:374 +0x560
cmd/compile/internal/walk.walkAssignList(0x1400058f8d0, 0x14000b10660)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/assign.go:146 +0x128
cmd/compile/internal/walk.walkExpr1({0x105790e48, 0x14000b10660}, 0x14000b10660?)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:184 +0x260
cmd/compile/internal/walk.walkExpr({0x105790e48, 0x14000b10660}, 0x1400058f8d0)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/expr.go:56 +0x370
cmd/compile/internal/walk.walkStmt({0x105790e48, 0x14000b10660?})
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/stmt.go:58 +0x6c8
cmd/compile/internal/walk.walkStmtList(...)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/stmt.go:177
cmd/compile/internal/walk.Walk(0x14000afb680)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/walk/walk.go:43 +0x194
cmd/compile/internal/gc.prepareFunc(0x14000afb680)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/gc/compile.go:92 +0x80
cmd/compile/internal/gc.enqueueFunc(0x14000afb680)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/gc/compile.go:66 +0x29c
cmd/compile/internal/gc.Main(0x105786d20)
	/Users/andig/sdk/gotip/src/cmd/compile/internal/gc/main.go:300 +0x10f8
main.main()
	/Users/andig/sdk/gotip/src/cmd/compile/main.go:57 +0xf4

with

gotip version
go version devel go1.20-29b9a32 Tue Aug 2 18:52:33 2022 +0000 darwin/arm64

@cuonglm
Copy link
Member

cuonglm commented Aug 3, 2022

@andig Thanks for confirmation.

Checkout at a8780f9 build the repo ok, so seems to be regression somewhere.

Ops, I forgot that we need to wait dev.unified branch to be merged to master for testing on tip. In the meantime, you should checkout dev.unified branch and test it.

jproberts pushed a commit to jproberts/go that referenced this issue Aug 10, 2022
…d IR

Unified IR uses to generate wrappers after the global inlining pass, so
it needs to apply inlining for the wrappers itself. However, inlining
may reveal new method value nodes which have not been seen yet, thus
unified IR never generates wrappers for them.

To fix it, just visiting the wrapper function body once more time after
inlining, and generate wrappers for any new method value nodes.

Fixes golang#52128

Change-Id: I78631c4faa0b00357d4f84704d3525fd38a52cd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/410344
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
@golang golang locked and limited conversation to collaborators Aug 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

6 participants