# Ocamlopt segment faulted

**URL:** <https://discuss.ocaml.org/t/ocamlopt-segment-faulted/8346>\
**Category:** Learning\
**Tags:** compiler\
**Created:** [August 22, 2021, 9:37pm UTC](https://discuss.ocaml.org/t/ocamlopt-segment-faulted/8346 "2021-08-22T21:37:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhtprog](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@zhtprog](https://discuss.ocaml.org/u/zhtprog)\
**Post date:** [August 22, 2021, 9:37pm UTC](https://discuss.ocaml.org/t/ocamlopt-segment-faulted/8346/1 "2021-08-22T21:37:31Z")

</div>

While building [my project](https://github.com/htzh/holnat) `ocamlopt` seg faulted. I can run things in `utop` fine. I am on the relatively recent version of 4.10.2. I need a version that supports Apple M1.

I wonder is this is worth reporting to the compiler folks (i.e. open a ticket on Github). Should I try a newer version of compiler first? Which one is considered non-experimental and still supports Apple M1?

---

<div class="post-metadata">

**Author:** ![vlaviron](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vlaviron](https://discuss.ocaml.org/u/vlaviron)\
**Post date:** [August 22, 2021, 10:27pm UTC](https://discuss.ocaml.org/t/ocamlopt-segment-faulted/8346/2 "2021-08-22T22:27:01Z")

</div>

I think the most likely explanation is a Stack Overflow in the compiler that doesn’t get detected correctly on Apple M1 hardware. That the native compiler can run into Stack Overflows on big file is a known bug; the usual workaround is to split the big file into several smaller ones.  
The failure to correctly detect Stack Overflows on the new ARM Macs is also a known bug, but it is being worked on (I don’t think the fix will make it into 4.13 though).

---

<div class="post-metadata">

**Author:** ![zhtprog](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@zhtprog](https://discuss.ocaml.org/u/zhtprog)\
**Post date:** [August 22, 2021, 11:03pm UTC](https://discuss.ocaml.org/t/ocamlopt-segment-faulted/8346/3 "2021-08-22T23:03:17Z")

</div>

Yes splitting the big file “sets.ml” into two solved the problem. Thanks!
