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 #54326

Closed
bytemare opened this issue Aug 7, 2022 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@bytemare
Copy link

bytemare commented Aug 7, 2022

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)?

Not sure that's relevant, as the bug occurs on different platforms, environments, and even CI.

What did you do?

$ go test

What did you expect to see?

Normal execution of the test.

PASS
ok      test     0.003s

What did you see instead?

# go-19-panic [go-19-panic.test]
: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
FAIL    go-19-panic [build failed]

More

I extracted code that reproduces this behavior here: https://github.com/bytemare/go-19-panic . It needs a test file to panic, so it does not reproduce on the playground: https://go.dev/play/p/WlCb-l0gd82

It used to work on Go 1.18. The repo I linked to runs go test on 1.19 and 1.18, where it panics reliably on 1.19 but not 1.18.

@hopehook
Copy link
Member

hopehook commented Aug 7, 2022

I found that the test case can be passed by go test -gcflags='-l' test. (maybe the problem is caused by optimization of inlining)

@seankhliao seankhliao changed the title affected/package: go test panics on 1.19 cmd/compile: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference Aug 7, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Aug 7, 2022
@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed compiler/runtime Issues related to the Go compiler and/or runtime. labels Aug 7, 2022
@cuiweixie
Copy link
Contributor

➜ go-19-panic git:(main) go test -v
=== RUN TestPoint_Decode
--- PASS: TestPoint_Decode (0.00s)
PASS
ok go-19-panic 0.118s
➜ go-19-panic git:(main) go version
go version devel go1.20-0c4db1e347 Sat Aug 6 15:20:00 2022 +0000 darwin/arm64
master is ok now!

@cuonglm
Copy link
Member

cuonglm commented Aug 17, 2022

Duplicated of #53982, the fix was merged to master, and backported to go1.19

@cuonglm cuonglm closed this as completed Aug 17, 2022
@golang golang locked and limited conversation to collaborators Aug 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants