Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 225921 - dev-java/gnu-classpath-0.97-r1 fails to emerge with java.lang.OutOfMemoryError
Summary: dev-java/gnu-classpath-0.97-r1 fails to emerge with java.lang.OutOfMemoryError
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
: 222563 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-11 14:42 UTC by Matías Graña
Modified: 2010-03-21 22:44 UTC (History)
7 users (show)

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


Attachments
fixes out-of-memory error when trying to allocate space on the heap (gnu-classpath-0.97.2-fix-out-of-memory-error.patch,406 bytes, text/plain)
2008-08-16 14:02 UTC, Christopher Friedt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matías Graña 2008-06-11 14:42:38 UTC
End of log:
Making all in lib
make[1]: Entering directory `/var/tmp/portage/dev-java/gnu-classpath-0.97-r1/work/classpath-0.97-gentoo/lib'
mkdir -p ../gnu/java/locale
../scripts/generate-locale-list.sh > ../gnu/java/locale/LocaleData.java
true
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:2827)
        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.97-r1/work/classpath-0.97-gentoo/lib'
make: *** [all-recursive] Error 1
 * 
 * ERROR: dev-java/gnu-classpath-0.97-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 3992:  Called die
 * The specific snippet of code:
 *       emake || die "make failed"
 *  The die message:
 *   make failed


Reproducible: Always

Steps to Reproduce:
just emerge it!



output of emerge --info:

Portage 2.1.4.4 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.24-gentoo-r4 i686)
=================================================================
System uname: 2.6.24-gentoo-r4 i686 AMD Sempron(tm) 2800+
Timestamp of tree: Wed, 11 Jun 2008 12:45:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r13
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -pipe -mmmx -msse -m3dnow"
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/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=i686 -O2 -pipe -mmmx -msse -m3dnow"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.exp.dc.uba.ar/gentoo/ http://gentoo.cites.uiuc.edu/pub/gentoo/"
LC_ALL="en_US.utf8"
LINGUAS="en es es_AR"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--timeout=600"
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/portage/local/layman/enlightenment /usr/portage/local/layman/science /usr/local/portage"
SYNC="rsync://rsync.samerica.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X aac acl acpi alsa apache2 apm arts asf audiofile avi bash-completion berkdb bitmap-fonts bzip2 bzlib cairo cdb cdparanoia cdr cli cracklib crypt cscope cups curl dbus doc dri dvd dvdread emboss encode exif f77 fam ffmpeg firefox flac foomaticdb fortran gcj gd gdbm gif glut gmp gnome gpm graphviz gstreamer gtk gtk2 gtkhtml iconv idn imagemagick imlib ipv6 isdnlog java jpeg kde lapack lcms ldap libg++ libwww lua mad mbox midi mikmod mmx mmxext mng motif mozilla mp3 mpeg mpi mudflap mysql ncurses nls nptl nptlonly nsplugin ntpl nvidia ogg oggvorbis opengl openmp oss pam pcre pdflib perl php png pppd python qt quicktime readline recode reflection samba sdl session slang spell spl sqlite ssl svga szip tcltk tcpd tetex threads tiff tk truetype truetype-fonts type1-fonts udev unicode usb vim-with-x vorbis win32codecs x86 xml xorg xv xvid zlib" ALSA_CARDS="hda-intel intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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="en es es_AR" USERLAND="GNU" VIDEO_CARDS="nv fbdev"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

-----------------------------------------------------------------
Also:
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="." JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="" COMPILER=""
Comment 1 Petteri Räty (RETIRED) gentoo-dev 2008-07-15 21:53:40 UTC
*** Bug 222563 has been marked as a duplicate of this bug. ***
Comment 2 Christopher Friedt 2008-08-16 13:37:56 UTC
I've observed exactly the same error in gnu-classpath-0.97.2 . Oddly enough the compile worked when I unpacked the source without applying any patches and then compiled it manually using the same ./configure options.
Comment 3 Christopher Friedt 2008-08-16 13:39:54 UTC
woops - sorry - my only difference was that I disabled gjdoc (it's disabled by default)

./configure --enable-alsa --disable-debug --disable-examples --enable-gconf-peer --enable-gtk-peer --enable-gstreamer-peer --enable-plugin --enable-qt-peer --enable-xmlj --disable-dssi --enable-jni --disable-dependency-tracking --disable-Werror --host=i686-pc-linux-gnu --prefix=/opt/gnu-classpath-0.97 --with-ecj-jar=/usr/share/eclipse-ecj-3.3/lib/ecj.jar --with-vm=java --with-x
Comment 4 Christopher Friedt 2008-08-16 14:02:55 UTC
Created attachment 163038 [details]
fixes out-of-memory error when trying to allocate space on the heap

I still could not get this package to compile --with-gjdoc. I assume that a later version of gjdoc is required. Commenting out 'export JAVAC="..." (see patch) definitely solved the heap error I encountered though, which is evident from my successful manual compile.
Comment 5 upendra 2008-11-13 21:24:43 UTC
Hi I am having same error today

mkdir .libs
 x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../include -Wall -DAPPLETVIEWER_EXECUTABLE=\"/opt/gnu-classpath-0.97/bin/gappletviewer\" -I/usr/include/xulrunner-1.9/stable -I/usr/include/nspr -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -march=nocona -O2 -pipe -c gcjwebplugin.cc  -fPIC -DPIC -o .libs/libgcjwebplugin_la-gcjwebplugin.o
gcjwebplugin.cc:61:31: error: nsIPluginInstance.h: No such file or directory
gcjwebplugin.cc:62:35: error: nsIPluginInstancePeer.h: No such file or directory
gcjwebplugin.cc:63:31: error: nsIPluginTagInfo2.h: No such file or directory
gcjwebplugin.cc:145: error: ISO C++ forbids declaration of 'NS_DEFINE_IID' with no type
gcjwebplugin.cc:145: error: 'kIPluginTagInfo2IID' was not declared in this scope
gcjwebplugin.cc:145: error: 'NS_IPLUGINTAGINFO2_IID' was not declared in this scope
gcjwebplugin.cc:145: error: initializer expression list treated as compound expression
gcjwebplugin.cc:203: error: ISO C++ forbids declaration of 'nsIPluginTagInfo2' with no type
gcjwebplugin.cc:203: error: expected ';' before '*' token
gcjwebplugin.cc: In function 'gchar* plugin_get_documentbase(NPP_t*)':
gcjwebplugin.cc:868: error: 'nsIPluginInstance' was not declared in this scope
gcjwebplugin.cc:868: error: 'xpcom_instance' was not declared in this scope
gcjwebplugin.cc:869: error: 'nsIPluginInstancePeer' was not declared in this scope
gcjwebplugin.cc:869: error: 'peer' was not declared in this scope
gcjwebplugin.cc:870: error: 'nsresult' was not declared in this scope
gcjwebplugin.cc:870: error: expected `;' before 'result'
gcjwebplugin.cc:871: error: 'nsIPluginTagInfo2' was not declared in this scope
gcjwebplugin.cc:871: error: 'pluginTagInfo2' was not declared in this scope
gcjwebplugin.cc:876: error: expected primary-expression before ')' token
gcjwebplugin.cc:890: error: 'union info_union' has no member named 'info_field'
gcjwebplugin.cc:892: error: 'result' was not declared in this scope
gcjwebplugin.cc:892: error: 'kIPluginTagInfo2IID' was not declared in this scope
gcjwebplugin.cc:912: error: 'NS_RELEASE' was not declared in this scope
gcjwebplugin.cc: At global scope:
gcjwebplugin.cc:145: warning: 'NS_DEFINE_IID' defined but not used
make[2]: *** [libgcjwebplugin_la-gcjwebplugin.lo] Error 1
make[2]: Leaving directory `/nfs1/var/tmp/portage/portage/dev-java/gnu-classpath-0.97-r1/work/classpath-0.97-gentoo/native/plugin'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/nfs1/var/tmp/portage/portage/dev-java/gnu-classpath-0.97-r1/work/classpath-0.97-gentoo/native'
make: *** [all-recursive] Error 1
 * 
 * ERROR: dev-java/gnu-classpath-0.97-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 4133:  Called die
 * The specific snippet of code:
 *       emake || die "make failed"
 *  The die message:
 *   make failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/nfs1/var/tmp/portage/portage/dev-java/gnu-classpath-0.97-r1/temp/build.log'.
 * The ebuild environment file is located at '/nfs1/var/tmp/portage/portage/dev-java/gnu-classpath-0.97-r1/temp/environment'.
 * 
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="/usr/share/glib-java-0.2/lib/glib0.2.jar:/usr/share/libgtk-java-2.8/lib/gtk2.8.jar:." JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info

 * Messages for package dev-java/gnu-classpath-0.97-r1:

 * 
 * ERROR: dev-java/gnu-classpath-0.97-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 4133:  Called die
 * The specific snippet of code:
 *       emake || die "make failed"
 *  The die message:
 *   make failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/nfs1/var/tmp/portage/portage/dev-java/gnu-classpath-0.97-r1/temp/build.log'.
 * The ebuild environment file is located at '/nfs1/var/tmp/portage/portage/dev-java/gnu-classpath-0.97-r1/tem


--------------
emerge --info
Portage 2.1.4.5 (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r0, 2.6.27-gentoo-r1 x86_64)
=================================================================
System uname: 2.6.27-gentoo-r1 x86_64 Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz
Timestamp of tree: Thu, 13 Nov 2008 15:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r13, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.4.6-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
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.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://gentoo.mirrors.pair.com/ ftp://gentoo.mirrors.pair.com/ http://gentoo.mirrors.tds.net/gentoo ftp://gentoo.mirrors.tds.net/gentoo http://open-systems.ufl.edu/mirrors/gentoo http://gentoo.llarian.net/ ftp://gentoo.llarian.net/pub/gentoo http://gentoo.binarycompass.org http://prometheus.cs.wmich.edu/gentoo http://mirror.usu.edu/mirrors/gentoo/ http://gentoo.mirrors.easynews.com/linux/gentoo/ http://gentoo.cites.uiuc.edu/pub/gentoo/ ftp://gentoo.cites.uiuc.edu/pub/gentoo/  http://gentoo.chem.wisc.edu/gentoo/ ftp://gentoo.chem.wisc.edu/gentoo/ "
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
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="/nfs1/var/tmp/portage"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X acl alsa amd64 berkdb bzip2 cli cracklib crypt cups dbus dri gdbm gnome gpm gstreamer gtk hal iconv isdnlog jpeg ldap midi mmx mudflap multilib ncurses nls nptl nptlonly nsplugin openmp pam pcre perl pppd python readline reflection session spl sse sse2 ssl svg sysfs tcpd unicode xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fglrx"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 6 Stefan Reiser 2008-12-01 17:23:52 UTC
Hi, I got a possible fix for this bug !
Due to the fact, /usr/bin/ecj-3.3 is a script calling /usr/share/java-config-2/launcher/launcher.bash which calls the actual java-vm (in my case sun-jdk-1.5 / java) without raising heapspace, the ebuild fails.
So the only thing you have to do, to make ecj go through the code without failing on missing heapspace, is to raise it for the vm ecj runs in.

exec java -Xmx1024M ${gjl_args} ${gjl_java_args} ${gjl_starte} ${gjl_pkg_args} "${@}"

should do it (at last it did it for me ;)).

cheers
Comment 7 Howard B. Golden 2009-03-08 18:42:15 UTC
(In reply to comment #5)

It appears to me that this is a different bug: Bug 213463.
Comment 8 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-03-21 22:44:31 UTC
Should be fixed now.