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

Bug 335777

Summary: sys-apps/portage-2.2* leaves stale processes after being killed
Product: Portage Development Reporter: Dennis Schridde <devurandom>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS, REGRESSION
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Dennis Schridde 2010-09-03 11:28:35 UTC
I killed emerge during the merge of sys-apps/portage-2.2_rc74 and sys-apps/gawk-3.1.8, which apparently resulted in some ebuild.sh and ebuild-ipc.py processes being left behind. I noticed this behaviour while trying to unmount /var/tmp/portage.

ps aux says:
root     23459  0.0  0.1  60608  9960 ?        S    12:39   0:00 /usr/bin/python3.1 /usr/lib64/portage/bin/ebuild-ipc.py exit 0
portage  31579  0.0  0.0   4000   620 pts/2    S    10:55   0:00 [sys-apps/portage-2.2_rc74] sandbox "/usr/lib64/portage/bin/ebuild.sh" test
portage  31582  0.0  0.0  17324  3848 pts/2    S    10:55   0:00 /bin/bash /usr/lib64/portage/bin/ebuild.sh test
portage  31613  0.0  0.0  17324  3360 pts/2    S    10:55   0:00 /bin/bash /usr/lib64/portage/bin/ebuild.sh test
portage  31618  0.0  0.0  17324  3168 pts/2    S    10:55   0:00 /bin/bash /usr/lib64/portage/bin/ebuild.sh test
portage  31686  0.0  0.1  60448  9796 pts/2    S    10:55   0:00 /usr/bin/python3.1 /usr/lib64/portage/bin/ebuild-ipc.py exit 1

lsof says:
COMMAND     PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
misc-func 23158    root  cwd    DIR   0,15       40 696566 /var/tmp/portage/sys-apps/gawk-3.1.8/image (deleted)
python3.1 23459    root  cwd    DIR   0,15       40 696566 /var/tmp/portage/sys-apps/gawk-3.1.8/image (deleted)
python3.1 23459    root    3uW  REG   0,15        0 699377 /var/tmp/portage/sys-apps/gawk-3.1.8/.ipc_lock (deleted)
python3.1 23459    root    4r  FIFO   0,15      0t0 685629 /var/tmp/portage/sys-apps/gawk-3.1.8/.ipc_out (deleted)
ebuild.sh 31582 portage  cwd    DIR   0,15       40  73985 /var/tmp/portage/sys-apps/portage-2.2_rc74 (deleted)
ebuild.sh 31613 portage  cwd    DIR   0,15       40  74663 /var/tmp/portage/sys-apps/portage-2.2_rc74/work/portage-2.2_rc68 (deleted)
ebuild.sh 31618 portage  cwd    DIR   0,15       40  74663 /var/tmp/portage/sys-apps/portage-2.2_rc74/work/portage-2.2_rc68 (deleted)
ebuild.sh 31618 portage    1w   REG   0,15    27735  77576 /var/tmp/portage/sys-apps/portage-2.2_rc74/temp/environment (deleted)
python3.1 31686 portage  cwd    DIR   0,15       40  74663 /var/tmp/portage/sys-apps/portage-2.2_rc74/work/portage-2.2_rc68 (deleted)
python3.1 31686 portage    1w   REG   0,15    27735  77576 /var/tmp/portage/sys-apps/portage-2.2_rc74/temp/environment (deleted)
python3.1 31686 portage    3uW  REG   0,15        0  77667 /var/tmp/portage/sys-apps/portage-2.2_rc74/.ipc_lock (deleted)
python3.1 31686 portage    4r  FIFO   0,15      0t0  74266 /var/tmp/portage/sys-apps/portage-2.2_rc74/.ipc_out (deleted)


Reproducible: Sometimes
Comment 1 Dennis Schridde 2010-09-03 11:29:29 UTC
Portage 2.2_rc74 (default/linux/amd64/10.0/desktop/kde, gcc-4.4.4, glibc-2.11.2-r0, 2.6.35-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.35-gentoo-r5-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_5000+-with-gentoo-2.0.1
Timestamp of tree: Fri, 03 Sep 2010 08:20:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
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.65-r1
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r1
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="-pipe -O2 -march=athlon64-sse3 -fstack-protector -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /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/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/portage /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-pipe -O2 -march=athlon64-sse3 -fstack-protector -ftree-vectorize"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
GENTOO_MIRRORS="ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="de"
MAKEOPTS="-j3"
PKGDIR="/var/cache/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--times"
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="/var/cache/portage/gentoo"
PORTDIR_OVERLAY="/var/cache/portage/layman/java-overlay /var/cache/portage/layman/kde /var/cache/portage/layman/oss-overlay /var/cache/portage/layman/pcsx2 /var/cache/portage/layman/sunrise /var/cache/portage/local"
[...]
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS

Comment 2 Zac Medico gentoo-dev 2010-09-03 21:31:32 UTC
Add a 40 second timeout in ebuild-ipc.py, so that if an orphan is left for any reason then it will exit with an error message instead of hanging indefinitely:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12d2ff4f018c826c750896e8085cd53a589a8521
Comment 3 Zac Medico gentoo-dev 2010-09-04 07:46:23 UTC
This is fixed in 2.2_rc75 and 2.1.9.