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

Comments

Projects
None yet
5 participants
@kwoodhouse93
Copy link

commented Feb 8, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2019

This may be a duplicate of #27973

@randall77

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2019

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

This comment has been minimized.

Copy link
Member

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 Feb 8, 2019

@johanbrandhorst

This comment has been minimized.

Copy link
Member

commented Feb 8, 2019

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

@ALTree

This comment has been minimized.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.