-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
> What steps will reproduce the problem? package main import "runtime" func main() { c := make(chan bool) func() { type X struct { next *X } fin := func(_ *X) { c <- true } x := new(X) x.next = x runtime.SetFinalizer(x, fin) x1 := new(X) x2 := new(X) x1.next = x2 x2.next = x1 runtime.SetFinalizer(x1, fin) runtime.SetFinalizer(x2, fin) }() go func() { for { runtime.GC() runtime.Gosched() } }() <-c <-c <-c } > What is the expected output? What do you see instead? The program must terminate. The program hangs. > Please use labels and text to provide additional information. gc/linux/amd64 10044:c587bcb93290 tip