Confirmed segfault on 10.8.2 with latest core (108.07.01) and OCaml 4.00.1+short-types.<br><br>On Thursday, November 8, 2012 11:47:21 AM UTC-6, Anil Madhavapeddy wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Looks like another misaligned stack pointer somewhere; two were fixed
<br>already here:
<br><a href="http://caml.inria.fr/mantis/view.php?id=5700" target="_blank">http://caml.inria.fr/mantis/<wbr>view.php?id=5700</a>
<br>
<br>MacOS 10.8 strictly needs a 16-byte aligned stack or else lots of systems
<br>functions decide to throw in the towel (due to them using SSE instructions
<br>by default now).
<br>
<br>#0 0x00007fff8e4ad8a5 in misaligned_stack_error_<wbr>entering_dyld_stub_binder ()
<br>#1 0x0000000000000103 in ?? ()
<br>#2 0x0000000100254068 in caml_absf_mask ()
<br>#3 0x000000010022e923 in caml_raise ()
<br>#4 0x000000010022ec71 in caml_array_bound_error ()
<br>#5 0x000000010000b32a in .L101 ()
<br>
<br>
<br>-a
<br>
<br>On 8 Nov 2012, at 17:16, Markus Mottl <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ivd_zaxjboAJ">markus...@gmail.com</a>> wrote:
<br>
<br>> Should have mentioned that, too: I'm running Mac OS X 10.8.2 with the
<br>> latest XCode version (4.5.2).
<br>>
<br>> On Thu, Nov 8, 2012 at 12:11 PM, Ashish Agarwal <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ivd_zaxjboAJ">agarw...@gmail.com</a>> wrote:
<br>>> I correctly get an exception with OCaml 3.12.1, Core 108.00.02, on Mac OS X
<br>>> 10.7.5.
<br>>>
<br>>> On Thu, Nov 8, 2012 at 12:04 PM, Markus Mottl <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ivd_zaxjboAJ">markus...@gmail.com</a>>
<br>>> wrote:
<br>>>>
<br>>>> Hi,
<br>>>>
<br>>>> I've run into a segfault on Mac OS X with a very trivial program that
<br>>>> basically just links with Jane Street Core. Here is the file <a href="http://test.ml" target="_blank">test.ml</a>:
<br>>>>
<br>>>> ----------
<br>>>> module X = Core
<br>>>>
<br>>>> let () = [||].(0) <- 42
<br>>>> ----------
<br>>>>
<br>>>> You can build it as follows:
<br>>>>
<br>>>> ocamlbuild -use-ocamlfind -cflag -thread -lflag -thread -pkgs core
<br>>>> test.native
<br>>>>
<br>>>> Running test.native will give you a segfault. Here is the stack
<br>>>> backtrace:
<br>>>>
<br>>>> ----------
<br>>>> #0 0x00007fff90fa78a5 in misaligned_stack_error_<wbr>entering_dyld_stub_binder
<br>>>> ()
<br>>>> #1 0x0000000000000103 in ?? ()
<br>>>> #2 0x0000000101c0a088 in pvars ()
<br>>>> #3 0x0000000101bddedd in caml_raise ()
<br>>>> #4 0x0000000101bddf99 in caml_array_bound_error ()
<br>>>> #5 0x00000001019b6aca in .L101 ()
<br>>>> ----------
<br>>>>
<br>>>> The program should just raise an exception due to the illegal array
<br>>>> access. Merely raising an exception directly doesn't trigger the
<br>>>> problem. The program won't segfault either if the "module X = Core"
<br>>>> line is commented out, i.e. Core has to be linked in. Other libraries
<br>>>> apparently also don't cause this issue.
<br>>>>
<br>>>> Could another Mac OS X user here please verify the problem? I'm using
<br>>>> OCaml 4.00.1 with Opam and the latest release of Core in there.
<br>>>>
<br>>>> Maybe somebody more knowledgeable about stack alignment and linking
<br>>>> issues on Mac OS X has an idea what's going wrong here. I suspect
<br>>>> it's a code generation, linking or even runtime issue that may need to
<br>>>> be fixed in the compiler. Or there could be a bug in some module
<br>>>> initialization in Core that is using C-bindings (less likely, I'm not
<br>>>> aware of anything that could cause this).
<br>>>>
<br>>>> Regards,
<br>>>> Markus
<br>>>>
<br>>>> --
<br>>>> Markus Mottl <a href="http://www.ocaml.info" target="_blank">http://www.ocaml.info</a> <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ivd_zaxjboAJ">markus...@gmail.com</a>
<br>>>
<br>>>
<br>>
<br>>
<br>>
<br>> --
<br>> Markus Mottl <a href="http://www.ocaml.info" target="_blank">http://www.ocaml.info</a> <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ivd_zaxjboAJ">markus...@gmail.com</a>
<br>>
<br>
<br></blockquote>