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: crash when masking len builtin with a const of same name #30133

Closed
kwoodhouse93 opened this issue Feb 8, 2019 · 5 comments
Closed

Comments

@kwoodhouse93
Copy link

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

The playground uses the latest stable release of Go.
The current version is go1.11.1.

Does this issue reproduce with the latest release?

Yes

What did you do?

Minimal example:
https://play.golang.org/p/zVHeuxQmSGD

What did you expect to see?

A compiler error

What did you see instead?

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0xb7c7ee]

goroutine 1 [running]:
cmd/compile/internal/gc.typecheck1(0xc00034e000, 0x1, 0xca41c5)
	/usr/local/go/src/cmd/compile/internal/gc/typecheck.go:1270 +0x3ece
cmd/compile/internal/gc.typecheck(0xc00034e000, 0x1, 0x3)
	/usr/local/go/src/cmd/compile/internal/gc/typecheck.go:238 +0x6ad
cmd/compile/internal/gc.typecheckslice(0xc0000705a0, 0x1, 0x1, 0x1)
	/usr/local/go/src/cmd/compile/internal/gc/typecheck.go:68 +0x50
cmd/compile/internal/gc.Main(0xcc2180)
	/usr/local/go/src/cmd/compile/internal/gc/main.go:518 +0x2059
main.main()
	/usr/local/go/src/cmd/compile/main.go:51 +0x96
@bmkessler
Copy link
Contributor

This may be a duplicate of #27973

@randall77
Copy link
Contributor

This seems to be fixed at tip.
We could consider a backport to 1.11, but I'm inclined not to for this error, it's pretty obscure.

@ALTree
Copy link
Member

ALTree commented Feb 8, 2019

The fix was already backported to 1.11.2 (#27399). Please upgrade your 1.11 installation to the latest 1.11.5.

Closing here.

@ALTree ALTree closed this as completed Feb 8, 2019
@johanbrandhorst
Copy link
Member

Does this mean the playground is also running an old version of Go?

@ALTree
Copy link
Member

ALTree commented Feb 8, 2019

Does this mean the playground is also running an old version of Go?

Yes: https://play.golang.org/p/1VcPUlPk_3

It's currently on 1.11.1.

@golang golang locked and limited conversation to collaborators Feb 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants