-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Program failure when using OCaml + M1 Mac Intel Emulator #13096
Comments
Thanks for the report @rbwilson-maker What version of macOS, opam and OCaml are you using? Running these commands in a Terminal will give you that information. $ sw_vers
$ opam --version
$ ocaml --version
$ opam list |grep core Are you able to provide a minimal program using that code which will trigger the behaviour? These issues golang/go#42700 and dotnet/runtime#44958 suggest it might be caused by Rosetta bugs and/or interactions with signals. |
Potentially related to #12766 both issues need further investigation. |
@tmcgilchrist
The reason I am using rosetta is an accident. I installed opam with homebrew and for some reason my version of brew is
I suspect this was from porting over my old computer to this M1 Mac. I was unaware I was using this version of brew until I encountered this bug. Reinstalling the arm64 version of everything is plausible but seems dangerous for me at this point since I don’t want to ruin my environment while I still have many things to get done. As for a minimal program. I don’t have time to experiment right now, but can work on that later. All I know is that the segment of code above, when removed from my program, no longer causes the bug, and when placed in or rewritten in a few ways with the same logic, always causes the bug. So I have definitely isolated it to that segment of code. |
The same issue was found with the language Julia here |
Could you try creating an opam switch with 4.14.1 and re-running the code on that? # Create an empty 4.14 switch
$ opam switch create 4.14.1 --no-install
# Enable that switch in your current shell
$ eval $(opam env --switch="4.14.1" --set-switch)
# Then whatever commands you're using to install dependencies.
# You might need to install specific versions like `opam install core.v0.14.1` to match your current versions. Unfortunately I don't currently have a Mac setup with a rosetta version of brew/opam/ocaml to debug this. Is the compiler project available as open source possibly? Doing some research suggests there are rosetta bug fixes that might fix this issue if you're able to update. |
The compiler will hopefully be made open source when it’s done in about 2 weeks then I can return to testing this. Thanks for the help, i’ll try the opam switch, and potential rosetta update. Are you able to link any of the particular rosetta bug fixes you were looking at? |
I encountered a strange bug which prevents me from running my OCaml code.
My system:
Chip: Apple M1 Pro
Opam Version
Mach-O 64-bit executable x86_64
OCaml Version:
Mach-O 64-bit executable x86_64
Opam was installed using brew, which for some reason was also an intel version.
When I run my OCaml program (it’s a large program, a compiler) it sometimes hangs with this error:
This bug was introduced into my code only after I added this segment of code:
I am using the Jane Street
Core
libraryWhen I remove this block of code, the issue no longer appears. I have encountered this bug in no other scenarios, only this one.
The text was updated successfully, but these errors were encountered: