Re: [MLton] strange gc message

Matthew Fluet <[email protected]> Tue, 17 Nov 2015 22:21:14 -0500
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <CAMrhFL46QmL2zhqR6nfUb6A=vP0oqcaQQC_yL1VZhc_xw8TrTg@mail.gmail.com>
On Tue, Nov 17, 2015 at 9:58 AM, Bernard Berthomieu <[email protected]> wrote:
> Hello,
>
> I'm having a segfault with one of my applications compiled by mlton.
>
> I'm using mlton from the git head, as of september 28, on a amd64-linux
> machine, but the same problem happens with the 2013 or 2010 mlton
> release.  Also, my application makes use of ffi.
>
> Running my application with @MLton gc-messages -- , the last
> gc message printed before the segmentation fault is:
>
> [GC: Starting gc #11; requesting 512 nursery bytes and 0 old-gen bytes,]
> [GC:    heap at 0x0000080000000000 of size 942,080 bytes (+ 8,192 bytes card/cross map),]
> [GC:    with old-gen of size 110,000 bytes (11.7% of heap),]
> [GC:    and nursery of size 832,080 bytes (88.3% of heap),]
> [GC:    and nursery using 831,576 bytes (88.3% of heap, 99.9% of nursery).]
> [GC: Created heap at 0x00007f57fe7e8000 of size 942,080 bytes (+ 8,192 bytes card/cross map).]
> [GC: Starting major Cheney-copy;]
> [GC:    from heap at 0x0000080000000000 of size 942,080 bytes,]
> [GC:    to heap at 0x00007f57fe7e8000 of size 942,080 bytes.]
> [GC: Shrinking stack of size 256 bytes to size 128 bytes, using 128 bytes.]
> [GC: Shrinking stack of size 4,544 bytes to size 2,720 bytes, using 480 bytes.]
> [GC: Shrinking stack of size 256 bytes to size 128 bytes, using 128 bytes.]
> [GC: Shrinking stack of size 735 bytes to size 0 bytes, using 18,446,744,073,709,551,615 bytes.]
>
> The last line seems suspicious to me ...  is it ?

Yes, that last line is clearly bogus.  Seems like the pointer to the
top of the ML stack got corrupted, which broke the computation of the
bytes of stack used.

Do you have gc#10 messages available?

Have you tried compiling your program with "-debug true"?  That might
trip an assert.

Can you reproduce with source code you can share?

------------------------------------------------------------------------------