Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1119049 - ocamlopt.opt segfaults when compiling ounit
Summary: ocamlopt.opt segfaults when compiling ounit
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: ocaml
Version: rawhide
Hardware: armv7hl
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARMTracker 1119081
TreeView+ depends on / blocked
 
Reported: 2014-07-13 15:42 UTC by Richard W.M. Jones
Modified: 2014-07-15 14:50 UTC (History)
3 users (show)

Fixed In Version: ocaml-ounit-2.0.0-4.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-15 14:50:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
core file (14.77 MB, application/octet-stream)
2014-07-13 15:42 UTC, Richard W.M. Jones
no flags Details

Description Richard W.M. Jones 2014-07-13 15:42:01 UTC
Created attachment 917632 [details]
core file

Description of problem:

The build of ocaml-ounit fails on ARM.  ocamlopt.opt segfaults
during the build.

Unfortunately this only happens in Koji (not on my own hardware).
However I was able to capture a coredump (attached).

Version-Release number of selected component (if applicable):

ocaml-4.02.0-0.1.git8c1e5cdf.fc22.armv7hl

How reproducible:

100% (in Koji only)

Steps to Reproduce:
1. Build ocaml-ounit in Rawhide.

Stack trace:


Program terminated with signal SIGSEGV, Segmentation fault.
#0  caml_oldify_mopup () at minor_gc.c:217
217	        Field (new_v, i) = f;
Missing separate debuginfos, use: debuginfo-install glibc-2.19.90-26.fc21.armv7hl libgcc-4.9.0-14.fc21.armv7hl
(gdb) t a a bt

Thread 1 (LWP 389):
#0  caml_oldify_mopup () at minor_gc.c:217
#1  0x0014c308 in caml_empty_minor_heap () at minor_gc.c:237
#2  0x0014c410 in caml_minor_collection () at minor_gc.c:276
#3  0x0014b2b0 in caml_garbage_collection () at signals_asm.c:70
#4  0x0015be1c in caml_call_gc ()
#5  0x00032fac in camlSelectgen__fun_2006 ()
#6  0x00032fac in camlSelectgen__fun_2006 ()
#7  0x00032fac in camlSelectgen__fun_2006 ()
#8  0x00032fac in camlSelectgen__fun_2006 ()
#9  0x00032fac in camlSelectgen__fun_2006 ()
#10 0x00032fac in camlSelectgen__fun_2006 ()
#11 0x00032fac in camlSelectgen__fun_2006 ()
#12 0x00032fac in camlSelectgen__fun_2006 ()
[etc etc]

Comment 1 Richard W.M. Jones 2014-07-13 15:52:29 UTC
I notice the stack is *very* deeply nested here.  I will
try increasing the stack ulimit as we do on ppc64.

Comment 2 Richard W.M. Jones 2014-07-13 16:32:41 UTC
I had it build successfully .. once .. with a huge (262144 KB)
stack limit.  However that wasn't repeatable.

Meanwhile on my local hardware, with an identical compiler and
the default stack (8192 KB) it builds fine every time.

Comment 3 Richard W.M. Jones 2014-07-13 20:02:26 UTC
Upstream bug: http://caml.inria.fr/mantis/view.php?id=6484

Comment 4 Richard W.M. Jones 2014-07-13 20:15:03 UTC
As well as filing the upstream bug, I added a workaround
for the ocaml-ounit build.  Using:

export OCAMLFIND_COMMANDS='ocamlopt=ocamlopt'

causes ocamlfind to run the bytecode version of ocamlopt
instead of the native code version (ocamlopt.opt).  This in
no way cures the code gen bug, but it at least allows us
to build the package on ARM.

http://koji.fedoraproject.org/koji/taskinfo?taskID=7135008

I will leave this bug open until we've tracked down the
cause of the code gen bug.

Comment 5 Richard W.M. Jones 2014-07-15 13:40:47 UTC
It looks as if the new Common Subexpression Elimination (CSE) step of
the compiler is broken on both armv7hl and aarch64.  I have therefore
added a compiler patch to disable CSE entirely on these platforms.

http://pkgs.fedoraproject.org/cgit/ocaml.git/tree/0001-Disable-CSE.patch

Comment 6 Richard W.M. Jones 2014-07-15 14:50:21 UTC
Since ounit now builds without workarounds, I am closing this bug.

Fixed in: ocaml-ounit-2.0.0-4.fc22


Note You need to log in before you can comment on or make changes to this bug.