[MLton] latest MLton segfault in gmp

Wesley W. Terpstra wesley at terpstra.ca
Sat Oct 10 13:27:49 PDT 2009


 On Fri, Oct 9, 2009 at 5:16 PM, Matthew Fluet <mtf at cs.rit.edu> wrote:

> But, gmp reallocation bugs aren't always so obvious


It's not a gmp reallocation bug. Here's what I know so far:
  * The input argument is '1' and the shift is by 128
  * We have 67 reserve bytes indicated
  * There is enough room for 33037511 more limbs, so not at the heap end.
  * The argument is allocated on the stack
  * The same parameters work several times before the segfault
  * gdb shows that the target IntInf has been filled correctly
  * /proc/*/maps show the memory address is in a valid range
  * It is dying on the MPN_ZERO line in mpz/mul_2exp.c
  * The memory is only 4-byte aligned at the point of failure

I've tried compiling with -align 8 and then it works... I'm not sure this is
a solution, though; it may have just masked the problem.

Can you see if adding -align 8 to mlton/Makefile fixes it for you as well,
Henry?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20091010/c2506101/attachment.html


More information about the MLton mailing list