Bug 28025 - ocaml won't build
Bug#: 28025 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: george@gentoo.org Reported By: nathanm_mn@yahoo.com
Component: Development
URL: 
Summary: ocaml won't build
Keywords:  
Status Whiteboard: 
Opened: 2003-09-05 18:03 0000
Description:   Opened: 2003-09-05 18:03 0000
When I try to emerge ocaml it locks up the entire OS at the same point (I've
tried a half dozen times).

Reproducible: Always
Steps to Reproduce:
1. emerge ocaml
OR
1. emerge dev-lang/ocaml-3.06
OR
1. emerge dev-lang/ocaml-3.06-r1
Actual Results:  
Where it locks up:
===============================================================================
sh ./runocamldoc true -man -d stdlib_man -I ../parsing -I ../utils -I ../typing
-I ../driver -I ../bytecomp -I ../tools -I ../toplevel/ -I ../stdlib -I
../otherlibs/str -I ../otherlibs/dynlink -I ../otherlibs/unix -I
../otherlibs/num ../otherlibs/graph \
-t "OCaml library" -man-mini \
../stdlib/*.mli ../otherlibs/unix/unix/mli ../otherlibs/str/str.mli
../otherlibs/bigarray/bigarray.mli ../otherlibs/num/num.mli

Expected Results:  
properly built ocaml

Portage 2.0.49-r3 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.20-gentoo-r6)
=================================================================
System uname: 2.4.20-gentoo-r6 i586 Mobile Pentium MMX
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium-mmx -O3 -pipe"
CHOST="i586-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium-mmx -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 oss apm arts avi crypt cups encode foomaticdb gif jpeg kde gnome libg++
mad mikmod mpeg ncurses nls oggvorbis pdflib png quicktime sdl spell svga xml2
xmms xv zlib gdbm berkdb slang readline tcltk java gpm tcpd pam libwww ssl perl
python imlib qt motif opengl gtk mmx truetype X"

------- Comment #1 From George Shapovalov 2003-09-07 20:59:32 0000 -------
Hi Nathan.

Well, I cannot reproduce the problem (and I tried both my "standard aggressive" and your C[XX]FLAGS), and apparently other people cannot either, as this package saw some activity recently. But then, hanging your system - that's not a normal gcc behavior, even when some bug gets triggered.

So, suspicions in the order of likelyhood:

1. Hardware problem. Especially considering that you are building it on a rather old laptop (jubdging from the cpuinfo) and that you C[XX]FLAGS are rather mild. So, does your system freeze *always* at the same point? Did you recently check your memory? (emerge memtest86)
Even if freezes happen consistently at the same point, it still can be a hardware problem, caused by excessive heat (most likely, #2 is "slightly" faulty memory) at the "very intensive calculations" point.

2. Some weird gcc/glibc inconsistency triggered by some ocaml specific code. Few questions related to this situation:
Does freeze happen abruptly, or is it rather gradual (general system responsiveness goes down, more swapping taking place, etc)? Is VM getting progressively eaten? (start vmstat and keep an eye on its output duringc ompilation).

If #2 is indeed the case you can try to alleviate the problem:
Remerge glibc/gcc (or best of all system). In a very severre situation you might need to start from bootstrapping, but if everything else works you are not likely to need this.
Add userpriv, usersandbox to your FEATURES. This will force all builds be done as user portage and not root. Should ease a trouble caused by memory leaks and such (at least your system won't come down completely).

Ok, these are couple of suggestions. Please let me know what happens.

George

------- Comment #2 From Nathan Machula 2003-09-10 14:59:51 0000 -------
Thanks for the tips! Unfortunately they didn't help. My memory tested fine. It
does always lock up at the same place, but the laptop always runs hot, I even
set it on 2 blocks so air would circulate better underneath it. It isn't likely
to be overheating though, I bootstrapped the laptop from stage 1 and it worked
fine (took a few days though). I re-emerged gcc & glibc, tried userpriv &
usersandbox, but nothing changed. I also emerged distcc to try to offload some
of the work onto my Athlon XP 2400 desktop, but I couldn't get that working. In
the end I just installed a binary rpm of ocaml.

------- Comment #3 From Axel Gneiting 2003-09-11 07:00:29 0000 -------
I have the same problem on a Pentium 2 system
I've done a emerge -e ocaml but with no success

ocaml-3.07 beta 2 from the ocaml website builds without a problem

------- Comment #4 From Lukasz Glaz 2003-09-11 08:38:50 0000 -------
I have the same problem on two computers which I was trying to use for sharing
internet connection (Pentium Pro 200 MHz and AMD K6-2 300 MHz). But on my
computer I use as a desktop (AMD Athlon XP 2000+) it compiles without problems.
The two first computers don't have X installed. When I try to compile ocaml the
the computer seems to be hang but when I wait for a long time this message
appears (after num.mli):

sh ./runocamldoc true -man -d stdlib_man -I ../parsing -I ../utils -I ../typing
-I ../driver -I ../bytecomp -I ../tools -I ../toplevel/ -I ../stdlib -I
../otherlibs/str -I ../otherlibs/dynlink -I ../otherlibs/unix -I
../otherlibs/num -I ../otherlibs/graph \
-t "OCaml library" -man-mini \
../stdlib/*.mli ../otherlibs/unix/unix.mli ../otherlibs/str/str.mli
../otherlibs/bigarray/bigarray.mli ../otherlibs/num/num.mli
make[1]: *** [stdlib_man/Pervasives.o] Terminated
make[1]: Leaving directory
'/var/tmp/portage/ocaml-3.06/work/ocaml-3.06/ocamldoc'

make: *** [ocamldoc] Error 2

!!! ERROR: dev-lang/ocaml-3.06 failed.
!!! Function src_compile, Line 30, Exitcode 2
!!! (no error message)

------- Comment #5 From George Shapovalov 2003-09-11 17:58:41 0000 -------
Ok, finally someting :).

Nathan, Axel: do you system also lack X by chance? Although looking from the use flags it does not look this way.

Anyway, Axel: thanks for a report on new beta, I added the corresponding ebuild to the tree. Everybody please test!

As an added bonus this beta works fine with new tcl/tk, so one of the patches is no longer necessary. Still I would like to get some testing on sparc platform if possible - one patch is carried over but I have no way to check if it still works or is even necessary.

George

------- Comment #6 From Lukasz Glaz 2003-09-14 14:30:18 0000 -------
I've tried new beta and it emerges without error. But then I cannot emerge
mldonkey :( It says that objective ocaml 3.06 is required.

------- Comment #7 From George Shapovalov 2003-09-14 21:36:08 0000 -------
Thanks for testing!
I think this is gonna be it for ocaml - I would not like to rush this version into stable, as it is beta. Well, if this problem becomes really common I will, but I'll try to keep it as it is now for a while (you can copy it to your OVERLAY and unmask there if you wish).

As for mldonkey: AFAICS this happens bacause the ebuild passes hardwired --enable-ocamlver=3.06 while it has >= in DEPEND.
Please submit corresponding bug to bugzilla, as I am not handling this package or category. You should be able to asign it directly to Caleb Tennis <caleb@gentoo.org> as I see him pretty much exclusively in ChangeLog.

George

------- Comment #8 From George Shapovalov 2003-10-06 13:15:01 0000 -------
Reclosing the bug.
Also looks like 3.07 is out already.

George