Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 312293 - www-servers/tomcat-6.0.26: fails in src_compile with "java.lang.OutOfMemoryError: Java heap space ..."
Summary: www-servers/tomcat-6.0.26: fails in src_compile with "java.lang.OutOfMemoryEr...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
: 213897 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-30 21:16 UTC by Konstantin Agouros
Modified: 2010-06-07 14:19 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Agouros 2010-03-30 21:16:39 UTC
emerge -u tomcat fails with an out of memory error. It seems there would be an -Xmx<larger memory> needed

Reproducible: Always

Steps to Reproduce:
1.emerge -u tomcat
2.
3.

Actual Results:  
build-prepare:   
   [delete] Deleting directory /var/tmp/portage/www-servers/tomcat-6.0.26/work/a
pache-tomcat-6.0.26-src/output/build/temp
    [mkdir] Created dir: /var/tmp/portage/www-servers/tomcat-6.0.26/work/apache-
tomcat-6.0.26-src/output/build/temp

compile:
    [javac] Compiling 1058 source files to /var/tmp/portage/www-servers/tomcat-6
.0.26/work/apache-tomcat-6.0.26-src/output/classes
    [javac]
    [javac]
    [javac] The system is out of resources.
    [javac] Consult the following stack trace for details.
    [javac] java.lang.OutOfMemoryError: Java heap space
    [javac]     at java.util.jar.Manifest$FastInputStream.<init>(Manifest.java:3
15)
    [javac]     at java.util.jar.Manifest$FastInputStream.<init>(Manifest.java:3
10)
    [javac]     at java.util.jar.Manifest.read(Manifest.java:178)
    [javac]     at java.util.jar.Manifest.read(Manifest.java:178)
    [javac]     at java.util.jar.Manifest.<init>(Manifest.java:52)
    [javac]     at java.util.jar.JarFile.getManifestFromReference(JarFile.java:165)
    [javac]     at java.util.jar.JarFile.getManifest(JarFile.java:146)
    [javac]     at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:693)
    [javac]     at java.net.URLClassLoader.defineClass(URLClassLoader.java:221)
    [javac]     at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    [javac]     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    [javac]     at java.security.AccessController.doPrivileged(Native Method)
    [javac]     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    [javac]     at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
    [javac]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    [javac]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    [javac]     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
    [javac]     at com.sun.tools.javac.comp.Attr.isStaticEnumField(Attr.java:2223)
    [javac]     at com.sun.tools.javac.comp.Attr.checkEnumInitializer(Attr.java:2198)
    [javac]     at com.sun.tools.javac.comp.Attr.checkInit(Attr.java:2173)
    [javac]     at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1852)
    [javac]     at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
    [javac]     at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
    [javac]     at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:377)
    [javac]     at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:228)
    [javac]     at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:219)
    [javac]     at com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:167)
    [javac]     at com.sun.tools.javac.comp.MemberEnter.enterAnnotations(MemberEnter.java:743)   
    [javac]     at com.sun.tools.javac.comp.MemberEnter.access$300(MemberEnter.java:42)
    [javac]     at com.sun.tools.javac.comp.MemberEnter$5.enterAnnotation(MemberEnter.java:711)  
    [javac]     at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:95)
    [javac]     at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:87)
    [javac]     at com.sun.tools.javac.comp.Enter.complete(Enter.java:472)

BUILD FAILED
/var/tmp/portage/www-servers/tomcat-6.0.26/work/apache-tomcat-6.0.26-src/build.xml:102: Compile failed; see the compiler error output for details.

Total time: 1 minute 28 seconds
 * ERROR: www-servers/tomcat-6.0.26 failed:
 *   eant failed 
 *
 * Call stack:   
 *     ebuild.sh, line   54:  Called src_compile
 *   environment, line 4478:  Called java-pkg-2_src_compile
 *   environment, line 2448:  Called eant 'build-only' 'build-jasper-jdt' 'build-docs' '-f' 'build.xml' '-Dbase.path=/var/tmp/portage/www-servers/tomcat-6.0.26/temp' '-Dversion=6.0.26' '-Dversion.number=6.0.26' '-Dcompile.debug=false' '-Djsp-api.jar=jsp-api.jar' '-Dservlet-api.jar=servlet-api.jar' '-Dant.jar=ant.jar' '-Djdt.jar=/usr/share/eclipse-ecj-3.3/lib/ecj.jar'
 *   environment, line  963:  Called die
 * The specific snippet of code:
 *       ant ${antflags} "${@}" || die "eant failed"
 *
 * If you need support, post the output of 'emerge --info =www-servers/tomcat-6.0.26',
 * the complete build log and the output of 'emerge -pqv =www-servers/tomcat-6.0.26'.
