Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 307595 - cc1plus gets oom-killed compiling dev-libs/ace
Summary: cc1plus gets oom-killed compiling dev-libs/ace
Status: RESOLVED DUPLICATE of bug 322941
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: C++ Team [disbanded]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-03 10:52 UTC by konsti
Modified: 2011-07-20 15:18 UTC (History)
2 users (show)

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


Attachments
fixed ebuild (ace-5.7.2.ebuild,2.25 KB, text/plain)
2010-05-02 10:56 UTC, Roman v. Gemmeren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description konsti 2010-03-03 10:52:38 UTC
My system is not able to compile dev-libs/ace:

x86_64-pc-linux-gnu-g++: Internal error: Killed (program cc1plus)

demsg:
Out of memory: kill process 16221 (cc1plus) score 89243 or a child
Killed process 16221 (cc1plus)

System has 4GB RAM and 2GB swap.

The error is identical in different runs.


Reproducible: Always

Steps to Reproduce:
1. emerge dev-libs/ace
2.
3.




x86_64-pc-linux-gnu-g++ -W -Wall -Wpointer-arith -march=k8 -O2 -pipe -fomit-frame-pointer -pipe -O3 -Wl,-O1 -o .libs/Stacks Stacks-Stacks.o  -pthread ../../../ace/.libs/libACE.so -lrt -ldl
creating Stacks
x86_64-pc-linux-gnu-g++: Internal error: Killed (program cc1plus)

cc1plus invoked oom-killer: gfp_mask=0x280da, order=0, oom_adj=0
Pid: 16221, comm: cc1plus Not tainted 2.6.32-gentoo-r2 #17
Call Trace:
 [<ffffffff8106919d>] ? 0xffffffff8106919d
 [<ffffffff81069473>] ? 0xffffffff81069473
 [<ffffffff8106953e>] ? 0xffffffff8106953e
 [<ffffffff8106c94b>] ? 0xffffffff8106c94b
 [<ffffffff8107d01e>] ? 0xffffffff8107d01e
 [<ffffffff81082284>] ? 0xffffffff81082284
 [<ffffffff8116ab68>] ? 0xffffffff8116ab68
 [<ffffffff81080c7c>] ? 0xffffffff81080c7c
 [<ffffffff8102723f>] ? 0xffffffff8102723f
 [<ffffffff81284ecf>] ? 0xffffffff81284ecf
Mem-Info:
DMA per-cpu:
CPU    0: hi:    0, btch:   1 usd:   0
CPU    1: hi:    0, btch:   1 usd:   0
DMA32 per-cpu:
CPU    0: hi:  186, btch:  31 usd: 119
CPU    1: hi:  186, btch:  31 usd:   0
Normal per-cpu:
CPU    0: hi:  186, btch:  31 usd: 172
CPU    1: hi:  186, btch:  31 usd:  81
active_anon:760413 inactive_anon:199323 isolated_anon:0
 active_file:65 inactive_file:83 isolated_file:0
 unevictable:0 dirty:0 writeback:871 unstable:0
 free:6365 slab_reclaimable:2958 slab_unreclaimable:3594
 mapped:68 shmem:0 pagetables:4039 bounce:0
