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: 1.21rc2 internal compiler error: missing wrapper for (method) #60945

Closed
evanj opened this issue Jun 22, 2023 · 1 comment
Closed
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@evanj
Copy link
Contributor

evanj commented Jun 22, 2023

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

$ go version
go version go1.21rc2 darwin/arm64

Does this issue reproduce with the latest release?

This is on 1.21rc2 only; 1.20.5 works.

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

go env Output
$ go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/evan.jones/Library/Caches/go-build'
GOENV='/Users/evan.jones/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/evan.jones/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/evan.jones/go'
GOPRIVATE=''
GOPROXY=''
GOROOT='/Users/evan.jones/.gimme/versions/go1.21rc2.darwin.arm64'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/evan.jones/.gimme/versions/go1.21rc2.darwin.arm64/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21rc2'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/evan.jones/dd/dd-go/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 -ffile-prefix-map=/var/folders/g1/97d8s0r57hj4nv4_qd3fqcrm0000gp/T/go-build3625918932=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Attempt to run the following program (github repository version):

main.go

package main

import (
	"fmt"

	"github.com/evanj/go121bug/pkg"
)

func main() {
	out := &pkg.Router{}
	fmt.Println(out.Route)
}

pkg/pkg.go

package pkg

import "fmt"

type Router struct{}

func callClosure(closure func()) {
	closure()
}

// Route is the obs_pipelines router
func (r *Router) Route() {
	callClosure(func() {
		fmt.Println("getConfigVersion:", r.getConfigVersion)
	})
}

func (r *Router) getConfigVersion() {}

What did you expect to see?

Some output:

$ go run .
0x10248fcb0

What did you see instead?

$ /Users/evan.jones/.gimme/versions/go1.21rc2.darwin.arm64/bin/go run .
# github.com/evanj/go121bug
./pkg/pkg.go:14:37: internal compiler error: missing wrapper for pkg.getConfigVersion

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
@seankhliao seankhliao changed the title 1.21rc2: internal compiler error: missing wrapper for (method) cmd/compile: 1.21rc2 internal compiler error: missing wrapper for (method) Jun 22, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jun 22, 2023
@cuonglm cuonglm added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 22, 2023
@cuonglm cuonglm added this to the Go1.21 milestone Jun 22, 2023
@cuonglm cuonglm self-assigned this Jun 22, 2023
@gopherbot
Copy link

Change https://go.dev/cl/505255 mentions this issue: cmd/compile: scanning closures body when visiting wrapper function

bradfitz pushed a commit to tailscale/go that referenced this issue Jul 15, 2023
CL 410344 fixed missing method value wrapper, by visiting body of
wrapper function after applying inlining pass.

CL 492017 allow more inlining of functions that construct closures,
which ends up making the wrapper function now inlineable, but can
contain closure nodes that couldn't be inlined. These closures body may
contain OMETHVALUE nodes that we never seen, thus we need to scan
closures body for finding them.

Fixes golang#60945

Change-Id: Ia1e31420bb172ff87d7321d2da2989ef23e6ebb6
Reviewed-on: https://go-review.googlesource.com/c/go/+/505255
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants