Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 292534 - dev-java/gnu-classpath-0.98-r1 fails to compile because of java.lang.OutOfMemoryError: Java heap space
Summary: dev-java/gnu-classpath-0.98-r1 fails to compile because of java.lang.OutOfMem...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on: 293007
Blocks:
  Show dependency tree
 
Reported: 2009-11-09 15:28 UTC by Juergen Rose
Modified: 2009-11-13 23:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/tmp/portage/dev-java/gnu-classpath-0.98-r1/temp/build.log (build.log,23.59 KB, text/plain)
2009-11-09 15:29 UTC, Juergen Rose
Details
/var/tmp/portage/dev-java/gnu-classpath-0.98-r1/temp/environment (environment,173.55 KB, text/plain)
2009-11-09 15:30 UTC, Juergen Rose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2009-11-09 15:28:39 UTC
'emerge gnu-classpath' fails with:
...
make[1]: Entering directory `/var/tmp/portage/dev-java/gnu-classpath-0.98-r1/work/classpath-0.98/lib'
/bin/mkdir -p ../gnu/java/locale
true
../scripts/generate-locale-list.sh > ../gnu/java/locale/LocaleData.java
top_builddir=.. top_srcdir=.. /bin/sh ./gen-classlist.sh standard
Adding java source files from srcdir '..'.
Adding java source files from VM directory ../vm/reference
/usr/bin/ecj-3.3 -nowarn -J-Xmx768M -source 1.5 -target 1.5 -bootclasspath '' -classpath ../vm/reference:..:../external/w3c_dom:../external/sax:../external/relaxngDatatype:../external/jsr166:.:: -d . @classes
touch resources
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2882)
        at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
        at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
        at java.lang.StringBuilder.append(StringBuilder.java:119)
        at java.lang.Throwable.toString(Throwable.java:344)
        at java.lang.String.valueOf(String.java:2826)
        at java.io.PrintWriter.println(PrintWriter.java:710)
        at java.lang.Throwable.printStackTrace(Throwable.java:509)
        at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:461)
        at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:411)
        at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:3410)
        at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1607)
        at org.eclipse.jdt.internal.compiler.batch.Main.main(Main.java:1264)
make[1]: *** [compile-classes] Error 1
make[1]: Leaving directory `/var/tmp/portage/dev-java/gnu-classpath-0.98-r1/work/classpath-0.98/lib'
make: *** [all-recursive] Error 1
...
GENTOO_VM=sun-jdk-1.6  CLASSPATH="" JAVA_HOME="/opt/sun-jdk-1.6.0.17"
JAVACFLAGS="-nowarn" COMPILER=""


The strange thing is, that 'emerge gnu-classpath' shows JAVA_HOME="/opt/sun-jdk-1.6.0.17", even if I select IcedTea6-bin 1.6.1 as VM. 
I can still provide the following information with respect to my JAVA environment;
cheetah ~ # echo $JAVA_HOME
/etc/java-config-2/current-system-vm
cheetah ~ # ll /etc/java-config-2/current-system-vm
lrwxrwxrwx 1 root root 24 Nov  9 15:03 /etc/java-config-2/current-system-vm -> /usr/lib/jvm/sun-jdk-1.6/
root@cheetah:/root(58)# java-config -L
The following VMs are available for generation-2:
1)      IcedTea6-bin 1.6.1 [icedtea6-bin]
2)      Sun JDK 1.5.0.21 [sun-jdk-1.5]
*)      Sun JDK 1.6.0.17 [sun-jdk-1.6]


Reproducible: Always




cheetah ~ # emerge --info
Portage 2.1.7.4 (default/linux/x86/10.0/desktop, gcc-4.4.2, glibc-2.11-r0, 2.6.31-gentoo-r4 i686)
=================================================================
System uname: Linux-2.6.31-gentoo-r4-i686-AMD_Athlon-tm-_XP_1800+-with-gentoo-2.0.1
Timestamp of tree: Mon, 09 Nov 2009 14:00:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.4, 3.1.1-r1
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.2-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ rsync://ftp.fi.muni.cz/pub/linux/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo rsync://gd.tuwien.ac.at/opsys/linux/gentoo ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.tu-clausthal.de/pub/linux/gentoo http://gentoo.oregonstate.edu"
LC_ALL="C"
LDFLAGS="-Wl,-O1"
LINGUAS="de fr"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages/"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/n4g /usr/local/portage/layman/java-overlay /usr/local/portage/layman/zugaina /usr/local/portage/layman/suka /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X Xaw3d a52 aac acl acpi administrator afs aiglx alsa amrr ao aotuv apache2 asf aspell atlas auctex audacious audiofile automount bash-completion beagle berkdb bjam blas bluetooth bonobo boo boost branding bzip2 c++ cairo cdda cddb cdf cdio cdparanoia cdr cgi chm cli consolekit corba cracklib cran crypt cups curl cxx daap dbus device-mapper dga dia divx djvu dlloader dmi dns doc dri ds3490 dts dv dvb dvd dvdr dvi dxr3 dynagraph eds effects elf emacs emboss encode epiphany esd evo examples exif expat extra extras fam fame ffmpeg fftw firefox fits flac fltk foomaticdb fortran fpx fuse galago gd gdal gdbm geolocation geos gif gimp gimpprint ginac git glade glib glitz gml gmp gnokii gnome gnome-keyring gnuplot gnutls gphoto2 gpm graphics graphviz gs gsl gsm gstreamer gtk guile hal hardened harness hddtemp hdf hdf5 hlapi http httpd iconv icq icu id3 ide imagemagick imap innodb ipod ipv6 irda irmc ithreads jabber jadetex java java5 java6 jbig john jpeg jpeg2k kde kde4 kerberos kexi keyring kpathsea ladspa lame lapack latex lcms ldap libffi libgda libnotify libsamplerate lirc lm_sensors lua lzo lzw mad maildir mailwrapper math matroska matrox mikmod mmx mmxext mng mod modules mono motif mozdevelop mozilla mozsvg mozxmlterm mp3 mp4 mp4live mpeg mpeg2 mplayer mtp mudflap musicbrainz mysql mysqli nautilus ncurses neXt netcdf netpbm network networking networkmanager nfs nls nntp nptl nptlonly nsplugin ntfs ntp numarray numeric obex objc ocaml octave odbc ogdi ogg ole openexr opengl openmp pam pcre pda pdf perl pipechan plotutils plugins png podcast policykit posix postgres postscript ppds pppd preview-latex proj projectx pstricks pulseaudio python qhull qt3support qt4 quicktime readline reflection reiserfs rhythmbox rle rpc rrdcgi rrdtool samba sasl science sdl server session slang slp smbclient sndfile snmp soup sox speex spell spl sql sqlite sse ssl startup-notification stlport subtitles subversion suexec svg sysfs szip t1lib tcl tcpd tex theora threads thunar thunderbird tidy tiff tk tntc truetype unicode usb userlocales utempter v4l2 vorbis wav webdav webdav-serf webkit win32codecs wmf wxwidgets x264 x86 xattr xcb xemacs xext xine xml xmlreader xmlrpc xorg xpm xulrunner xv xvid xvmc zlib zvbi" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse                " KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de fr" LIRC_DEVICES="hauppauge" NETBEANS_MODULES="ide websvccommon nb harness apisupport groovy gsf j2ee java xml" USERLAND="GNU" VIDEO_CARDS="mga matrox vesa" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Juergen Rose 2009-11-09 15:29:59 UTC
Created attachment 209749 [details]
/var/tmp/portage/dev-java/gnu-classpath-0.98-r1/temp/build.log
Comment 2 Juergen Rose 2009-11-09 15:30:37 UTC
Created attachment 209750 [details]
/var/tmp/portage/dev-java/gnu-classpath-0.98-r1/temp/environment
Comment 3 Juergen Rose 2009-11-09 15:32:15 UTC
'java-check-environment' says:
...
* Java environment is sane. Congratulations!
Comment 4 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-11-09 15:50:01 UTC
It should be fixed in CVS few hours ago, please sync and try again (see if ChangeLog file mentions it).
Comment 5 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-11-09 23:00:51 UTC
Marking fixed, reopen if not.
Comment 6 Juergen Rose 2009-11-10 14:38:46 UTC
One day later:
last entry in ChangeLog is still from  2009-02-05.
Comment 7 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-11-10 19:45:49 UTC
(In reply to comment #6)
> One day later:
> last entry in ChangeLog is still from  2009-02-05.

Must be a stale mirror problem then.
Comment 8 Juergen Rose 2009-11-12 16:08:36 UTC
More than a day later: there is still the same issue.
Comment 9 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-11-12 16:10:26 UTC
Is the changelog entry present? If not, file a bug for your rsync mirror.
Comment 10 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-11-12 16:12:06 UTC
You should see this:

# ChangeLog for dev-java/gnu-classpath
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/gnu-classpath/ChangeLog,v 1.94 2009/11/09 13:41:09 caster Exp $

  09 Nov 2009; Vlastimil Babka <caster@gentoo.org>
  gnu-classpath-0.98-r1.ebuild:
  Ensure ecj has enough heap space. Fixed build failure for me.

Comment 11 Martin von Gagern 2009-11-12 17:37:27 UTC
Still persists here. Both the ChangeLog entry and the gjl_java_args line in the ebuild are present. Maybe 768M isn't enough? Will try that soon...
Comment 12 Martin von Gagern 2009-11-13 09:46:11 UTC
> Still persists here. Both the ChangeLog entry and the gjl_java_args line in the
> ebuild are present. Maybe 768M isn't enough? Will try that soon...

I forgot to say: this is no longer ecj-3.3 which fails, but gjdoc:

Loading classes for package org.omg.DynamicAny...
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.
java:99)
        at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:518
)
        at java.lang.StringBuffer.append(StringBuffer.java:307)
        at java.io.StringWriter.write(StringWriter.java:72)
        at gnu.classpath.tools.IOToolkit.readFully(IOToolkit.java:166)
        at gnu.classpath.tools.gjdoc.Parser.loadFile(Parser.java:703)
        at gnu.classpath.tools.gjdoc.Parser.processSourceFile(Parser.java:784)
        at gnu.classpath.tools.gjdoc.Parser.processSourceDir(Parser.java:859)
        at gnu.classpath.tools.gjdoc.RootDocImpl.build(RootDocImpl.java:254)
        at gnu.classpath.tools.gjdoc.Main.startDoclet(Main.java:593)
        at gnu.classpath.tools.gjdoc.Main.start(Main.java:1159)
        at gnu.classpath.tools.gjdoc.Main.main(Main.java:883)
