[MLton] latest MLton segfault in gmp

Matthew Fluet mtf at cs.rit.edu
Thu Oct 8 19:21:29 PDT 2009


On Thu, 8 Oct 2009, Henry Cejtin wrote:
> Running  under  Debian  testing, I grabbed the latest MLton from SVN and
> compiled it (using the last  official  MLton:  20070826)  on  an  AMD-64
> machine.
>
> The  make  couldn't finish because the resulting mlton-compile segfaults
> compiling mllex.mlb.  In fact, that mlton-compile always segfaults, even
> compiling  a  hello-world.sml.   The gdb traceback shows that it died in
> __gmpz_mul_2exp().
>
> The version of gmp that I have is 2:4.3.1+dfsg-3.
>
> Any ideas or suggestions?

Can you run through the regression suite with mlton-20070826?  That would 
determine if it is a pervasive problem with gmp on all programs with 
IntInf.  There was a bug with the bytes-needed calculation for 
IntInf.~>>, identified and fixed by Wesley in r7083,r7084,r7085:

--- a/basis-library/integer/int-inf0.sml
+++ b/basis-library/integer/int-inf0.sml
@@ -1203,7 +1203,7 @@ structure IntInf =
              if shift = 0wx0
                 then arg
                 else Prim.~>> (arg, shift,
-                              reserve (S.max (1, S.- (numLimbs arg, shiftSize shift)), 0))
+                              reserve (S.max (0, S.- (numLimbs arg, shiftSize shift)), 1))
        end

        fun mkBigCvt {base: Int32.int,

Perhaps there is a similar bug for IntInf.<<, though it looks o.k. to me.





More information about the MLton mailing list