Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 419897

Summary: www-client/chromium ebuild should check RAM+swap size
Product: Gentoo Linux Reporter: Sasha Polonsky <apl>
Component: Current packagesAssignee: Chromium Project <chromium>
Status: VERIFIED TEST-REQUEST    
Severity: normal CC: bircoph
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Sasha Polonsky 2012-06-06 11:43:25 UTC
+++ This bug was initially created as a clone of Bug #419671 +++

I have a machine with 512M of RAM and 500M of swap space. Its CPU is slow enough, so compilation of chromium takes several hours. And all these hours are wasted, because when the compilation is over, linker uses all RAM and all swap, and then OOM killer kills it. So I should add more swap and try again, spending more time. BTW, 512M RAM + 500M swap is more than enough to run chromium with several tabs in VNC session with Gnome 2.32. Bottom line is - ebuild should check how much RAM and swap the machine has before trying to emerge anything. In my experience, with 512M of RAM you need at least 1G of swap space.

Reproducible: Always

Steps to Reproduce:
1. Find the machine with 512M of RAM + less than 1G of swap space
2. Try to emerge chromium.

Actual Results:  
After several hours of compilation behold linker being killed by OOM killer, thus failing all emerge process, because it just cannot do its job because of the lack of memory

Expected Results:  
Before trying to emerge, the RAM and swap size should be checked, like libreoffice ebuild checks for at least 512M of RAM and at least 6G of free space on the disk. If the machine has 512M of RAM and less than 1G of swap, the error message should be printed and emerge process should fail.

Portage 2.1.10.11 (default/linux/x86/10.0, gcc-4.4.5, glibc-2.13-r2, 2.6.34-xen-r4 i686)
=================================================================
System uname: Linux-2.6.34-xen-r4-i686-AMD_Sempron-tm-_2400+-with-gentoo-2.0.2
Timestamp of tree: Mon, 04 Jun 2012 00:30:01 +0000
app-shells/bash:          4.1_p9
dev-lang/python:          2.6.6-r2
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.2
sys-apps/openrc:          0.8.2-r1
sys-apps/sandbox:         1.6-r2
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.2, 1.11.1
sys-devel/binutils:       2.20.1-r1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1
sys-devel/libtool:        2.2.10
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.38 (virtual/os-headers)
sys-libs/glibc:           2.13-r2
Repositories: gentoo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=i686 -pipe  -mno-tls-direct-seg-refs"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -march=i686 -pipe  -mno-tls-direct-seg-refs"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
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=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X berkdb branding bzip2 cairo cli corefonts cracklib cups custom-cflags custom-optimization cxx dbus djvu exif fortran gdbm gnome iconv icu jpeg libnotify mng modules ncurses networkmanager nocxx nptl openmp pam pcre perl png policykit pppd python readline samba secure-delete session ssl startup-notification svg system-sqlite tcpd tiff truetype unlock-notify x86 xorg xulrunner zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2012-06-06 13:40:20 UTC

*** This bug has been marked as a duplicate of bug 319929 ***
Comment 2 Sasha Polonsky 2012-06-06 13:47:23 UTC
This bug is not a duplicate of 319929 . The bug 319929 is about disk space, but this bug is about RAM and swap space. Unlike but 319929 , it is not fixed yet.
Comment 3 Richard Yao (RETIRED) gentoo-dev 2012-06-06 14:49:06 UTC
The memory requirements to build a package depend on the compiler, linker, CFLAGS and LDFLAGS. They can vary dramatically, so it is infeasible to impose a memory requirement check in ebuilds.
Comment 4 Sasha Polonsky 2012-06-06 15:11:26 UTC
If so, why libreoffice ebuild checks for at least 512M of RAM ? Also, please tell me the combination of USE flags I should emerge chromium with so linker is not killed on a machine with 512M of RAM and 500M of swap.
Comment 5 Andrew Savchenko gentoo-dev 2015-07-15 08:42:57 UTC
We have the same problem here: on hosts with 2.0-2.5 GB of RAM and a lot of swap it is quite possible to build chromium (e.g. during night).

The only solution I found is to
export I_KNOW_WHAT_I_AM_DOING="yes" emerge chromium

But this solution can be found only by reading check-reqs.eclass and is not documented anywhere, thus users can't access it easily.

Moreover as I can see, check-reqs.eclass does not provide a way to check for ram+swap space, thus this functionality should be added there and then used in the chromium ebuilds. Probably adding some flag CHECKREQS_CONSIDER_SWAP and documenting it (at least printing a hint on memory check failure) will be a good deal.