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: nil pointer dereference panic in type2 on invalid tp instantiation #49296

Closed
ALTree opened this issue Nov 2, 2021 · 2 comments
Closed
Labels
NeedsFix
Milestone

Comments

@ALTree
Copy link
Member

@ALTree ALTree commented Nov 2, 2021

$ gotip version
go version devel go1.18-58fb05a24a Tue Nov 2 16:19:52 2021 +0000 linux/amd64
package p

func f[T interface{[]int}]() {
	_ = T(1)
}
$ gotip tool compile test.go

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

goroutine 1 [running]:
cmd/compile/internal/types2.(*Checker).handleBailout(0xc000404c60, 0xc000117648)
	/home/alberto/go/src/cmd/compile/internal/types2/check.go:271 +0x8b
panic({0xc955a0, 0x12ecd50})
	/home/alberto/go/src/runtime/panic.go:838 +0x207
cmd/compile/internal/types2.is({0xe79c10?, 0x0?}, 0x2)
	/home/alberto/go/src/cmd/compile/internal/types2/predicates.go:31 +0x48
cmd/compile/internal/types2.isInteger(...)
....

cc @griesemer

@ALTree ALTree added the NeedsInvestigation label Nov 2, 2021
@ALTree ALTree added this to the Go1.18 milestone Nov 2, 2021
@griesemer griesemer self-assigned this Nov 2, 2021
@griesemer griesemer added the NeedsFix label Nov 2, 2021
@griesemer
Copy link
Contributor

@griesemer griesemer commented Nov 2, 2021

Minor oversight. Fix forthcoming.

@gopherbot gopherbot removed the NeedsInvestigation label Nov 2, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Nov 2, 2021

Change https://golang.org/cl/360796 mentions this issue: comd/compile/internal/types2: add missing nil check in const conversion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

3 participants