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
ocamlopt.opt on aarch64 runs out of memory compiling camlp4 #6486
Comments
Comment author: @mshinwell Ensure that the compiler is being built with -g, in the toplevel Makefile. |
Comment author: Richard Jones I gave up trying to bisect this bug as there is no git commit which is "good" on arm64. Back to debugging it the old fashioned way. The stack trace from 'exit' is: #0 0x000003ffb7d68794 in exit () from /lib64/libc.so.6 That looks like a very big allocation. (gdb) frame 3 Looks like some kind of stack frame corruption to me. |
Comment author: @mshinwell Oh dear. Looks like corruption of the OCaml heap. I suspect something has clobbered the header of the block [v]. It might be instructive to find out what did that; here is a suggestion.
I'm also wondering if this is actually a duplicate of 6484, although I see that one of these is arm32 and another arm64. Also, is it usually the case that backtraces on aarch64 stop at "caml_call_gc"? If so, that appears to be another bug. Is it possible to have this machine connected to a public IP address? |
Comment author: Richard Jones git bisect is rather unhelpful: There are only 'skip'ped commits left to test. Sorry, no can do re public IP. This machine is under a strict NDA. |
Comment author: @mshinwell One other thing to try: run the offending command in a loop, with varying minor heap sizes (set via OCAMLRUNPARAM) across a large range--say 256k to 100Mb. Use the debug runtime. With any luck, the behaviour will change, and it might trip an assertion earlier. |
Comment author: Richard Jones I have what I believe is a correct git-bisect result: 558f40e is the first bad commit
:100644 100644 9162031faaa1bcb266ddf5e135d982d0f01e0bd6 1d36a9c892753927df5ea95df0b91fe8f8b88299 M .depend |
Comment author: Richard Jones I am able to fix this by a very drastic approach: Turning off CSE entirely. The patch is actually quite small although obviously not generally applicable. However at least I have an idea what's going wrong now (something in asmcomp/arm64/CSE.ml). diff --git a/asmcomp/CSEgen.ml b/asmcomp/CSEgen.ml -method private cse n i = method fundecl f = |
Comment author: @mshinwell Does this fix 6484 as well? |
Comment author: Richard Jones Yes disabling CSE fixes #6484 as well. I tried varying the minor heap size and using the debug runtime, but was not able to hit any assertions. I wasn't able to monitor the heap address for reasons outlined in email. |
Comment author: @xavierleroy The fix for 6484 (commit 15012 on version/4.02, 15013 on trunk) is likely to fix this one too. Let us know how it is going. |
Comment author: Richard Jones Thanks Mark, Xavier. I have confirmed this fixes the camlp4 build on arm64. I will add this to the Fedora compiler and that will give it more exposure and testing (to both 32 and 64 bit ARM) over the next few weeks. |
Original bug ID: 6486
Reporter: Richard Jones
Assigned to: @mshinwell
Status: resolved (set by @mshinwell on 2014-07-18T14:57:02Z)
Resolution: fixed
Priority: high
Severity: crash
Version: 4.02.0+beta1 / +rc1
Target version: 4.02.0+dev
Category: back end (clambda to assembly)
Related to: #6484 #7307
Bug description
Note this is with ocaml 4.02.0 from git (8c1e5cd), on aarch64.
Compiling camlp4 from source gives the error:
Fatal error: out of memory.
Command exited with code 2.
Makefile:9: recipe for target 'byte' failed
make: *** [byte] Error 10
Note it is highly unlike this is really running out of memory,
since the machine has 16 GB of RAM. It's also a real aarch64
machine, not emulation.
There is no core dump. Is there a way to get a core dump at
the point where Out_of_memory is raised?
The text was updated successfully, but these errors were encountered: