[MLton-devel] FW: cygwin segfault

Stephen Weeks MLton@mlton.org
Tue, 13 May 2003 22:26:15 -0700


> How do I get that missing symbol "_Thread_returnToC"?

It was a bug that only showed up on Cygwin, where MLton needs to
prefix symbols with _.  But we forgot to do it in one place.  I've
fixed it.

> $ mlton -stop o ffi.c
> 
> gives me "ffi.1.o" rather than "ffi.o"!

Yeah, that was an accidental change in behavior recently introduced.
I changed it back.

You can get both of the fixes with latest experimental release,
20030513, available at

	http://www.mlton.org/experimental

One other change in this release that is relevant -- instead of using
'include "mlton.h"' in the ffi.h, use 'include "libmlton.h"'.

This release also includes the new MLton.Finalize structure, which may
come in handy with C/SML programming.

Also, I wanted to point out that the ffi function in ffi.c that you
sent isn't safe because it holds two ML pointers, a1 and a2, live
across MLton_callFromC, which (like any SML code), may do a GC,
invalidating the pointers.  One way to test for such problems is to
compile main.sml with "-gc-check first", which causes a GC to occur at
every GC point the first time it is reached.  If you do that, you will
(correctly) see a segfault.

I hope things begin to work a little better.

Now, back to FFI and OpenGL :-).


-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com

_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel