[MLton] bug in new runtime: signalIsPending misalignment

Stephen Weeks sweeks@sweeks.com
Mon, 26 Jun 2006 01:10:52 -0700


The Sparc/Solaris port of the new runtime is almost done.  One
remaining bug deals with the signalIsPending field of GC_signalsInfo,
which looks like:

struct GC_signalsInfo {
  bool amInSignalHandler;   
  bool gcSignalHandled;
  bool gcSignalPending;
  volatile bool signalIsPending; 
...
}

The problem is that signalIsPending is one byte and is aligned 3 mod
4.  However, MLton thinks that signalIsPending is a word (see
backend/rep-type.fun), and accesses it as such.  This is wrong because
it gets too many bits and, even worse, causes a bus error on sparc due
to misalignment.