简体   繁体   中英

Why do OCaml binaries crash on Mac OS X 10.8 (Mountain Lion)?

OCaml programs which worked perfectly on Lion fail on Mountain Lion, segfaulting on startup in OCaml runtime code:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x00007fff908e1f88 in large_malloc ()

There appears to be a widespread problem with the native-compiled ( ocamlopt ) OCaml runtime when backtraces are enabled which is new to Mountain Lion. This same crash affects the startup of any OCaml binaries which are:

  • Native compiled (as opposed to bytecode)
  • Run with backtraces enabled (eg via OCAMLRUNPARAM=b )

This even includes parts of the OCaml compiler toolchain, itself, which will suddenly stop working after an upgrade to 10.8.

This still affects the OCaml SVN trunk (4.01.dev) as of 2012-07-19 .

The workaround is to disabled backtraces when working with native compiled binaries (unset OCAMLRUNPARAM , or remove b from your parameter string).

update :
The underlying bug appears to be due to insufficient stack alignment in the OCaml runtime implementation. Since the originally post, this is now being tracked and fixed on the OCaml bug tracker . For now, however, the workaround remains the only simple choice.

这个问题可以得到解决,有一个解释,一个补丁这里 OCaml中的错误追踪系统。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM