[MLton-devel] cygwin segfault

Stephen Weeks MLton@mlton.org
Sun, 4 May 2003 16:22:53 -0700


Hi Mike.  Thanks for your continued efforts to find the problem.  In
the hope that the dll was the problem, I upgraded my Cygwin system to
1.3.21-1, which is the latest version their setup.exe program found.
Sadly, everything still seems to work for me on that.

>From the log you sent

> /tmp/fileQnu7UP.1.S 15657: GC_gc
> Starting gc.  Request 512 nursery bytes and 0 old gen bytes.
> Created heap of size 77,824 at 0x006b0000.
> Major copying GC.
> fromSpace = 0x003e0000 of size 73,728
> toSpace = 0x006b0000 of size 77,824
> Major copying GC done.
> Releasing heap at 0x003e0000 of size 73,728.
> Shrinking heap at 0x006b0000 of size 77,824 to 16,384 bytes.
> Created heap of size 122,880 at 0x003e0000.
> Segmentation fault (core dumped)

it looks to me like the problem is in the growHeap function, which is
trying to grow the heap from 77824 to 122880 bytes.  First, it shrinks
the heap to the amount live, 16384, then it allocates a new heap of
size 122880.  Then it copies from the old heap to the new heap.  Here
is where it looks like the seg fault is, since you saw the pc in the
copy function when you set the breakpoint. 
| > Breakpoint 1, 0x00434fc8 in copy (src=0x632f6563 <Address 
| 0x632f6563 out of
| > boun
| > ds>, dst=0x69776779 <Address 0x69776779 out of bounds>, 
| size=1819094894) at
Unfortunately, the src, dst, and size don't make sense.  In any case,
if the copy succeeded, we should have then see the heap of size 77824
released, but we didn't.

Here's a couple more things I'd like you to try.

Run "mllex @MLton fixed-heap 10m gc-messages --".  This should keep
the runtime from ever having to GC, and should it succeed would
confirm the guess that the bug is somewhere in the runtime.

Rebuild the runtime, turning on various debugging flags.  To do this,
edit gc.c, and set DEBUG, DEBUG_DETAILED, DEBUG_MEM, DEBUG_RESIZING,
and DEBUG_STACKS to TRUE.  Run make, and then place the libmlton.a and
libmlton-gdb.a in the mlton's lib directory (/usr/lib/mlton/self).
Then, recompile and rerun mllex.  Hopefully we'll still get the
segfault and can learn something from it.

If this all looks like the bug is in the growHeap as I am currently
guessing, feel free to put some print statements in that function,
especially in the copy loop, rebuild the runtime, and rerun.

Thanks.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel