Project

General

Profile

« Previous | Next » 

Revision 0610f1b0

Added by peterzhu2118 (Peter Zhu) 10 months ago

Fix crash when GC runs during finalizers at shutdown

We need to remove from the finalizer_table after running all the
finalizers because GC could trigger during the finalizer which could
reclaim the finalizer table array.

The following code crashes:

1_000_000.times do
  o = Object.new
  ObjectSpace.define_finalizer(o, proc { })
end