[MLton] power pc "port"

Matthew Fluet fluet@cs.cornell.edu
Fri, 3 Sep 2004 23:16:12 -0400 (EDT)


> I rebuilt with -exn-history true, and here's what I got.
>
> with history:
>         <basis>/arrays-and-vectors/sequence.fun 107.16
>
> (By the way this is the sub function that's failing on a bounds check.)
>
> My first question would be, is there any way to get a full stack trace?

Not really.

> Anyway, I investigated further by adding some tracing to
> fixed-integer.sml.  Turns out that this exception is occurring on the very
> first test (Int2), in the very beginning where it tries to do
> Int2.toString.  From there, I've been trying to figure out exactly how
> toString gets to sub - with not very much luck.

That's not too hard to see:
  Int2.toString calls
  Int8.toString calls
  Int8.fmt which does a bunch of operations on CharArray.array,
  which are built by the sequence functor.

As to why it's failing the bounds check, I can't say.

> Is there a document I can look at for hints on debugging this kind of
> stuff?  My gut instinct is to slap print statements into the basis, in
> places where I think that things are going wrong... is this the best way
> to go?  Or is there a better way?

The first thing I would try is to look at the rest of the regression
tests.  You should be able to make it past modules now.  There is always a
chance that multiple regression failures arise from the same underlying
problem and you can "triangulate" from them.

I'm especially curious to know if the int.sml regession has any failures.
I notice that the formatting routine needs to perform Int8.quot and
Int8.rem.  Those are an obvious candidate for problems when moving to a
new architecture.