My first thought is to catch the panic, but I found it is throw by runtime.throw, not by runtime.panic. Therefore I cannot catch it by recover().
The "freelist empty" error generally means that the garbage collector has
collected a pointer that is still live. The GC put the memory on the
freelist, but then the memory was changed by the program, breaking the
freelist.
My first thought is to catch the panic, but I found it is throw by runtime.throw, not by runtime.panic. Therefore I cannot catch it by recover().
The "freelist empty" error generally means that the garbage collector has
collected a pointer that is still live. The GC put the memory on the
freelist, but then the memory was changed by the program, breaking the
freelist.