make[2]: *** [create_html] Error 1
make[2]: Leaving directory `/var/tmp/portage/dev-java/gnu-classpath-0.98-r1/work/classpath-0.98/doc/api'

As gjdoc (in my instance from dev-java/gjdoc-0.7.9-r1) doesn't use the launcher from java-config-2, the exported environment variable doesn't affect it. Its launch script doesn't seem to provide any means to communicate a jvm argument. I've just filed bug #293007 about this.

In the meantime, will you reopen this issue here? I'm not allowed to.
Comment 13 Juergen Rose 2009-11-13 09:48:32 UTC
In /usr/portage/distfiles I have the old classpath-0.98.tar.gz from  Jul 15.
In make.conf I have 
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ rsync://ftp.fi.muni.cz/pub/linux/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo rsync://gd.tuwien.ac.at/opsys/linux/gentoo ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.tu-clausthal.de/pub/linux/gentoo http://gentoo.oregonstate.edu"

I did the last 'emerge --sync' four hours ago.

If I move /usr/portage/distfiles/classpath-0.98.tar.gz to /usr/portage/distfiles/_classpath-0.98.tar.gz

emerge gnu-classpath fetches classpath-0.98.tar.gz from
http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/distfiles/classpath-0.98.tar.gz

The resulting new /usr/portage/distfiles/classpath-0.98.tar.gz is identic to the old /usr/portage/distfiles/_classpath-0.98.tar.gz.

I.e., that I should file a bug to http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror? I don't know how to do that? 
Comment 14 Martin von Gagern 2009-11-13 10:05:13 UTC
(In reply to comment #13)
> The resulting new /usr/portage/distfiles/classpath-0.98.tar.gz is identic to
> the old /usr/portage/distfiles/_classpath-0.98.tar.gz.

That is what I'd expect, I don't see your problem. The fix was in the ebuild, not in the tarball, therefore the same source tarball would still get built in a slightly different way.

> I.e., that I should file a bug to
> http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror? I don't know how to
> do that? 

linux-support@ruhr-uni-bochum.de is the contact address for that server, but I don't yet think there is anything wrong with that mirror. If so, e.g. if your build fails due to a digest verification error, that would be a different bug and unrelated to this one here.
Comment 15 Martin von Gagern 2009-11-13 10:10:42 UTC
(In reply to comment #12)
> I forgot to say: this is no longer ecj-3.3 which fails, but gjdoc:

As the name suggests, gjdoc is only a documentation tool, and indeed, the following worked for me:

USE=-doc emerge -1 gnu-classpath

So as a workaround, until bug #293007 gets fixed, this command will give you a proper gnu-classpath installation, although without documentation. As an alternative, you could edit the gjdoc start script, if you know what you are doing.
Comment 16 Jean-Francois Ostiguy 2009-11-13 13:17:45 UTC
(In reply to comment #15)
> (In reply to comment #12)
> > I forgot to say: this is no longer ecj-3.3 which fails, but gjdoc:
> 
> As the name suggests, gjdoc is only a documentation tool, and indeed, the
> following worked for me:
> 
> USE=-doc emerge -1 gnu-classpath
> 
> So as a workaround, until bug #293007 gets fixed, this command will give you a
> proper gnu-classpath installation, although without documentation. As an
> alternative, you could edit the gjdoc start script, if you know what you are
> doing.
> 

This fixed the issue for me. 

Comment 17 Juergen Rose 2009-11-13 16:58:45 UTC
I was looking at the wrong ChangLog file (/var/tmp/portage/dev-java/gnu-classpath-0.98-r1/work/classpath-0.98/ChangeLog). If I look at /usr/portage/dev-java/gnu-classpath/ChangeLog, I find at your entry
  09 Nov 2009; Vlastimil Babka <caster@gentoo.org>
  gnu-classpath-0.98-r1.ebuild:
  Ensure ecj has enough heap space. Fixed build failure for me.

Nevertheless 'emerge gnu-classpath' fails with:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2882)
...
        at gnu.classpath.tools.gjdoc.Main.main(Main.java:883)
make[2]: *** [create_html] Error 1

But the workaround of comment #15 works also for me.
Comment 18 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-11-13 23:17:56 UTC
(In reply to comment #12)
> I forgot to say: this is no longer ecj-3.3 which fails, but gjdoc:
good point
Comment 19 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-11-13 23:41:56 UTC
Fixed by gjdoc-0.7.9-r2 in bug 293007, gnu-classpath depends on this version.