You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/compile: runtime panic due to bad devirtualization #43292
This program should run without crashing, but currently panics at tip:
package main
type I interface { M() chan int }
type A int
func (A) M() chan int { return nil }
type B int
func (B) M() chan int { return nil }
func main() {
c := I(A(0))
b := make(chan I, 1)
b <- B(0)
for i := 0; i < 2; i++ {
select {
case c = <-b:
case <-c.M():
default:
}
}
}
(Other options are available if you click the "DOWNLOAD" link at golang.org/cl/279352, but they all amount to fetching that commit ref and then using some git command.)
Success! The use case I reported in #42284 (comment) no longer panics:
$ ~/Code/go/bin/go versiongo version devel +00468b24ae Sun Dec 20 01:16:30 2020 -0800 darwin/arm64
$ ~/Code/go/bin/go run main.go2020/12/20 20:41:45 online
Activity
mdempsky commentedon Dec 20, 2020
The issue is
reassigneddoesn't check forOSELRECV/OSELRECV2.mdempsky commentedon Dec 20, 2020
We weren't checking
OAS2RECVeither. :(gopherbot commentedon Dec 20, 2020
Change https://golang.org/cl/279352 mentions this issue:
cmd/compile: recognize reassignments involving receivesmdempsky commentedon Dec 20, 2020
@kivikakk I believe CL 279352 should fix your issue. Can you try testing that for me please?
In case you're not familiar with Gerrit, the procedure to fetch and checkout the change locally are:
(Other options are available if you click the "DOWNLOAD" link at golang.org/cl/279352, but they all amount to fetching that commit ref and then using some git command.)
kivikakk commentedon Dec 20, 2020
Fetching and compiling now, will report back shortly 👍
kivikakk commentedon Dec 20, 2020
Success! The use case I reported in #42284 (comment) no longer panics:
mdempsky commentedon Dec 20, 2020
@kivikakk Great, thank you for confirming, and again for the report! I've submitted the fix. Cheers.
cmd/compile: recognize reassignments involving receives