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: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference #54703

Closed
earl-warren opened this issue Aug 27, 2022 · 4 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.

Comments

@earl-warren
Copy link

earl-warren commented Aug 27, 2022

I will keep the branch reproducing the bug until it is fixed. Note that go 1.18.4 compiles fine with the same codebase.

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

$ go version
go version go1.19 linux/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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2924617207=/tmp/go-build -gno-record-gcc-switches"

What did you do?

git clone --recursive --branch wip-go1.19-bug https://lab.forgefriends.org/earl-warren/gof3
cd gof3
go test -v lab.forgefriends.org/friendlyforgeformat/gof3/forges/...

Here is a run in the go 1.19 Debian GNU/Linux docker image to help avoid environmental variance:

$ docker run --rm -ti golang:1.19-bullseye bash
root@7acb76a89733:/go# git clone --recursive --branch wip-go1.19-bug https://lab.forgefriends.org/earl-warren/gof3
Cloning into 'gof3'...
warning: redirecting to https://lab.forgefriends.org/earl-warren/gof3.git/
remote: Enumerating objects: 2088, done.
remote: Counting objects: 100% (731/731), done.
remote: Compressing objects: 100% (350/350), done.
remote: Total 2088 (delta 511), reused 533 (delta 357), pack-reused 1357
Receiving objects: 100% (2088/2088), 557.88 KiB | 113.00 KiB/s, done.
Resolving deltas: 100% (1414/1414), done.
Submodule 'format/schemas' (https://lab.forgefriends.org/friendlyforgeformat/f3-schemas) registered for path 'format/schemas'
Cloning into '/go/gof3/format/schemas'...
warning: redirecting to https://lab.forgefriends.org/friendlyforgeformat/f3-schemas.git/
remote: Enumerating objects: 53, done.        
remote: Counting objects: 100% (6/6), done.        
remote: Compressing objects: 100% (6/6), done.        
remote: Total 53 (delta 2), reused 0 (delta 0), pack-reused 47
Receiving objects: 100% (53/53), 11.84 KiB | 40.00 KiB/s, done.
Resolving deltas: 100% (29/29), done.
Submodule path 'format/schemas': checked out '89e975e7838a791fd4d84d523c91591eaec0ee8a'
root@7acb76a89733:/go# cd gof3
root@7acb76a89733:/go/gof3# go test -v lab.forgefriends.org/friendlyforgeformat/gof3/forges/...
go: downloading github.com/google/go-cmp v0.5.8
go: downloading github.com/stretchr/testify v1.7.0
go: downloading gitea.com/earl-warren/go-sdk/gitea v0.15.1-0.20220821233938-49e74ff9d331
go: downloading github.com/santhosh-tekuri/jsonschema/v5 v5.0.0
go: downloading golang.org/x/exp v0.0.0-20220516143420-24438e51023a
go: downloading github.com/davecgh/go-spew v1.1.0
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading github.com/go-fed/httpsig v1.1.0
go: downloading github.com/hashicorp/go-version v1.5.0
go: downloading golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
go: downloading golang.org/x/sys v0.0.0-20211019181941-9d821ace8654
# lab.forgefriends.org/friendlyforgeformat/gof3/forges [lab.forgefriends.org/friendlyforgeformat/gof3/forges.test]
<autogenerated>:1: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference

See a run in the CI here.

What did you expect to see?

The output of the tests

What did you see instead?

 lab.forgefriends.org/friendlyforgeformat/gof3/forges [lab.forgefriends.org/friendlyforgeformat/gof3/forges.test]
<autogenerated>:1: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
@cuonglm
Copy link
Member

cuonglm commented Aug 27, 2022

This is likely a duplicated issue, but I can't reproduce in my local to verify.

go1.19 test -v lab.forgefriends.org/friendlyforgeformat/gof3/forges/...
# code.gitea.io/sdk/gitea
../go/pkg/mod/gitea.com/earl-warren/go-sdk/gitea@v0.15.1-0.20220821233938-49e74ff9d331/httpsign.go:106:17: undefined: GetAgent
FAIL	lab.forgefriends.org/friendlyforgeformat/gof3/forges [build failed]
?   	lab.forgefriends.org/friendlyforgeformat/gof3/forges/abstract	[no test files]
?   	lab.forgefriends.org/friendlyforgeformat/gof3/forges/common	[no test files]
?   	lab.forgefriends.org/friendlyforgeformat/gof3/forges/driver	[no test files]
=== RUN   TestFile
2022/08/27 11:15:56 downloading asset asset 1 using function 0x1005c9190
--- FAIL: TestFile (0.44s)
panic: /var/folders/1s/1zd62h955bv9tg86ncz81k080000gn/T/TestFile1157639037/002/project.json: jsonschema: '' does not validate with file:///Users/cuonglm/gof3/forges/file/project.json#/additionalProperties: additionalProperties 'repositories' not allowed [recovered]
	panic: /var/folders/1s/1zd62h955bv9tg86ncz81k080000gn/T/TestFile1157639037/002/project.json: jsonschema: '' does not validate with file:///Users/cuonglm/gof3/forges/file/project.json#/additionalProperties: additionalProperties 'repositories' not allowed

goroutine 19 [running]:
testing.tRunner.func1.2({0x1006daf00, 0x14000437100})
/Users/cuonglm/sdk/go1.19/src/testing/testing.go:1396 +0x1c8
testing.tRunner.func1()
/Users/cuonglm/sdk/go1.19/src/testing/testing.go:1399 +0x378
panic({0x1006daf00, 0x14000437100})
/Users/cuonglm/sdk/go1.19/src/runtime/panic.go:884 +0x204
lab.forgefriends.org/friendlyforgeformat/gof3/forges/file.getBean[...](0x140001ca580, {0x1005d446d, 0x140003284b0?}, 0x1?)
/Users/cuonglm/gof3/forges/file/file.go:276 +0x160
lab.forgefriends.org/friendlyforgeformat/gof3/forges/file.MaybeGetBean...
/Users/cuonglm/gof3/forges/file/file.go:261
lab.forgefriends.org/friendlyforgeformat/gof3/forges/file.(*File).GetProject(...)
/Users/cuonglm/gof3/forges/file/file.go:233
lab.forgefriends.org/friendlyforgeformat/gof3/forges/file.TestFile(0x0?)
/Users/cuonglm/gof3/forges/file/file_test.go:36 +0x258
testing.tRunner(0x140002951e0, 0x10073d6c8)
/Users/cuonglm/sdk/go1.19/src/testing/testing.go:1446 +0x10c
created by testing.(*T).Run
/Users/cuonglm/sdk/go1.19/src/testing/testing.go:1493 +0x300
FAIL lab.forgefriends.org/friendlyforgeformat/gof3/forges/file 0.753s
FAIL lab.forgefriends.org/friendlyforgeformat/gof3/forges/gitea [build failed]
=== RUN TestNotImplemented
--- PASS: TestNotImplemented (0.00s)
PASS
ok lab.forgefriends.org/friendlyforgeformat/gof3/forges/null (cached)
? lab.forgefriends.org/friendlyforgeformat/gof3/forges/tests [no test files]
FAIL

@cuonglm cuonglm changed the title go1.19: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference cmd/compile: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference Aug 27, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Aug 27, 2022
@earl-warren
Copy link
Author

earl-warren commented Aug 27, 2022

Here is a run in the go 1.19 Debian GNU/Linux docker image to help avoid environmental variance:

$ docker run --rm -ti golang:1.19-bullseye bash
root@7acb76a89733:/go# git clone --recursive --branch wip-go1.19-bug https://lab.forgefriends.org/earl-warren/gof3
Cloning into 'gof3'...
warning: redirecting to https://lab.forgefriends.org/earl-warren/gof3.git/
remote: Enumerating objects: 2088, done.
remote: Counting objects: 100% (731/731), done.
remote: Compressing objects: 100% (350/350), done.
remote: Total 2088 (delta 511), reused 533 (delta 357), pack-reused 1357
Receiving objects: 100% (2088/2088), 557.88 KiB | 113.00 KiB/s, done.
Resolving deltas: 100% (1414/1414), done.
Submodule 'format/schemas' (https://lab.forgefriends.org/friendlyforgeformat/f3-schemas) registered for path 'format/schemas'
Cloning into '/go/gof3/format/schemas'...
warning: redirecting to https://lab.forgefriends.org/friendlyforgeformat/f3-schemas.git/
remote: Enumerating objects: 53, done.        
remote: Counting objects: 100% (6/6), done.        
remote: Compressing objects: 100% (6/6), done.        
remote: Total 53 (delta 2), reused 0 (delta 0), pack-reused 47
Receiving objects: 100% (53/53), 11.84 KiB | 40.00 KiB/s, done.
Resolving deltas: 100% (29/29), done.
Submodule path 'format/schemas': checked out '89e975e7838a791fd4d84d523c91591eaec0ee8a'
root@7acb76a89733:/go# cd gof3
root@7acb76a89733:/go/gof3# go test -v lab.forgefriends.org/friendlyforgeformat/gof3/forges/...
go: downloading github.com/google/go-cmp v0.5.8
go: downloading github.com/stretchr/testify v1.7.0
go: downloading gitea.com/earl-warren/go-sdk/gitea v0.15.1-0.20220821233938-49e74ff9d331
go: downloading github.com/santhosh-tekuri/jsonschema/v5 v5.0.0
go: downloading golang.org/x/exp v0.0.0-20220516143420-24438e51023a
go: downloading github.com/davecgh/go-spew v1.1.0
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading github.com/go-fed/httpsig v1.1.0
go: downloading github.com/hashicorp/go-version v1.5.0
go: downloading golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
go: downloading golang.org/x/sys v0.0.0-20211019181941-9d821ace8654
# lab.forgefriends.org/friendlyforgeformat/gof3/forges [lab.forgefriends.org/friendlyforgeformat/gof3/forges.test]
<autogenerated>:1: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference

@ZekeLu
Copy link
Contributor

ZekeLu commented Aug 27, 2022

@cuonglm Have you checked out the wip-go1.19-bug branch? I can reproduce it on that branch. And git bisect shows that it's fixed by 0c4db1e. So this is a duplicate of #54302.

@cuonglm
Copy link
Member

cuonglm commented Aug 27, 2022

@cuonglm Have you checked out the wip-go1.19-bug branch? I can reproduce it on that branch. And git bisect shows that it's fixed by 0c4db1e. So this is a duplicate of #54302.

yes, basically, I copy-paste command that the author showed.

Anyway, thanks for bisecting.

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.
Projects
None yet
Development

No branches or pull requests

4 participants