Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 556284 - sys-libs/glibc-2.21-r1: `Cannot allocate memory', while there is a plenty of free RAM
Summary: sys-libs/glibc-2.21-r1: `Cannot allocate memory', while there is a plenty of ...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-30 02:44 UTC by Kristof.sno
Modified: 2015-10-19 15:43 UTC (History)
0 users

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 Kristof.sno 2015-07-30 02:44:47 UTC
Recently I tried to build latest glibc-2.21-r1 and I got a strange error as following snippet.

[code]
make  subdir=conform -C conform ..=../ subdir_lib
make[2]: Entering directory '/var/tmp/portage/sys-libs/glibc-2.21-r1/work/glibc-2.21/conform'
../Makerules:319: *** Cannot allocate memory.  Stop.
make[2]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.21-r1/work/glibc-2.21/conform'
Makefile:214: recipe for target 'conform/subdir_lib' failed
make[1]: *** [conform/subdir_lib] Error 2
[/code]

In fact, my machine is equipped with 128GB of memory, which I believe is plenty enough.

[code]
$ cat /proc/meminfo
MemTotal:       131330764 kB
MemFree:        20255804 kB
Buffers:              20 kB
Cached:         97939828 kB
[/code]

It did not compile on any of gcc versions 4.8.3, 4.9.3, and 5.2.0.
System information is below.

[code]
$ emerge --info =glibc-2.21
Portage 2.2.20 (python 3.4.3-final-0, hardened/linux/amd64, gcc-5.2.0, glibc-2.20-r2, 3.6.1-hardened x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.6.1-hardened-x86_64-AMD_Opteron-tm-_Processor_6176_SE-with-gentoo-2.2
KiB Mem:   131330764 total,  20018572 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 28 Jul 2015 09:15:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25.1 p1.0) 2.25.1
app-shells/bash:          4.3_p39::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.16.1::gentoo
dev-lang/python:          2.7.10::gentoo, 3.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.0::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
[code][/code]sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69-r1::gentoo
sys-devel/automake:       1.11.1-r1::gentoo, 1.13.4::gentoo, 1.14::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1::gentoo
sys-devel/gcc:            4.8.5::gentoo, 4.9.3::gentoo, 5.2.0::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.2::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.jp.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/redmine/config /var/qmail/alias /var/qmail/control /var/spool/torque /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php5.6/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 /var/lib/redmine/config/locales /var/lib/redmine/config/settings.yml"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.gg3.net/ ftp://gg3.net/pub/linux/gentoo/ ftp://ftp.iij.ad.jp/pub/linux/gentoo/ http://ftp.iij.ad.jp/pub/linux/gentoo/ rsync://ftp.iij.ad.jp/pub/linux/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups cxx dri emboss fastcgi gdbm graphviz hardened iconv imagemagick ipv6 justify mmx mmxext modules multilib ncurses nls nptl openid openmp pam pax_kernel pcre pie png postgres qmail-spp readline session sqlite sse sse2 ssl ssp tcpd threads tls unicode urandom uuid vhosts xattr xml xtpax zlib" ABI_X86="64" 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" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" 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 ublox 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" LINGUAS="ja" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fglrx dummy i128 i810 radeon" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
[/code]


Snippet of make log below:
[code]
x86_64-pc-linux-gnu-gcc -m64 -Wl,-O1 -Wl,--as-needed ../sysdeps/unix/sysv/linux/clock_nanosleep.c -c -std=gnu99 -fgnu89-inline  -O2 -Wall -Winline -Wundef -Wwrite-strings -fmerge-all-constants -fno-stack-protector -fno-strict-aliasing -frounding-math -march=native -pipe -Wstrict-prototypes   -fPIC -fexceptions -fasynchronous-unwind-tables    -U_FORTIFY_SOURCE -DPIC -DPIC -DPIC -DPIC  -I../include -I/var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt  -I/var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl  -I../sysdeps/unix/sysv/linux/x86_64/64  -I../sysdeps/unix/sysv/linux/x86_64  -I../sysdeps/unix/sysv/linux/x86  -I../sysdeps/unix/sysv/linux/wordsize-64  -I../sysdeps/x86_64/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/x86_64  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/x86_64/64  -I../sysdeps/x86_64/fpu/multiarch  -I../sysdeps/x86_64/fpu  -I../sysdeps/x86/fpu/include -I../sysdeps/x86/fpu  -I../sysdeps/x86_64/multiarch  -I../sysdeps/x86_64  -I../sysdeps/x86  -I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64/wordsize-64  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/wordsize-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/include-fixed -isystem /usr/include  -D_LIBC_REENTRANT -include /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h  -DPIC -DSHARED     -o /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt/clock_nanosleep.os -MD -MP -MF /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt/clock_nanosleep.os.dt -MT /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt/clock_nanosleep.os
echo 'rt/get_clockfreq.o rt/clock_getcpuclockid.o rt/clock_getres.o rt/clock_gettime.o rt/clock_settime.o rt/clock_nanosleep.o' > /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt/stamp.oT
mv -f /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt/stamp.oT /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt/stamp.o
echo 'rt/get_clockfreq.os rt/clock_getcpuclockid.os rt/clock_getres.os rt/clock_gettime.os rt/clock_settime.os rt/clock_nanosleep.os' > /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt/stamp.osT
mv -f /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt/stamp.osT /var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/rt/stamp.os
make[2]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.21-r1/work/glibc-2.21/rt'
make  subdir=conform -C conform ..=../ subdir_lib
make[2]: Entering directory '/var/tmp/portage/sys-libs/glibc-2.21-r1/work/glibc-2.21/conform'
../Makerules:319: *** Cannot allocate memory.  Stop.
make[2]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.21-r1/work/glibc-2.21/conform'
Makefile:214: recipe for target 'conform/subdir_lib' failed
make[1]: *** [conform/subdir_lib] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.21-r1/work/glibc-2.21'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2
make: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.21-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl'
 * ERROR: sys-libs/glibc-2.21-r1::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-libs/glibc-2.21-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/glibc-2.21-r1::gentoo'`.
 * The complete build log is located at '/var/log/portage/sys-libs:glibc-2.21-r1:20150729-124253.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-libs/glibc-2.21-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.21-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/glibc-2.21-r1/work/glibc-2.21'
 * S: '/var/tmp/portage/sys-libs/glibc-2.21-r1/work/glibc-2.21'
[/code]


And emerge line:
[code]
$ emerge -pqv '=sys-libs/glibc-2.21-r1::gentoo'
[ebuild     U ] sys-libs/glibc-2.21-r1 [2.20-r2] USE="hardened (multilib) -debug -gd -nscd -profile (-selinux) -suid -systemtap -vanilla"
[/code]

Please inform me if more information is needed.
Thanks.

Kristof.sno
Comment 1 SpanKY gentoo-dev 2015-07-30 09:10:53 UTC
what ulimits do you have in place ?  is there anything interesting in `dmesg` ?
Comment 2 Kristof.sno 2015-07-30 11:07:59 UTC
ulimit said it's unlimited.
[code]
$ ulimit
unlimited
[/code]

dmesg complained something, 9 times the same except addressing digits.
[code]
$ dmesg
[23080085.543556] conftest[45505]: segfault at 0 ip 00007f0780c23748 sp 00007fffc590c0e0 error 4 in conftest[7f0780c23000+1000]
[23080085.944313] conftest[45531]: segfault at 0 ip 00007fdf5f5739aa sp 00007fff846ae068 error 4 in libc-2.19.so[7fdf5f4d8000+1b1000]
[/code]

I confess, however, that I tried many times and many ways to build glibc and so on and thus I am not confident if it was for glibc build.
Besides the above error, only messages are for mounting file systems.
Comment 3 SpanKY gentoo-dev 2015-08-21 21:14:49 UTC
try disabling the sandbox:
  FEATURES='-sandbox -usersandbox' emerge ...