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: failed to build google.golang.org/protobuf using regabi by internal compiler error #45417

Closed
johejo opened this issue Apr 7, 2021 · 3 comments

Comments

@johejo
Copy link

@johejo johejo commented Apr 7, 2021

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

$ go version
go version devel go1.17-8d77e45064 Wed Apr 7 02:05:55 2021 +0000 darwin/amd64

Does this issue reproduce with the latest release?

No, gotip with GOEXPERIMENT=regabi,regabiargs

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mitsuo.heijo/Library/Caches/go-build"
GOENV="/Users/mitsuo.heijo/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/mitsuo.heijo/go/pkg/mod"
GOOS="darwin"
GOPATH="/Users/mitsuo.heijo/go"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/mitsuo.heijo/ghq/github.com/golang/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/mitsuo.heijo/ghq/github.com/golang/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="devel go1.17-8d77e45064 Wed Apr 7 02:05:55 2021 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/mitsuo.heijo/ghq/github.com/protocolbuffers/protobuf-go/go.mod"
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/50/pygqcybx6hvgqkw7bkqfh5qm0000gp/T/go-build1806441375=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

git clone https://github.com/protocolbuffers/protobuf-go.git
cd protobuf-go/
GOEXPERIMENT=regabi,regabiargs gotip build ./...

What did you expect to see?

Bulid succeeds

What did you see instead?

# google.golang.org/protobuf/encoding/prototext
encoding/prototext/decode.go:500:5: internal compiler error: 'decoder.unmarshalMapEntry': incompatible OpArgIntReg [3]: v1000 = ArgIntReg <*uint8> {d+16} [3] and v811 = ArgIntReg <interface { FindExtensionByName(protoreflect.FullName) (protoreflect.ExtensionType, error); FindExtensionByNumber(protoreflect.FullName, protowire.Number) (protoreflect.ExtensionType, error); FindMessageByName(protoreflect.FullName) (protoreflect.MessageType, error); FindMessageByURL(string) (protoreflect.MessageType, error) }> {d+16} [3]

goroutine 79 [running]:
runtime/debug.Stack(0x1b99240, 0xc00000e018, 0x0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/runtime/debug/stack.go:24 +0x9f
cmd/compile/internal/base.FatalfAt(0x1f405100000002, 0xc000498810, 0x2e, 0xc000c1a740, 0x4, 0x4)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/base/print.go:227 +0x1ea
cmd/compile/internal/base.Fatalf(...)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/ssagen.(*ssafn).Fatalf(0xc000e48000, 0x1f405100000002, 0x1a67b52, 0x28, 0xc0008a63c0, 0x3, 0x3)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssagen/ssa.go:7377 +0x1f8
cmd/compile/internal/ssa.(*Func).Fatalf(0xc000a2ab60, 0x1a67b52, 0x28, 0xc0008a63c0, 0x3, 0x3)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssa/func.go:667 +0x342
cmd/compile/internal/ssa.expandCalls(0xc000a2ab60)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssa/expand_calls.go:1411 +0x1a65
cmd/compile/internal/ssa.Compile(0xc000a2ab60)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssa/compile.go:96 +0xc76
cmd/compile/internal/ssagen.buildssa(0xc000157340, 0x3, 0x0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssagen/ssa.go:639 +0x22e5
cmd/compile/internal/ssagen.Compile(0xc000157340, 0x3)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssagen/pgen.go:151 +0x5f
cmd/compile/internal/gc.compileFunctions.func2.1(0xc000372200, 0xc000157340, 0xc000483c98, 0xc000022eb0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/compile.go:130 +0x65
created by cmd/compile/internal/gc.compileFunctions.func2
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/compile.go:128 +0x8e

# google.golang.org/protobuf/encoding/protojson
encoding/protojson/well_known_types.go:431:9: internal compiler error: 'decoder.unmarshalEmpty': incompatible OpArgIntReg [3]: v232 = ArgIntReg <unsafe.Pointer> {d+16} [3] and v216 = ArgIntReg <interface { FindExtensionByName(protoreflect.FullName) (protoreflect.ExtensionType, error); FindExtensionByNumber(protoreflect.FullName, protowire.Number) (protoreflect.ExtensionType, error); FindMessageByName(protoreflect.FullName) (protoreflect.MessageType, error); FindMessageByURL(string) (protoreflect.MessageType, error) }> {d+16} [3]

goroutine 83 [running]:
runtime/debug.Stack(0x1b99240, 0xc0000c0008, 0x0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/runtime/debug/stack.go:24 +0x9f
cmd/compile/internal/base.FatalfAt(0x1af09000000005, 0xc000f6a240, 0x2e, 0xc000c5a040, 0x4, 0x4)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/base/print.go:227 +0x1ea
cmd/compile/internal/base.Fatalf(...)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/ssagen.(*ssafn).Fatalf(0xc000a90090, 0x1af09000000005, 0x1a67b52, 0x28, 0xc0018fdc80, 0x3, 0x3)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssagen/ssa.go:7377 +0x1f8
cmd/compile/internal/ssa.(*Func).Fatalf(0xc000a9a000, 0x1a67b52, 0x28, 0xc0018fdc80, 0x3, 0x3)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssa/func.go:667 +0x342
cmd/compile/internal/ssa.expandCalls(0xc000a9a000)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssa/expand_calls.go:1411 +0x1a65
cmd/compile/internal/ssa.Compile(0xc000a9a000)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssa/compile.go:96 +0xc76
cmd/compile/internal/ssagen.buildssa(0xc0003a0580, 0x2, 0x0)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssagen/ssa.go:639 +0x22e5
cmd/compile/internal/ssagen.Compile(0xc0003a0580, 0x2)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/ssagen/pgen.go:151 +0x5f
cmd/compile/internal/gc.compileFunctions.func2.1(0xc000442300, 0xc0003a0580, 0xc00061fb60, 0xc00046f960)
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/compile.go:130 +0x65
created by cmd/compile/internal/gc.compileFunctions.func2
        /Users/mitsuo.heijo/ghq/github.com/golang/go/src/cmd/compile/internal/gc/compile.go:128 +0x8e

related #40724

@thanm
Copy link
Contributor

@thanm thanm commented Apr 7, 2021

Hi,
It's nice of you do this sort of extra testing, but it is worth noting that the register ABI implementation is changing on a daily/hourly basis-- I don't think it makes sense to be filing separate issues when a GOEXPERIMENT=regabi build or run fails. If you can help with a minimized test case, please attach it as a comment on issue #44816.
Thanks, Than

Loading

@johejo johejo closed this Apr 8, 2021
@dr2chase
Copy link
Contributor

@dr2chase dr2chase commented Apr 8, 2021

Thanks for the bug anyway -- little hope of minimizing, but the repro recipe is concise, and I have a fix coming in a bit.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 8, 2021

Change https://golang.org/cl/308589 mentions this issue: cmd/compile: add recursive-invalidate Value method, use in expand_calls

Loading

gopherbot pushed a commit that referenced this issue Apr 8, 2021
This removes more unused values during transformation.
Leaving them in the tree can create type conflicts in OpArg* references.

Updates #40724.
Updates #44816.
Fixes #45417.

Change-Id: I07dcb7b4b2bf8d79e22e0543cb2fb52c2ececb96
Reviewed-on: https://go-review.googlesource.com/c/go/+/308589
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants