[MLton] Sparc+linux

Matthew Fluet fluet@cs.cornell.edu
Sun, 19 Dec 2004 10:58:24 -0500 (EST)


>          closureConvert starting
>             flow analysis starting
>             flow analysis finished in 0.03 + 0.00 (0% GC)
>             free variables starting
>             free variables finished in 0.02 + 0.00 (0% GC)
>             globalize starting
>             globalize finished in 0.01 + 0.00 (0% GC)
>             convert starting
>             convert raised in 0.01 + 0.00 (0% GC)
>          closureConvert raised in 0.08 + 0.00 (0% GC)
>       pre codegen raised in 28.08 + 5.02 (15% GC)
>    Compile SML raised in 28.08 + 5.02 (15% GC)
> MLton raised in 28.09 + 5.02 (15% GC)
> shrinker raised unhandled exception: Subscript
>
> I've tried placing guards at every .sub in
> closure-convert/closure-convert.fun, and I get nothing. Thus, I think the
> exception is either in error, or coming from another file. How can I get a
> more detailed stack trace of where the exception was thrown?

The log above says that the exception is originating in the shrinker
(ssa/shrink.fun), which is called by closure-convert/closure-convert.fun
line 105.

I would suggest changing ssa/shrink.fun at line 1278 to read:

      fn f => (traceShrinkFunction s (eliminateUselessProfile f)
	       handle e => (Error.bug (concat ["shrinker raised ",
					       Layout.toString (Exn.layout e),
					       "\n\t",
					       concat (List.separate
						       (Exn.history e, "\n\t"))])
			    ; raise e))

and building the compiler with -exn-history true.  You'll get a slower
compiler, but you'll see the origin of the subscript exception.

> Does anyone have ideas as to what might cause this?

Not really.  That's a very unusual place to get a bug when porting to a
new platform.