Re: MLton on OS X El Capitan
Matthew Fluet <[email protected]> Thu, 14 Apr 2016 06:47:44 -0400
| Newsgroups | gmane.comp.lang.ml.mlton.user |
|---|---|
| Message-ID | <CAMrhFL6GZBHM+LV_xW6JR2GFKMevpxNYy-8d8y-tZun9SMPKRg@mail.gmail.com> |
On Thu, Apr 14, 2016 at 12:21 AM, Christopher Harris <[email protected]> wrote: > Originally when compiling with mlton, I would get a seg fault when trying to > execute a "load-world" on Mac OS X El Capitan. I found an old thread > detailing compiling mlton with "-link-opt -fno-pie", which no longer gives > me a seg fault, but now responds with "Invalid world: wrong magic number". I > saw the commit in the source which essentially implies wrong FDs in the > saved heap vs executable. Any ideas where I am going wrong? It doesn't sound like you are doing anything wrong. Note that the magic number is just a random number generated when compiling the program and written into any world it saves and checked against any world it loads; it is a (weak) defense against loading a world generated by one executable into a different executable (where it wouldn't make any sense). A world is not a persistent storage mechanism --- you can't save a world, edit/update your program, recompile, and load the world to restore data. I was able to build and execute the simple save-world example program (see http://mlton.org/MLtonWorld) on my current MacOSX system: [mtf@uller tmp]$ cat save-world.sml open MLton.World val _ = case save "world" of Original => print "I am the original\n" | Clone => print "I am the clone\n" [mtf@uller tmp]$ mlton -link-opt -fno-pie save-world.sml [mtf@uller tmp]$ ./save-world I am the original [mtf@uller tmp]$ ./save-world @MLton load-world world -- I am the clone -- You received this message because you are subscribed to the Google Groups "MLton-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z