Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119400 - azureus won't compile
Summary: azureus won't compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Petteri Räty (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 113389
  Show dependency tree
 
Reported: 2006-01-18 02:09 UTC by Zac Slade
Modified: 2006-02-12 03:38 UTC (History)
1 user (show)

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


Attachments
ebuild patch (azureus-2.3.0.6-r1.patch,604 bytes, patch)
2006-01-18 02:17 UTC, Zac Slade
Details | Diff
New patch that is much smaller (azureus-2.3.0.6-r1.ebuild.patch,425 bytes, patch)
2006-01-22 05:09 UTC, Zac Slade
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Slade 2006-01-18 02:09:09 UTC
The azureus ebuild explicitly tells the system java to allocate 1g of memory.  The comment says that it was added to fix an AMD64 specific issue.  However doing this breaks the installation for systems that don't have that much memory or don't allow memory overcommit and don't have 1g free.
Comment 1 Zac Slade 2006-01-18 02:17:19 UTC
Created attachment 77406 [details, diff]
ebuild patch

This is the patch to the ebuild that fixes the problem for systems with less than 1g of free memory and overcommit turned off.  Tested on x86.  Needs to be tested on amd64.
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2006-01-21 12:13:14 UTC
from man java
       -Xmxn  Specifies the maximum size, in bytes, of the memory allocation pool.  This value must be a multiple of 1024 greater than 2 MB.  Append the letter k or K to indicate kilo-
              bytes or the letter m or M to indicate megabytes.  The default value is 64MB. Examples:

This should just be the upper limit and the vm should not try to allocate 1G of memory. 
Comment 3 Zac Slade 2006-01-22 04:44:48 UTC
Okay I can go with your argument although that's not how it worked for me.  However that doesn't change the fact that there is a comment that says the line was changed explicitly for amd64, but was applied globally.  Additionally my patch uses "if [${ARCH} = "amd64"];then" this might need to change to using the "if use amd64;then" instead.  Whichever is more appropriate is fine with me.  The original ebuild wouldn't work for me.  Remove the -Xmn1g line and it worked great.

This time I'm also including my emerge --info output:
Portage 2.1_pre2 (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.5-r3, 2.6.13-mm1 i686)
=================================================================
System uname: 2.6.13-mm1 i686 AMD Athlon(tm) XP 2200+
Gentoo Base System version 1.12.0_pre12
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer -m32"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer -m32"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X aac aalib acl alsa apm arts artswrappersuid audiofile avi bash-completion berkdb bitmap-fonts bonobo bzip2 cdparanoia cdr crypt cscope css cups curl dba divx4linux dpms dts dvd dvdr dvdread eds emboss encode esd ethereal exif expat faad fam ffmpeg firefox flac foomaticdb fortran gd gdbm gif glut gmp gnutls gphoto2 gpm gstreamer gtkhtml guile hal idn ieee1394 imagemagick imap imlib java jpeg jpeg2k junit kde kdexdeltas lcms libcaca libg++ libwww mad mhash mikmod mmap mmx mmx2 mmxext mng motif mozilla mp3 mpeg musepack mysql nas ncurses nptl nptlonly nvidia offensive ogg oggvorbis openal opengl oss pam pcre pdflib perl png postgres povray python qt quicktime rdesktop readline real recode ruby samba sasl sblive scripting sdl slang slp snmp speex spell sse ssl svg svga tcpd tetex theora tiff truetype truetype-fonts type1-fonts udev unicode urandom usb vhosts vorbis win32codecs xine xml xml2 xmms xscreensaver xv xvid zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 4 Zac Slade 2006-01-22 05:09:39 UTC
Created attachment 77802 [details, diff]
New patch that is much smaller

This patch uses the "if use amd64" style and removes duplication of code.  Much smaller patch does the same thing as the previously posted one.
Comment 5 Petteri Räty (RETIRED) gentoo-dev 2006-01-22 08:49:23 UTC
Could you post more information about the error on x86 because I would like to know more about why it fails because we have other ebuilds that use the same technique unconditionally. No-one else has reported such problems on x86 so far.
Comment 6 Zac Slade 2006-01-22 09:19:25 UTC
Sure take this senario.  You have a system with 128MB of RAM.  If you attempt to start java with -Xmx1g it should fail because there isn't enough memory to allocate to the VM.  The JVM will attempt to reserve the memory you specify with -Xmx.  On most modern machines this isn't an issue because one of three things is true.
1) They have plenty of RAM.
2) They have plenty of RAM + Swap
or
3) They have vm.overcommit_memory set to the default of 0 which allows you system to overcommit memory.

If there isn't enough available system memory for the JVM to reserve 1g, using this specific example, then it will fail with the following error message:
Error occurred during initialization of VM
Could not reserve enough space for object heap

Specifically with this ebuild on x86 there is no need to specify 1g.  The default of 64m is more than adequate to package the jars and to run Azureus as well.
Comment 7 Petteri Räty (RETIRED) gentoo-dev 2006-02-12 03:38:32 UTC
Ok. I was able to reproduce this. I made the memory limit bigger only on amd64 and lowered the limit a little. This should only leave amd64 machines with little memory to the danger zone but amd64 machines in general have quite a lot of memory. Sorry to keep this open quite long. As I said earlier, other ebuilds using the techinique probably need fixing too.