[MLton] Crash "Vector.foldi2From" with MLton 20070826

Matthew Fluet fluet at tti-c.org
Mon Sep 8 10:18:32 PDT 2008


On Mon, 8 Sep 2008, Nicolas Bertolotti wrote:
>> If there is an internal compiler error, always try compiling with
>> '-type-check true'.  An error like the above is usually indicative of the
>> IL program being ill-formed.  For example, Vector.foldi2From is used by
>> Vector.foreach, which is used by removeUnused to process matching vectors
>> of actuals and formals; a mismatch in the lengths of the actuals and
>> formals triggers the error in Vector.foldi2From, but the real error is
>> that the IL is ill-formed: the lengths of the actuals and formals in a
>> well-typed IL program should always be equal.  If the IL program is
>> ill-formed, then the bug is actually an earlier pass that produced an
>> ill-formed program.  Compiling with '-type-check true' should reveal which
>> pass produced an ill-typed IL program.
>
> Thanks for the hint.
>
> I relaunched with the option and here is what I have now :
> "
>         ssaSimplify starting
> ...
>            redundant starting
>            redundant finished in 0.53 + 0.00 (0% GC)
>            post.ssa size is 46,241,204 bytes
>            numPeeks = 939036180
>            maxLength = 4
>            average position in property list = 0.665
>            numPeeks = 9202801
>            average position in bucket = 1.490
>            typeCheck starting
>               typeCheck starting
>                  checkScopes starting
>                  checkScopes finished in 0.49 + 0.00 (0% GC)
> Type error: analyze raised exception Analyze.coerces length mismatch: returns
>
>               typeCheck raised in 0.68 + 0.78 (54% GC)
> "
>
> Is there any way to trace the execution of the "redundant" phase ?

Compile with '-keep-pass redundant -diag-pass redundant' will save the 
input and output IL programs (foo.redundant.pre.ssa; 
foo.redundant.post.ssa), as well as a diagnostic file 
(foo.redundant.diagostic).




More information about the MLton mailing list