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

Bug 339976

Summary: sys-apps/portage-2.1.9.13: emerge process uses 100% cpu power during eautoreconf
Product: Portage Development Reporter: Andreas Fink <finkandreas>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS, REGRESSION
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 335925    

Description Andreas Fink 2010-10-06 19:27:27 UTC
I have a very strange problem with emerge where it uses 100% cpu power while waiting for other processes to finish. Here the steps to reproduce:
1. open a terminal and start 'top'
2. emerge -a1 dbus
3. Wait until the merge arrives at the point where eautoreconf is called (i.e. when you see this line:  * Running eautoreconf in '/var/tmp/portage/sys-apps/dbus-1.4.0/work/dbus-1.4.0' ...)
4. Watch the cpu usage of emerge until you see this line: ">>> Source prepared."

On my 3 machines emerge always uses a lot of cpu power (on a single-core machine 50% and on a dual-core machine 100% of one core). 
Anyone here who can reproduce this too (it cannot be that only I am suffering of this problem)????
I've talked to zmedico in #gentoo-portage and he told me, I should post a bug.

This happens with portage-2.1.9* (2.1.8* worked fine but zmedico told me that there was no inter-process-communication in that version)

PS: You can use any ebuild that calles eautoreconf (f.ex. pekwm is a good example too)

Reproducible: Always

Actual Results:  
CPU usage is 100% during eautoreconf of the emerge process

Expected Results:  
CPU usage should be somewhat around 0%, since emerge is only waiting for other processes to finish.
Comment 1 Andreas Fink 2010-10-06 19:42:38 UTC
Portage 2.1.9.13 (default/linux/amd64/10.0, gcc-4.4.4, glibc-2.12.1-r1, 2.6.35-zen2 x86_64)
=================================================================
System uname: Linux-2.6.35-zen2-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_TK-53-with-gentoo-2.0.1
Timestamp of tree: Wed, 06 Oct 2010 05:45:03 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8-sse3 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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"
CXXFLAGS="-march=k8-sse3 -O2 -pipe"
DISTDIR="/home/distdir/"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/ http://gentoo.mneisen.org/ "
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12 --silent"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog --delete-excluded"
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="/home/portage-temp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X acl acpi alsa amd64 bash-completion berkdb bzip2 cli cracklib crypt cups cxx dbus dri fam fortran gdbm gif gpm gtk iconv ipv6 jpeg jpeg2k kpathsea lirc mmx mmxext mng modules mudflap multilib ncurses nls nptl nptlonly opengl openmp pam pcre pdf perl png pppd python qt4 readline reflection session sse sse2 ssl startup-notification svg sysfs tcpd threads tiff truetype unicode xcomposite 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 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" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau" 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, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 2 Andreas Fink 2010-10-06 19:43:45 UTC
I've tried it with portage-2.2_rc89 and there I can see the same behaviour, so it's not limited to the 2.1.9* series...
Comment 3 Zac Medico gentoo-dev 2010-10-06 19:50:25 UTC
Relevant comments from irc:

<Jocker16> btw: this is the handler which is called all the time: EbuildIpcDaemon._input_handler(fd=3, event=16)
<zmedico> that event handler is special, since it's a non-blocking-read fifo stream
Comment 4 Zac Medico gentoo-dev 2010-10-06 19:53:50 UTC
(In reply to comment #3)
> <Jocker16> btw: this is the handler which is called all the time:
> EbuildIpcDaemon._input_handler(fd=3, event=16)

That event 16 means POLLHUP, so it seems like maybe spurious POLLHUP events are being generated somehow.
Comment 6 Zac Medico gentoo-dev 2010-10-08 02:37:30 UTC
This is fixed in 2.1.9.14 and 2.2_rc91.