[MLton] MLton broken FFI on AMD64???

Wesley W. Terpstra wesley at terpstra.ca
Fri Feb 4 00:32:00 PST 2011


On Thu, Feb 3, 2011 at 11:46 PM, Henry Cejtin <henry.cejtin at sbcglobal.net>wrote:

> The following program segfaults when run:
>
>    val printf = _import "printf": string * int -> unit;
>    val () = printf ("You are a dog %d0000", 99)
>    val () = printf ("Hello silly %d0000", 123)
>

My first answer was: null terminate your string.

However, the segfault persists. If you replace "printf" with "test":
void test(const char* s, int x) {
  printf(s, x);
}
... it works.

The problem also only appears for me when I target amd64. i386 works.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20110204/22c10826/attachment.htm


More information about the MLton mailing list