DMA free:15576kB min:28kB low:32kB high:40kB active_anon:124kB inactive_anon:256kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15340kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
lowmem_reserve[]: 0 3383 3888 3888
DMA32 free:8928kB min:6928kB low:8660kB high:10392kB active_anon:2805020kB inactive_anon:560748kB active_file:32kB inactive_file:4kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:3464992kB mlocked:0kB dirty:0kB writeback:1848kB mapped:32kB shmem:0kB slab_reclaimable:2572kB slab_unreclaimable:2296kB kernel_stack:64kB pagetables:8448kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:192 all_unreclaimable? yes
lowmem_reserve[]: 0 0 505 505
Normal free:956kB min:1032kB low:1288kB high:1548kB active_anon:236508kB inactive_anon:236288kB active_file:228kB inactive_file:328kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:517120kB mlocked:0kB dirty:0kB writeback:1636kB mapped:240kB shmem:0kB slab_reclaimable:9260kB slab_unreclaimable:12080kB kernel_stack:1376kB pagetables:7708kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:896 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0 0
DMA: 0*4kB 1*8kB 1*16kB 0*32kB 1*64kB 1*128kB 0*256kB 0*512kB 1*1024kB 1*2048kB 3*4096kB = 15576kB
DMA32: 140*4kB 0*8kB 1*16kB 1*32kB 0*64kB 1*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 2*4096kB = 8928kB
Normal: 239*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 956kB
3045 total pagecache pages
2885 pages in swap cache
Swap cache stats: add 1478959, delete 1476074, find 26105/31653
Free swap  = 0kB
Total swap = 1951888kB
1015808 pages RAM
33477 pages reserved
664 pages shared
974252 pages non-shared
Out of memory: kill process 16221 (cc1plus) score 89243 or a child
Killed process 16221 (cc1plus)
Portage 2.1.7.17 (default/linux/amd64/10.0/no-multilib, gcc-4.4.3, glibc-2.11-r1, 2.6.32-gentoo-r2 x86_64)
=================================================================
System uname: Linux-2.6.32-gentoo-r2-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_6400+-with-gentoo-2.0.1
Timestamp of tree: Wed, 03 Mar 2010 10:00:01 +0000
app-shells/bash:     4.1_p2
dev-lang/python:     2.6.4-r1, 3.1.1-r1
dev-util/cmake:      2.8.0-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.65
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20-r1
sys-devel/gcc:       4.4.3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.32
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev /etc/udev/rules.d /usr/share/X11/xkb"
CXXFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/pub/upload/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j1"
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="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 berkdb bzip2 cli cracklib crypt cups cxx dri fortran gnutls iconv ipv6 maildir mmx modules mudflap ncurses nls nptl nptlonly openmp pcre perl pppd readline reflection session spl sse sse2 ssl sysfs threads 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 authn_alias authn_anon 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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 konsti 2010-03-03 10:59:31 UTC
Sorry, I forgot to mention that I tried also lowering MAKEOPTS from -j3 to -j1 or CFLAGS (==CXXFLAGS) lowering from -O2 to -Os did not help either.
Comment 2 Doktor Notor 2010-03-07 13:41:22 UTC
Well, try without -pipe... 
Comment 3 konsti 2010-03-08 09:14:56 UTC
This yields into the same error:

creating RB_Tree_Functors
x86_64-pc-linux-gnu-g++ -W -Wall -Wpointer-arith -march=k8 -O2 -fomit-frame-pointer -pipe -O3 -Wl,-O1 -o .libs/Stacks Stacks-Stacks.o  -pthread ../../../ace/.libs/libACE.so -lrt -ldl
creating Stacks
x86_64-pc-linux-gnu-g++: Internal error: Killed (program cc1plus)
Comment 4 Doktor Notor 2010-03-08 16:16:50 UTC
Well, clearly this hardcodes -O3 somewhere. 
Comment 5 Francesco Munda 2010-04-20 17:25:23 UTC
(In reply to comment #4)
> Well, clearly this hardcodes -O3 somewhere. 

I had the same problem.

The culprit is /var/tmp/portage/dev-libs/ace-5.7.2/work/ACE_wrappers/configure where it's hardcoded the "-O3".

I solved by modifying the relevant ebuild (and re-manifesting it, of course), with this simple addition:

[...stuff...]
src_compile() {
    export ACE_ROOT="${S}"
    mkdir build
    cd build

    ECONF_SOURCE="${S}"

echo "=========================" ####
sed -i "s/-O3//" ${S}/configure  # Added to remove the hardcoded optimization
echo "=========================" ####

    econf \
        --enable-lib-all \
        $(use_with X) \
        $(use_enable ipv6) \
        || die "econf died"
    # --with-qos needs ACE_HAS_RAPI
    emake static_libs=1 || die "emake failed"
}
[...more stuff...]

Without the -O3, it compiles cleanly.

The production of a simple overlay patch is left as exercise to the reader! ;)
Comment 6 Roman v. Gemmeren 2010-05-02 10:56:04 UTC
Created attachment 230003 [details]
fixed ebuild
Comment 7 Roman v. Gemmeren 2010-05-04 08:04:04 UTC
(In reply to comment #6)
> Created an attachment (id=230003) [details]
> fixed ebuild
Please add to portage, it won't build with -O3 on gcc-4.3 or 4.4.x.
Comment 8 Pacho Ramos gentoo-dev 2011-07-20 15:18:47 UTC

*** This bug has been marked as a duplicate of bug 322941 ***