signal handling and save world

Matthew Fluet mfluet@intertrust.com
Fri, 1 Jun 2001 17:56:10 -0700 (PDT)


In playing with the profiler, I thought I would try profiling mlton.  I
discovered one thing -- the profiler signal handler is not installed when
restoring a world.  I migrated /src/runtime/gc.c#initSignalStack from
GC_init to GC_initCounters so that it is invoked when restoring a world.
This was probably a bug -- because there's no reason that receiving a
signal when %esp is pointing to non-stack code can't happen when running a
restored world.  It should also now start and use the profiler when
running a restored world.

Although I hadn't thought of it before, I guess that when restoring a
world, none of the handlers installed in the previous run will be
installed.  Just struck me as interesting that that aspect of the state of
the program won't be restored.