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: Inline_Flood-related panic when compiling with go1.17 #48330

Closed
dtracers opened this issue Sep 10, 2021 · 4 comments
Closed

cmd/compile: Inline_Flood-related panic when compiling with go1.17 #48330

dtracers opened this issue Sep 10, 2021 · 4 comments

Comments

@dtracers
Copy link

@dtracers dtracers commented Sep 10, 2021

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

$ go version

Run actions/setup-go@v2
Setup go stable version spec ^1.16.5
Found in cache @ /opt/hostedtoolcache/go/1.17.0/x64
Added go to the path
Successfully setup go version ^1.16.5
go version go1.17 linux/amd64

Does this issue reproduce with the latest release?

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

go env Output
$ go env
GO111MODULE=""
  GOARCH="amd64"
  GOBIN=""
  GOCACHE="/home/runner/.cache/go-build"
  GOENV="/home/runner/.config/go/env"
  GOEXE=""
  GOEXPERIMENT=""
  GOFLAGS=""
  GOHOSTARCH="amd64"
  GOHOSTOS="linux"
  GOINSECURE=""
  GOMODCACHE="/home/runner/go/pkg/mod"
  GONOPROXY=""
  GONOSUMDB=""
  GOOS="linux"
  GOPATH="/home/runner/go"
  GOPRIVATE=""
  GOPROXY="https://proxy.golang.org,direct"
  GOROOT="/opt/hostedtoolcache/go/1.17.0/x64"
  GOSUMDB="sum.golang.org"
  GOTMPDIR=""
  GOTOOLDIR="/opt/hostedtoolcache/go/1.17.0/x64/pkg/tool/linux_amd64"
  GOVCS=""
  GOVERSION="go1.17"
  GCCGO="gccgo"
  AR="ar"
  CC="gcc"
  CXX="g++"
  CGO_ENABLED="1"
  GOMOD="/dev/null"
  CGO_CFLAGS="-g -O2"
  CGO_CPPFLAGS=""
  CGO_CXXFLAGS="-g -O2"
  CGO_FFLAGS="-g -O2"
  CGO_LDFLAGS="-g -O2"
  PKG_CONFIG="pkg-config"
  GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build93646801=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Compiled code
I can not list the code that failed to compile

What did you expect to see?

Currently works on my windows machine with version:
go version go1.16.3 windows/amd64

And on a docker container on that same windows machine with version:
go version go1.16.6 linux/amd64

This is inside a github container.
Please note that this is a new issue for the github container (it worked a couple of weeks ago using the same code and commands)

What did you see instead?

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x6f0497]
​
goroutine 1 [running]:
cmd/compile/internal/ir.MethodExprName(...)
	/usr/local/go/src/cmd/compile/internal/ir/expr.go:1067
cmd/compile/internal/inline.Inline_Flood.func1({0xe4ed88, 0xc000c4ad80})
	/usr/local/go/src/cmd/compile/internal/inline/inl.go:222 +0xf7
cmd/compile/internal/ir.Visit.func1({0xe4ed88, 0xc000c4ad80})
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:105 +0x30
cmd/compile/internal/ir.(*CallExpr).doChildren(0xc0006557a0, 0xc000c32b28)
	/usr/local/go/src/cmd/compile/internal/ir/node_gen.go:260 +0x64
cmd/compile/internal/ir.DoChildren(...)
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0xe4d2f8, 0xc0006557a0})
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.doNodes({0xc0009b4060, 0x1, 0xc000c32b28}, 0xc000c32b28)
	/usr/local/go/src/cmd/compile/internal/ir/node_gen.go:1440 +0x67
cmd/compile/internal/ir.(*ReturnStmt).doChildren(0xc000c474a0, 0xc000c474a0)
	/usr/local/go/src/cmd/compile/internal/ir/node_gen.go:977 +0x57
cmd/compile/internal/ir.DoChildren(...)
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:94
cmd/compile/internal/ir.Visit.func1({0xe4ebf8, 0xc000c474a0})
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:106 +0x57
cmd/compile/internal/ir.Visit({0xe4ebf8, 0xc000c474a0}, 0xc000c32b10)
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:108 +0xb8
cmd/compile/internal/ir.VisitList({0xc0009b4070, 0x1, 0xc0005981c0}, 0x409aed)
	/usr/local/go/src/cmd/compile/internal/ir/visit.go:114 +0x65
cmd/compile/internal/inline.Inline_Flood(0xc000568750, 0xd16ca0)
	/usr/local/go/src/cmd/compile/internal/inline/inl.go:247 +0x22d
cmd/compile/internal/gc.(*exporter).markObject(0xc0000b51bc, {0xe4e748, 0xc000568750})
	/usr/local/go/src/cmd/compile/internal/gc/export.go:92 +0x5f
cmd/compile/internal/gc.(*exporter).markType(0xc000d6fad0, 0xc00053a000)
	/usr/local/go/src/cmd/compile/internal/gc/export.go:115 +0x392
cmd/compile/internal/gc.(*exporter).markType(0xc000d6fad0, 0xc00056ce70)
	/usr/local/go/src/cmd/compile/internal/gc/export.go:131 +0x129
cmd/compile/internal/gc.(*exporter).markType(0xc000d6fad0, 0xc00052ff80)
	/usr/local/go/src/cmd/compile/internal/gc/export.go:145 +0x2ce
cmd/compile/internal/gc.(*exporter).markObject(0xc000d6fab0, {0xe4e748, 0xc00008e1a0})
	/usr/local/go/src/cmd/compile/internal/gc/export.go:96 +0x8f
cmd/compile/internal/gc.dumpexport(0xc00066ccd0)
	/usr/local/go/src/cmd/compile/internal/gc/export.go:33 +0xfc
cmd/compile/internal/gc.dumpCompilerObj(0xc00066ccd0)
	/usr/local/go/src/cmd/compile/internal/gc/obj.go:106 +0x28
cmd/compile/internal/gc.dumpobj1({0x7fff1bbceb98, 0x24}, 0x3)
	/usr/local/go/src/cmd/compile/internal/gc/obj.go:62 +0x178
cmd/compile/internal/gc.dumpobj()
	/usr/local/go/src/cmd/compile/internal/gc/obj.go:43 +0x36
cmd/compile/internal/gc.Main(0xd16450)
	/usr/local/go/src/cmd/compile/internal/gc/main.go:307 +0x105b
main.main()
	/usr/local/go/src/cmd/compile/main.go:55 +0xdd
	```
@ALTree ALTree changed the title Go 17 compiler panics when compiling code (older versions do not) cmd/compile: Inline_Flood-related panic when compiling with go1.17 Sep 10, 2021
@ALTree
Copy link
Member

@ALTree ALTree commented Sep 10, 2021

Could be related to #45503?

cc @randall77

Loading

@ALTree ALTree added this to the Go1.18 milestone Sep 10, 2021
@dtracers
Copy link
Author

@dtracers dtracers commented Sep 10, 2021

I do not believe I have a code pattern similar to the one in the running example listed in #45503

        run: |
          go build -v -gcflags '-m' -race .

I ran with these flags but they did not give me any extra details than what is already listed here.
I can run it again with different sets of flags if it will help debug this issue

I can try and run the github actions with a nightly build if that works with the "go-setup" action.

Loading

@cuonglm
Copy link
Member

@cuonglm cuonglm commented Sep 10, 2021

Does it work with go1.17.1?

Loading

@dtracers
Copy link
Author

@dtracers dtracers commented Sep 11, 2021

1.17.1 does work with no issues:

go version go1.17.1 linux/amd64

Loading

@dtracers dtracers closed this Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants