<div class="gmail_quote">On Fri, Oct 9, 2009 at 5:16 PM, Matthew Fluet <span dir="ltr"><<a href="mailto:mtf@cs.rit.edu" target="_blank">mtf@cs.rit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
But, gmp reallocation bugs aren't always so obvious</blockquote><div><br>It's not a gmp reallocation bug. Here's what I know so far:<br> * The input argument is '1' and the shift is by 128<br> * We have 67 reserve bytes indicated<br>
* There is enough room for 33037511 more limbs, so not at the heap end.<br> * The argument is allocated on the stack<br> * The same parameters work several times before the segfault<br> * gdb shows that the target IntInf has been filled correctly<br>
* /proc/*/maps show the memory address is in a valid range<br> * It is dying on the MPN_ZERO line in mpz/mul_2exp.c<br> * The memory is only 4-byte aligned at the point of failure<br><br>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. <br>
<br>Can you see if adding -align 8 to mlton/Makefile fixes it for you as well, Henry?<br><br></div></div>