!!! When you file a bug report, please include the following information:
GENTOO_VM=sun-jdk-1.6  CLASSPATH="" JAVA_HOME="/opt/sun-jdk-1.6.0.17"
JAVACFLAGS="-source 1.5 -target 1.5" COMPILER="javac"
and of course, the output of emerge --info
 * The complete build log is located at '/var/tmp/portage/www-servers/tomcat-6.0.26/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-servers/tomcat-6.0.26/temp/environment'.
 * S: '/var/tmp/portage/www-servers/tomcat-6.0.26/work/apache-tomcat-6.0.26-src'


Expected Results:  
Successful build

Portage 2.1.7.17 (default/linux/amd64/10.0, gcc-4.3.4, glibc-2.10.1-r1, 2.6.31-gentoo-r6-64bit x86_64)
=================================================================
System uname: Linux-2.6.31-gentoo-r6-64bit-x86_64-AMD_Athlon-tm-_64_Processor_3200+-with-gentoo-1.12.13
Timestamp of tree: Tue, 30 Mar 2010 16:00:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [enabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 1.3.7-r1, 2.1.10
dev-lang/python:     2.5.4-r4, 2.6.4-r1
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5-r1, 1.7.9-r1, 1.9.6-r3, 1.10.3
sys-devel/binutils:  2.18-r3
sys-devel/gcc:       4.1.2, 4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=athlon64 -mtune=athlon64"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /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="-O3 -march=athlon64 -mtune=athlon64"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distcc distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ http://gentoo.mneisen.org/ http://gentoo.supp.name/ http://gentoo.wheel.sk/"
LDFLAGS="-Wl,-O1"
LINGUAS="en de el"
MAKEOPTS="-j3"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac acl alsa amd64 amr asf berkdb bzip2 caps chipcard cli cracklib crypt cups cxx dri dts dvd faac ffmpeg gcj gdbm gif gpm gtk hbci iconv ipv6 java jpeg ldap mbox mmx modules mp3 mp4 mpeg mudflap multilib ncurses network nls nptl nptlonly nsplugin nvidia ofx opengl openmp pam pcre pdf perl pg-intdatetime png postgres pppd python quotes readline reflection sdl session spl sse sse2 ssl symlink sysfs tcpd tiff unicode usb x264 xorg xvid 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de el" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

# java-config -l
[ant-core] Java-based build tool similar to 'make' that uses XML configuration files. (/usr/share/ant-core/package.env)
[cyrus-sasl-2] The Cyrus SASL (Simple Authentication and Security Layer). (/usr/share/cyrus-sasl-2/package.env)
[ant-eclipse-ecj-3.3] Ant Compiler Adapter for Eclipse Java Compiler (/usr/share/ant-eclipse-ecj-3.3/package.env)
[db-4.7] Oracle Berkeley DB (/usr/share/db-4.7/package.env)
[commons-dbcp] Jakarta component providing database connection pooling API (/usr/share/commons-dbcp/package.env)
[xulrunner-1.9] Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications (/usr/share/xulrunner-1.9/package.env)
[xalan-serializer] DOM Level 3 serializer from Apache Xalan, shared by Xalan and Xerces (/usr/share/xalan-serializer/package.env)
[tomcat-servlet-api-2.5] Tomcat's Servlet API 2.5/JSP API 2.1 implementation (/usr/share/tomcat-servlet-api-2.5/package.env)
[xml-commons-resolver] An XML Entity and URI Resolver (/usr/share/xml-commons-resolver/package.env)
[stringtemplate] A Java template engine (/usr/share/stringtemplate/package.env)
[xerces-2] The next generation of high performance, fully compliant XML parsers in the Apache Xerces family (/usr/share/xerces-2/package.env)
[commons-logging] The Jakarta-Commons Logging package is an ultra-thin bridge between different logging libraries. (/usr/share/commons-logging/package.env)
[sun-javamail] A Java-based framework to build multiplatform mail and messaging applications. (/usr/share/sun-javamail/package.env)
[ant-antlr] Apache Ant's optional tasks for Antlr (/usr/share/ant-antlr/package.env)
[gjdoc] A javadoc compatible Java source documentation generator. (/usr/share/gjdoc/package.env)
[ant-trax] Apache Ant .jar with optional tasks depending on XML transformer (xalan) (/usr/share/ant-trax/package.env)
[antlr] A parser generator for C++, C#, Java, and Python (/usr/share/antlr/package.env)
[xsdlib] The Sun Multi-Schema XML Validator is a Java tool to validate XML documents against several kinds of XML schemata. (/usr/share/xsdlib/package.env)
[junit] Simple framework to write repeatable tests (/usr/share/junit/package.env)
[relaxng-datatype] Interface between RELAX NG validators and datatype libraries (/usr/share/relaxng-datatype/package.env)
[javacup] CUP Parser Generator for Java (/usr/share/javacup/package.env)
[jdbc-postgresql] JDBC Driver for PostgreSQL (/usr/share/jdbc-postgresql/package.env)
[libidn] Internationalized Domain Names (IDN) implementation (/usr/share/libidn/package.env)
[xjavac-1] The implementation of the javac compiler for IBM JDK 1.4 (needed for xerces-2) (/usr/share/xjavac-1/package.env)
[gnu-classpath-0.98] Free core class libraries for use with virtual machines and compilers for the Java language (/usr/share/gnu-classpath-0.98/package.env)
[sun-j2me-bin] Java 2 Micro Edition Wireless Toolkit for developing wireless applications (/usr/share/sun-j2me-bin/package.env)
[db-4.3] Oracle Berkeley DB (/usr/share/db-4.3/package.env)
[db-4.5] Oracle Berkeley DB (/usr/share/db-4.5/package.env)
[bcel] The Byte Code Engineering Library: analyze, create, manipulate Java class files (/usr/share/bcel/package.env)
[db-4.6] Oracle Berkeley DB (/usr/share/db-4.6/package.env)
[tomcat-6] Tomcat Servlet-2.5/JSP-2.1 Container (/usr/share/tomcat-6/package.env)
[pdflib-5] A library for generating PDF on the fly. (/usr/share/pdflib-5/package.env)
[xalan] Apache's XSLT processor for transforming XML documents into HTML, text, or other XML document types. (/usr/share/xalan/package.env)
[sun-jaf] Sun's JavaBeans Activation Framework (JAF) (/usr/share/sun-jaf/package.env)
[antlr-3] A parser generator for C++, C#, Java, and Python (/usr/share/antlr-3/package.env)
[eclipse-ecj-3.3] Eclipse Compiler for Java (/usr/share/eclipse-ecj-3.3/package.env)
[commons-daemon] Tools to allow java programs to run as unix daemons (/usr/share/commons-daemon/package.env)
[commons-pool] Provides general purpose object pooling API (/usr/share/commons-pool/package.env)
[xml-commons-external-1.3] An Apache-hosted set of externally-defined standards interfaces, namely DOM, SAX, and JAXP. (/usr/share/xml-commons-external-1.3/package.env)
Comment 1 Panagiotis Christopoulos (RETIRED) gentoo-dev 2010-04-05 13:20:29 UTC
Seems similar to bug 292534 ?
Comment 2 Peter Bleszynski 2010-04-09 07:28:42 UTC
I am seeing the same result.
Comment 3 Erik de Vries 2010-04-09 18:47:46 UTC
I am seeing the same result on my server 
(amd64 2 GB memory) but it emerges fine on my workstation (amd64 4 GB memory)
Comment 4 Peter Bleszynski 2010-04-09 19:37:04 UTC
I have a similar setup.  Tomcat emerge fails on both the workstation (amd64 4GB memory) and on the server (amd64 1GB memory).  I will try to test on x86 when I have a chance.

Is the ebuild able to change ant's build.xml?  Can we get past this problem by setting fork="true" in line 102 of /var/tmp/portage/www-servers/tomcat-6.0.26/work/apache-tomcat-6.0.26-src/build.xml?
Comment 5 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-04-10 08:20:43 UTC
Does this fix the issue?

JAVA_PKG_FORCE_COMPILER="ecj-3.3" emerge -1 tomcat
Comment 6 Peter Bleszynski 2010-04-10 16:08:48 UTC
Yes, it fixes the issue.  Thank you.
Comment 7 Erik de Vries 2010-04-10 16:53:31 UTC
(In reply to comment #6)
> Yes, it fixes the issue.  Thank you.
> 

Works for me too, thanks.
Comment 8 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-04-10 21:18:18 UTC
Thanks for testing. Changed ebuild to force ecj always on amd64.
Comment 9 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-06-06 12:44:36 UTC
*** Bug 213897 has been marked as a duplicate of this bug. ***
Comment 10 Clemens Renner 2010-06-06 17:37:37 UTC
(In reply to comment #5)
> Does this fix the issue?
> 
> JAVA_PKG_FORCE_COMPILER="ecj-3.3" emerge -1 tomcat
> 

This works for me as well. I can see in the ebuild that ecj is selected as the compiler for JVM 1.5 only. Is there a reason not to use ecj also for 1.6 JVMs?
Comment 11 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-06-07 14:01:19 UTC
(In reply to comment #10)
> (In reply to comment #5)
> > Does this fix the issue?
> > 
> > JAVA_PKG_FORCE_COMPILER="ecj-3.3" emerge -1 tomcat
> > 
> 
> This works for me as well. I can see in the ebuild that ecj is selected as the
> compiler for JVM 1.5 only. Is there a reason not to use ecj also for 1.6 JVMs?

It should be now, on amd64 at least.

Comment 12 Konstantin Agouros 2010-06-07 14:19:00 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #5)
> > > Does this fix the issue?
> > > 
> > > JAVA_PKG_FORCE_COMPILER="ecj-3.3" emerge -1 tomcat
> > > 
> > 
> > This works for me as well. I can see in the ebuild that ecj is selected as the
> > compiler for JVM 1.5 only. Is there a reason not to use ecj also for 1.6 JVMs?
> 
> It should be now, on amd64 at least.
> 
'BUILD SUCCESSFUL' so yes it does