Re: MLton on OS X El Capitan
Rob Arthan <[email protected]> Thu, 14 Apr 2016 17:20:16 +0100
| Newsgroups | gmane.comp.lang.ml.mlton.user |
|---|---|
| Message-ID | <[email protected]> |
I see the same behaviour on El Capitan as you, but it is consistent with what Matthew said: you've generated a world and then recompiled your program, so you can't load the old world into the new executable. If you run save-world with no arguments after recompiling you get a new world that you can load into the new executable. Regards, Rob. > On 14 Apr 2016, at 14:59, Christopher Harris <[email protected]> wrote: > > Interesting. Are you on El Capitan? I am getting the same error with the small example. > > $ 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" > > $ mlton -link-opt -fno-PIE save-world.sml > $ ./save-world @MLton load-world world -- > Invalid world: wrong magic number. > > I should note I have installed 2010 x64 static GMP version. I simply unzipped the tarball and put it in /usr/local. Do I need 2013? > > On Thu, Apr 14, 2016 at 5:49 AM, Matthew Fluet <[email protected]> wrote: > Sorry, the mailing list defaults to replying to the mailing list (not > replying to all). > > > ---------- Forwarded message ---------- > From: Matthew Fluet <[email protected]> > Date: Thu, Apr 14, 2016 at 6:47 AM > Subject: Re: [MLton-user] MLton on OS X El Capitan > To: MLton users <[email protected]> > Cc: Victor Winter <[email protected]> > > > 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_______________________________________________ > MLton-user mailing list > [email protected]; [email protected] > https://lists.sourceforge.net/lists/listinfo/mlton-user -- 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