Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 374335 - sys-apps/portage-2.1.10.3 crashes with "IOError: [Errno 9] Bad file descriptor" triggered by app-portage/portage-mod_jabber
Summary: sys-apps/portage-2.1.10.3 crashes with "IOError: [Errno 9] Bad file descripto...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 409383
  Show dependency tree
 
Reported: 2011-07-07 11:34 UTC by Nico Baggus
Modified: 2012-03-28 01:16 UTC (History)
2 users (show)

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


Attachments
fix mod_jabber to disconnect its socket (mod_jabber.patch,395 bytes, patch)
2011-07-09 17:01 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Baggus 2011-07-07 11:34:07 UTC
After an install the install fails... AFTER merge.
The next merge find all files installed but without package & complains & merges...
Another install (of dnsmasq see results) just works......

Reproducible: Always

Steps to Reproduce:
1. In this case emerge libvirt failed on install of new components
2. so emerge -va libvirt
Actual Results:  
See below...

Expected Results:  
flawless install in stead of double compiles?

 emerge --info
Portage 2.1.10.3 (default/linux/x86/10.0, gcc-4.4.5, glibc-2.12.2-r0, 2.6.35-vs2.3.0.36.32-gentoo i686)
=================================================================
System uname: Linux-2.6.35-vs2.3.0.36.32-gentoo-i686-AMD_Phenom-tm-_II_X4_810_Processor-with-gentoo-2.0.2
Timestamp of tree: Tue, 05 Jul 2011 17:00:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.1-r1, 3.1.3-r1
dev-util/ccache:          2.4-r9
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.25-r2
sys-apps/baselayout:      2.0.2
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.68
sys-devel/automake:       1.10.3, 1.11.1
sys-devel/binutils:       2.20.1-r1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.2.10
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo voip kolab scarabeus_local_overlay sunrise x-portage
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openfire/resources/security/ /usr/lib/fax /usr/share/gnupg/qualified.txt /var/spool/fax/etc"
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.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs"
DISTDIR="/data/distdir"
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 userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/ rsync://212.219.56.133/www.ibiblio.org/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB en_US nl en"
MAKEOPTS="-j9"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/voip /var/lib/layman/kolab /var/lib/layman/scarabeus /var/lib/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext aac aalib acl acpi ads aio alsa amr apache2 apm audit avahi bash-completion berkdb bluetooth bookmarks bzip2 caps cli consolekit cracklib crypt cups curl cxx dbus dga directfb djvu dri encode esd exif expat fam fax fbcon ffmpeg flac fltk foomaticdb fortran gamin gd gdbm ggi gif gmp gpm graphviz gstreamer iconv idn ipv6 ithreads jack java jbig jpeg jpeg2k kerberos kolab lcms ldap ldb libcaca libsamplerate lm_sensors lzma mad mikmod mmap mmx mmxext mng modules mp3 mudflap mysql ncurses network nforce2 nls nptl nptlonly nvidia odbc ogg openexr openldap openmp pam pcre pdf perl php plotutils png policykit ppds pppd python radius readline samba sasl sdl session skey slang sndfile snmp speex spell sqlite sse sse2 sse4a ssl subversion sysfs syslog tcpd theora tiff truetype unicode usb vde vim-syntax vorbis x86 xattr xfs xml xorg zeroconf zip zlib" ALSA_CARDS="usb-audio hda-intel cs4232 intel8x0 wavefront" 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 auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" FOO2ZJS_DEVICES="hp2600n" 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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en_US nl en" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="arm i386 m68k x86_64" QEMU_USER_TARGETS="none" RUBY_TARGETS="ruby18" SANE_BACKENDS="net v4l hpaio" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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
Comment 1 Nico Baggus 2011-07-07 11:34:42 UTC
>>> Emerging (2 of 6) net-dns/dnsmasq-2.57
 * dnsmasq-2.57.tar.lzma RMD160 SHA1 SHA256 size ;-) ...                                                           [ ok ]
 * Package:    net-dns/dnsmasq-2.57
 * Repository: gentoo
 * Maintainer: chutzpah@gentoo.org
 * USE:        dbus dhcp elibc_glibc idn ipv6 kernel_linux nls userland_GNU x86
 * FEATURES:   sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking dnsmasq-2.57.tar.lzma to /var/tmp/portage/net-dns/dnsmasq-2.57/work
>>> Source unpacked in /var/tmp/portage/net-dns/dnsmasq-2.57/work
>>> Preparing source in /var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57 ...
 * Applying dnsmasq-2.47-fbsd-config.patch ...                                                                     [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57 ...
make -j9 PREFIX=/usr CC=i686-pc-linux-gnu-gcc 'CFLAGS=-march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs' 'COPTS= -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN' all-i18n
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c cache.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c rfc1035.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c util.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c option.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c forward.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c network.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c dnsmasq.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c dhcp.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c lease.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c rfc2131.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c netlink.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c dbus.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c bpf.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c helper.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c tftp.c
i686-pc-linux-gnu-gcc -march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs -DNO_TFTP -DHAVE_DBUS -DHAVE_IDN -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include       -c log.c
i686-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -o dnsmasq cache.o rfc1035.o util.o option.o forward.o network.o dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o helper.o tftp.o log.o -ldbus-1 -lpthread -lrt     -lidn
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
xgettext -d dnsmasq --foreign-user --omit-header --keyword=_ -o dnsmasq.pot -i cache.c rfc1035.c util.c option.c forward.c network.c dnsmasq.c dhcp.c lease.c rfc2131.c netlink.c dbus.c bpf.c helper.c tftp.c log.c
msgmerge -o - ../po/de.po dnsmasq.pot | msgfmt -o de.mo -
.......................................................... done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
msgmerge -o - ../po/es.po dnsmasq.pot | msgfmt -o es.mo -
.......................................................... done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
msgmerge -o - ../po/fi.po dnsmasq.pot | msgfmt -o fi.mo -
...................................................... done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
msgmerge -o - ../po/fr.po dnsmasq.pot | msgfmt -o fr.mo -
...................................................... done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
msgmerge -o - ../po/id.po dnsmasq.pot | msgfmt -o id.mo -
................................................ done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
msgmerge -o - ../po/it.po dnsmasq.pot | msgfmt -o it.mo -
............................................................. done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
msgmerge -o - ../po/no.po dnsmasq.pot | msgfmt -o no.mo -
.................................................... done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
msgmerge -o - ../po/pl.po dnsmasq.pot | msgfmt -o pl.mo -
.......................................................... done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
msgmerge -o - ../po/pt_BR.po dnsmasq.pot | msgfmt -o pt_BR.mo -
......................................................... done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
msgmerge -o - ../po/ro.po dnsmasq.pot | msgfmt -o ro.mo -
........................................................ done.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
>>> Source compiled.
>>> Test phase [not enabled]: net-dns/dnsmasq-2.57

>>> Install dnsmasq-2.57 into /var/tmp/portage/net-dns/dnsmasq-2.57/image/ category net-dns
make -j9 PREFIX=/usr MANDIR=/usr/share/man DESTDIR=/var/tmp/portage/net-dns/dnsmasq-2.57/image/ install-i18n
install -d /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/sbin -d /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/man/man8
install -m 644 man/dnsmasq.8 /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/man/man8
install -m 755 src/dnsmasq /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/sbin
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `dnsmasq' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `de.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `es.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `fi.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `fr.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `id.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `it.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `no.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `pl.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `pt_BR.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: Entering directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
make[1]: `ro.mo' is up to date.
make[1]: Leaving directory `/var/tmp/portage/net-dns/dnsmasq-2.57/work/dnsmasq-2.57/src'
cd src; ../bld/install-mo /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale install
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/de/LC_MESSAGES/dnsmasq.mo
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/es/LC_MESSAGES/dnsmasq.mo
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/fi/LC_MESSAGES/dnsmasq.mo
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/fr/LC_MESSAGES/dnsmasq.mo
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/id/LC_MESSAGES/dnsmasq.mo
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/it/LC_MESSAGES/dnsmasq.mo
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/no/LC_MESSAGES/dnsmasq.mo
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/pl/LC_MESSAGES/dnsmasq.mo
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/pt_BR/LC_MESSAGES/dnsmasq.mo
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/locale/ro/LC_MESSAGES/dnsmasq.mo
cd man; ../bld/install-man /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/man install
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/man/es/man8/dnsmasq.8
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/man/fr/man8/dnsmasq.8
>>> Completed installing dnsmasq-2.57 into /var/tmp/portage/net-dns/dnsmasq-2.57/image/

strip: i686-pc-linux-gnu-strip --strip-unneeded -R .comment
   usr/sbin/dnsmasq
ecompressdir: bzip2 -9 /usr/share/man

>>> Installing (2 of 6) net-dns/dnsmasq-2.57
 * checking 22 files for package collisions
>>> Merging net-dns/dnsmasq-2.57 to /
--- /usr/
--- /usr/sbin/
>>> /usr/sbin/dnsmasq
--- /usr/share/
--- /usr/share/man/
--- /usr/share/man/man8/
>>> /usr/share/man/man8/dnsmasq.8.bz2
--- /usr/share/man/es/
>>> /usr/share/man/es/man8/
>>> /usr/share/man/es/man8/dnsmasq.8.bz2
--- /usr/share/man/fr/
--- /usr/share/man/fr/man8/
>>> /usr/share/man/fr/man8/dnsmasq.8.bz2
--- /usr/share/locale/
--- /usr/share/locale/de/
--- /usr/share/locale/de/LC_MESSAGES/
>>> /usr/share/locale/de/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/es/
--- /usr/share/locale/es/LC_MESSAGES/
>>> /usr/share/locale/es/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/fi/
--- /usr/share/locale/fi/LC_MESSAGES/
>>> /usr/share/locale/fi/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/fr/
--- /usr/share/locale/fr/LC_MESSAGES/
>>> /usr/share/locale/fr/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/id/
--- /usr/share/locale/id/LC_MESSAGES/
>>> /usr/share/locale/id/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/it/
--- /usr/share/locale/it/LC_MESSAGES/
>>> /usr/share/locale/it/LC_MESSAGES/dnsmasq.mo
>>> /usr/share/locale/no/
>>> /usr/share/locale/no/LC_MESSAGES/
>>> /usr/share/locale/no/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/pl/
--- /usr/share/locale/pl/LC_MESSAGES/
>>> /usr/share/locale/pl/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/pt_BR/
--- /usr/share/locale/pt_BR/LC_MESSAGES/
>>> /usr/share/locale/pt_BR/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/ro/
--- /usr/share/locale/ro/LC_MESSAGES/
>>> /usr/share/locale/ro/LC_MESSAGES/dnsmasq.mo
--- /usr/share/doc/
>>> /usr/share/doc/dnsmasq-2.57/
>>> /usr/share/doc/dnsmasq-2.57/FAQ.bz2
>>> /usr/share/doc/dnsmasq-2.57/html/
>>> /usr/share/doc/dnsmasq-2.57/html/doc.html
>>> /usr/share/doc/dnsmasq-2.57/html/setup.html
>>> /usr/share/doc/dnsmasq-2.57/CHANGELOG.bz2
--- /etc/
--- /etc/init.d/
>>> /etc/init.d/dnsmasq
--- /etc/conf.d/
>>> /etc/conf.d/dnsmasq
>>> /etc/dnsmasq.conf
--- /etc/dbus-1/
--- /etc/dbus-1/system.d/
>>> /etc/dbus-1/system.d/dnsmasq.conf
Traceback (most recent call last):
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4073, in merge
    counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3413, in treewalk
    self.vartree.dbapi._fs_unlock()
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 240, in _fs_unlock
    unlockfile(self._fs_lock_obj)
  File "/usr/lib/portage/pym/portage/locks.py", line 221, in unlockfile
    locking_method(myfd,fcntl.LOCK_UN)
IOError: [Errno 9] Bad file descriptor

>>> Failed to install net-dns/dnsmasq-2.57, Log file:

>>>  '/var/log/portage/net-dns:dnsmasq-2.57:20110706-150650.log'
Comment 2 Nico Baggus 2011-07-07 11:36:57 UTC
Some input has been clipped as ther is no error in the build itself...


/man8/dnsmasq.8
installing /var/tmp/portage/net-dns/dnsmasq-2.57/image//usr/share/man/fr/man8/dnsmasq.8
>>> Completed installing dnsmasq-2.57 into /var/tmp/portage/net-dns/dnsmasq-2.57/image/

strip: i686-pc-linux-gnu-strip --strip-unneeded -R .comment
   usr/sbin/dnsmasq
ecompressdir: bzip2 -9 /usr/share/man

>>> Installing (1 of 5) net-dns/dnsmasq-2.57
 * checking 22 files for package collisions
 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at http://bugs.gentoo.org unless you report exactly which
 * two packages install the same file(s). Once again, please do NOT file
 * a bug report unless you have completely understood the above message.
 *
 * Detected file collision(s):
 *
 *      /usr/sbin/dnsmasq
 *      /usr/share/man/man8/dnsmasq.8.bz2
 *      /usr/share/man/es/man8/dnsmasq.8.bz2
 *      /usr/share/man/fr/man8/dnsmasq.8.bz2
 *      /usr/share/locale/de/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/locale/es/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/locale/fi/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/locale/fr/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/locale/id/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/locale/it/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/locale/no/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/locale/pl/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/locale/pt_BR/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/locale/ro/LC_MESSAGES/dnsmasq.mo
 *      /usr/share/doc/dnsmasq-2.57/FAQ.bz2
 *      /usr/share/doc/dnsmasq-2.57/CHANGELOG.bz2
 *      /usr/share/doc/dnsmasq-2.57/html/doc.html
 *      /usr/share/doc/dnsmasq-2.57/html/setup.html
 *
 * Searching all installed packages for file collisions...
 *
 * Press Ctrl-C to Stop
 *
 * None of the installed packages claim the file(s).
 *
 * Package 'net-dns/dnsmasq-2.57' merged despite file collisions. If
 * necessary, refer to your elog messages for the whole content of the
 * above message.
>>> Merging net-dns/dnsmasq-2.57 to /
--- /usr/
--- /usr/sbin/
>>> /usr/sbin/dnsmasq
--- /usr/share/
--- /usr/share/man/
--- /usr/share/man/man8/
>>> /usr/share/man/man8/dnsmasq.8.bz2
--- /usr/share/man/es/
--- /usr/share/man/es/man8/
>>> /usr/share/man/es/man8/dnsmasq.8.bz2
--- /usr/share/man/fr/
--- /usr/share/man/fr/man8/
>>> /usr/share/man/fr/man8/dnsmasq.8.bz2
--- /usr/share/locale/
--- /usr/share/locale/de/
--- /usr/share/locale/de/LC_MESSAGES/
>>> /usr/share/locale/de/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/es/
--- /usr/share/locale/es/LC_MESSAGES/
>>> /usr/share/locale/es/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/fi/
--- /usr/share/locale/fi/LC_MESSAGES/
>>> /usr/share/locale/fi/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/fr/
--- /usr/share/locale/fr/LC_MESSAGES/
>>> /usr/share/locale/fr/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/id/
--- /usr/share/locale/id/LC_MESSAGES/
>>> /usr/share/locale/id/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/it/
--- /usr/share/locale/it/LC_MESSAGES/
>>> /usr/share/locale/it/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/no/
--- /usr/share/locale/no/LC_MESSAGES/
>>> /usr/share/locale/no/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/pl/
--- /usr/share/locale/pl/LC_MESSAGES/
>>> /usr/share/locale/pl/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/pt_BR/
--- /usr/share/locale/pt_BR/LC_MESSAGES/
>>> /usr/share/locale/pt_BR/LC_MESSAGES/dnsmasq.mo
--- /usr/share/locale/ro/
--- /usr/share/locale/ro/LC_MESSAGES/
>>> /usr/share/locale/ro/LC_MESSAGES/dnsmasq.mo
--- /usr/share/doc/
--- /usr/share/doc/dnsmasq-2.57/
>>> /usr/share/doc/dnsmasq-2.57/FAQ.bz2
--- /usr/share/doc/dnsmasq-2.57/html/
>>> /usr/share/doc/dnsmasq-2.57/html/doc.html
>>> /usr/share/doc/dnsmasq-2.57/html/setup.html
>>> /usr/share/doc/dnsmasq-2.57/CHANGELOG.bz2
--- /etc/
--- /etc/init.d/
>>> /etc/init.d/dnsmasq
--- /etc/conf.d/
>>> /etc/conf.d/dnsmasq
>>> /etc/dnsmasq.conf
--- /etc/dbus-1/
--- /etc/dbus-1/system.d/
>>> /etc/dbus-1/system.d/dnsmasq.conf
>>> net-dns/dnsmasq-2.57 merged.
>>> Regenerating /etc/ld.so.cache...
Comment 3 Zac Medico gentoo-dev 2011-07-07 12:07:00 UTC
(In reply to comment #1)
> --- /etc/dbus-1/
> --- /etc/dbus-1/system.d/
> >>> /etc/dbus-1/system.d/dnsmasq.conf
> Traceback (most recent call last):
>   File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in
> _spawn
>     prev_mtimes=self.prev_mtimes, counter=counter)
>   File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4073, in merge
>     counter=counter)
>   File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3413, in treewalk
>     self.vartree.dbapi._fs_unlock()
>   File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 240, in _fs_unlock
>     unlockfile(self._fs_lock_obj)
>   File "/usr/lib/portage/pym/portage/locks.py", line 221, in unlockfile
>     locking_method(myfd,fcntl.LOCK_UN)
> IOError: [Errno 9] Bad file descriptor

This IOError is interesting. Are you able to reproduce that?
Comment 4 Nico Baggus 2011-07-07 12:31:39 UTC
At least with libpciaccess-0.12.1 & dnsmasq-2.57

netcat6-1.0-r2, libssh2-1.2.2 did install immediately as did libvirt itself.

So yes and no.
Comment 5 Nico Baggus 2011-07-07 12:34:17 UTC
Also libnl-1.1-r2 did fail before

ebtables-2.0.9.2, yaj1-1.0.11 did succeed
Comment 6 Nico Baggus 2011-07-07 12:46:54 UTC
after unmerge libnl, libpciaccess, dnsmasq 
and running emerge -1 libvirt

libnl (1) builds fine
dnsmasq (2) fails with the same.

So it looks like the second build sometimes fails...

emerge -1 libvirt again
dnsmasq (1) builds,
libpciaccess (2) builds
libvirt (3) builds

So multiple builds seem to be involved.
Maybe the firstbuild forgot to unlock?
Comment 7 Zac Medico gentoo-dev 2011-07-07 17:35:52 UTC
(In reply to comment #6)
> after unmerge libnl, libpciaccess, dnsmasq 
> and running emerge -1 libvirt
> 
> libnl (1) builds fine
> dnsmasq (2) fails with the same.
> 
> So it looks like the second build sometimes fails...

When it fails, does it always fail with an identical error to the one quoted in comment #3?

> emerge -1 libvirt again
> dnsmasq (1) builds,
> libpciaccess (2) builds
> libvirt (3) builds
> 
> So multiple builds seem to be involved.
> Maybe the firstbuild forgot to unlock?

All of the fs_unlock() calls are in finally blocks following fs_lock() calls, so it's not possible to forget. Also, there are assertions inside fs_unlock() and fs_unlock() that will raise AssertionError before the code that raises IOError, so it's interesting that it passed the assertions.

It's also very interesting that nobody else has reported this issue during the couple of months since this code has been released. Have you experienced this problem on more than one machine, or just one?
Comment 8 Nico Baggus 2011-07-07 23:09:41 UTC
I tried some more installs.

The failure is allways identical.
It's allways in the 2nd job if it fails.

And quite to my surprise currently only on this system
(it is a server..)

Another fairly identical system (processor/motherboard) desktop system does work correctly, a selinux based system does funtion correctly
Also a laptop running amd64 code works correctly.

Any idea where to look next on this system, as the problem seems to be confined to this system.
Comment 9 Zac Medico gentoo-dev 2011-07-07 23:35:24 UTC
Try installing sys-apps/portage again, and if nothing changes then please attach `emerge --info --verbose` output.
Comment 10 Nico Baggus 2011-07-07 23:40:58 UTC
Please standby...

BTW, there is another issue, just tried emerge --depclean -p
and it suggests to remove :

!!! 'app-editors/nano' (virtual/editor) is part of your system profile. 
!!! Unmerging it may be damaging to your system.

 app-editors/nano
    selected: 2.2.5 
   protected: none 
     omitted: none 

And that seems queer to me, this IS on all systems involved...
Comment 11 Nico Baggus 2011-07-07 23:49:03 UTC
Portage 2.1.10.3 (default/linux/x86/10.0, gcc-4.4.5, glibc-2.12.2-r0, 2.6.35-vs2.3.0.36.32-gentoo i686)
=================================================================
System uname: Linux-2.6.35-vs2.3.0.36.32-gentoo-i686-AMD_Phenom-tm-_II_X4_810_Processor-with-gentoo-2.0.2
Timestamp of tree: Thu, 07 Jul 2011 20:30:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.1-r1, 3.1.3-r1
dev-util/ccache:          2.4-r9
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.25-r2
sys-apps/baselayout:      2.0.2
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.68
sys-devel/automake:       1.10.3, 1.11.1
sys-devel/binutils:       2.20.1-r1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.2.10
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories:

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

voip
    location: /var/lib/layman/voip
    masters: gentoo
    priority: 0

kolab
    location: /var/lib/layman/kolab
    masters: gentoo
    priority: 1

scarabeus_local_overlay
    location: /var/lib/layman/scarabeus
    masters: gentoo
    priority: 2

sunrise
    location: /var/lib/layman/sunrise
    masters: gentoo
    priority: 3

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 4

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1"
ACCEPT_PROPERTIES="*"
ALSA_CARDS="usb-audio hda-intel cs4232 intel8x0 wavefront"
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"
AMANDA_CONFIG_NAME="DailySet1"
AMANDA_DBGDIR="/var/spool/amanda/tmp"
AMANDA_DBMODE="db"
AMANDA_GROUP_GID="87"
AMANDA_GROUP_NAME="amanda"
AMANDA_MAX_TAPE_BLOCK_KB="512"
AMANDA_PORTS=""
AMANDA_PORTS_BOTH=""
AMANDA_PORTS_TCP=""
AMANDA_PORTS_UDP=""
AMANDA_SERVER="irma"
AMANDA_SERVER_INDEX="irma"
AMANDA_SERVER_TAPE="irma"
AMANDA_TAR="/bin/tar"
AMANDA_TAR_LISTDIR="/var/spool/amanda/tar-lists"
AMANDA_TMPDIR="/var/spool/amanda/tmp"
AMANDA_USER_GROUPS="amanda"
AMANDA_USER_HOMEDIR="/var/spool/amanda"
AMANDA_USER_NAME="amanda"
AMANDA_USER_SH="/bin/false"
AMANDA_USER_UID="87"
ANT_HOME="/usr/share/ant"
APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias"
ARCH="x86"
AUTOCLEAN="yes"
CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words"
CAMERAS="ptp2"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs"
CHOST="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
COLLISION_IGNORE="/lib/modules"
CONFIG_PROTECT="/etc /opt/openfire/resources/security/ /usr/lib/fax /usr/share/gnupg/qualified.txt /var/spool/fax/etc"
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.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CVS_RSH="ssh"
CXXFLAGS="-march=amdfam10 -O2 -pipe -mno-tls-direct-seg-refs"
DCCC_PATH="/usr/lib/distcc/bin"
DISTCC_LOG=""
DISTCC_VERBOSE=""
DISTDIR="/data/distdir"
EDITOR="vi"
ELIBC="glibc"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FCFLAGS=""
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 userpriv usersandbox"
FETCHCOMMAND="/usr/bin/wget -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
FETCHCOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
FETCHCOMMAND_SFTP="bash -c "x=\${2#sftp://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec sftp -P \${port} \"\${host}:/\${x#*/}\" \"\$1\"" sftp "${DISTDIR}/${FILE}" "${URI}""
FETCHCOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}""
FFLAGS=""
FLTK_DOCDIR="/usr/share/doc/fltk-1.1.9-r1/html"
FOO2ZJS_DEVICES="hp2600n"
GCC_SPECS=""
GDK_USE_XFT="1"
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/ rsync://212.219.56.133/www.ibiblio.org/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/"
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"
GUILE_LOAD_PATH="/usr/share/guile/1.8"
HOME="/root"
INFOPATH="/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.20.1/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.4.5/info"
INPUT_DEVICES="keyboard mouse evdev"
JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
JAVA_HOME="/etc/java-config-2/current-system-vm"
JDK_HOME="/etc/java-config-2/current-system-vm"
KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LESS="-R -M --shift 5"
LESSOPEN="|lesspipe.sh %s"
LINGUAS="en_GB en_US nl en"
LOGNAME="root"
LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"
MAIL="/var/mail/root"
MAKEOPTS="-j9"
MANPAGER="less"
MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.20.1/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.4.5/man:/etc/java-config/system-vm/man/:/usr/lib/php5.3/man/:/usr/share/postgresql/man/:/usr/share/postgresql-9.0/man/"
NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
NOCOLOR="true"
OLDPWD="/root"
OPENGL_PROFILE="xorg-x11"
PAGER="less"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.5"
PHP_TARGETS="php5-3"
PKGDIR="/usr/portage/packages"
PORTAGE_ARCHLIST="ppc sparc64-freebsd ppc-openbsd x86-openbsd ppc64 x86-winnt x86-fbsd ppc-aix alpha arm x86-freebsd s390 amd64 arm-linux x86-macos x64-openbsd ia64-hpux hppa x86-netbsd x86-cygwin amd64-linux ia64-linux x86 sparc-solaris x64-freebsd sparc64-solaris x86-linux x64-macos sparc m68k-mint ia64 mips ppc-macos x86-interix hppa-hpux amd64-fbsd x64-solaris mips-irix m68k sh x86-solaris sparc-fbsd"
PORTAGE_BINHOST_CHUNKSIZE="3000"
PORTAGE_BIN_PATH="/usr/lib/portage/bin"
PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"
PORTAGE_CONFIGROOT="/"
PORTAGE_DEBUG="0"
PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"
PORTAGE_ELOG_CLASSES="warn error log info"
PORTAGE_ELOG_JABBERTO="nico@baggus.net admin@baggus.net"
PORTAGE_ELOG_MAILFROM="portage@localhost"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"
PORTAGE_ELOG_MAILURI="root"
PORTAGE_ELOG_SUBJECT=" on '"
PORTAGE_ELOG_SYSTEM="save jabber"
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
PORTAGE_GID="250"
PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --clearsign --yes --default-key "${PORTAGE_GPG_KEY}" --homedir "${PORTAGE_GPG_DIR}" "${FILE}""
PORTAGE_INST_GID="0"
PORTAGE_INST_UID="0"
PORTAGE_PYM_PATH="/usr/lib/portage/pym"
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_RSYNC_RETRIES="-1"
PORTAGE_SANDBOX_COMPAT_LEVEL="16"
PORTAGE_SYNC_STALE="30"
PORTAGE_TMPDIR="/var/tmp"
PORTAGE_TMPFS="/dev/shm"
PORTAGE_VERBOSE="1"
PORTAGE_WORKDIR_MODE="0700"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/voip /var/lib/layman/kolab /var/lib/layman/scarabeus /var/lib/layman/sunrise /usr/local/portage"
PORT_LOGDIR="/var/log/portage"
PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND"
PWD="/var/lib"
PYTHONDONTWRITEBYTECODE="1"
QEMU_SOFTMMU_TARGETS="arm i386 m68k x86_64"
QEMU_USER_TARGETS="none"
RESUMECOMMAND="/usr/bin/wget -c -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
RESUMECOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
RESUMECOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}""
ROOT="/"
ROOTPATH="/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.5"
RPMDIR="/usr/portage/rpm"
RUBY_TARGETS="ruby18"
SANE_BACKENDS="net v4l hpaio"
SANE_CONFIG_DIR="/etc/sane.d"
SHELL="/bin/bash"
SHLVL="1"
SSH_AGENT_PID="5835"
SSH_AUTH_SOCK="/tmp/ssh-yHzHuZVq5834/agent.5834"
SSH_CLIENT="192.168.6.70 47498 22"
SSH_CONNECTION="192.168.6.70 47498 192.168.6.5 22"
SSH_TTY="/dev/pts/0"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
TERM="xterm"
USB_DEVFS_PATH="/dev/bus/usb"
USE="3dnow 3dnowext aac aalib acl acpi ads aio alsa amr apache2 apm audit avahi bash-completion berkdb bluetooth bookmarks bzip2 caps cli consolekit cracklib crypt cups curl cxx dbus dga directfb djvu dri encode esd exif expat fam fax fbcon ffmpeg flac fltk foomaticdb fortran gamin gd gdbm ggi gif gmp gpm graphviz gstreamer iconv idn ipv6 ithreads jack java jbig jpeg jpeg2k kerberos kolab lcms ldap ldb libcaca libsamplerate lm_sensors lzma mad mikmod mmap mmx mmxext mng modules mp3 mudflap mysql ncurses network nforce2 nls nptl nptlonly nvidia odbc ogg openexr openldap openmp pam pcre pdf perl php plotutils png policykit ppds pppd python radius readline samba sasl sdl session skey slang sndfile snmp speex spell sqlite sse sse2 sse4a ssl subversion sysfs syslog tcpd theora tiff truetype unicode usb vde vim-syntax vorbis x86 xattr xfs xml xorg zeroconf zip zlib" ALSA_CARDS="usb-audio hda-intel cs4232 intel8x0 wavefront" 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 auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" FOO2ZJS_DEVICES="hp2600n" 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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en_US nl en" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="arm i386 m68k x86_64" QEMU_USER_TARGETS="none" RUBY_TARGETS="ruby18" SANE_BACKENDS="net v4l hpaio" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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" 
USER="root"
USERLAND="GNU"
USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CALLIGRA_FEATURES CAMERAS COLLECTD_PLUGINS CROSSCOMPILE_OPTS DRACUT_MODULES DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS GPSD_PROTOCOLS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES NGINX_MODULES_HTTP NGINX_MODULES_MAIL OFED_DRIVERS PHP_TARGETS QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS USERLAND VIDEO_CARDS XFCE_PLUGINS XTABLES_ADDONS"
USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"
VBOX_APP_HOME="/opt/VirtualBox"
VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l"
XDG_SESSION_COOKIE="899533308b14b795c1b9035700260634-1310072255.404410-1906596288"
XSESSION="kde-4"
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"
_="/usr/bin/emerge"
Comment 12 Zac Medico gentoo-dev 2011-07-07 23:54:09 UTC
(In reply to comment #10)
> Please standby...
> 
> BTW, there is another issue, just tried emerge --depclean -p
> and it suggests to remove :
> 
> !!! 'app-editors/nano' (virtual/editor) is part of your system profile. 
> !!! Unmerging it may be damaging to your system.
> 
>  app-editors/nano
>     selected: 2.2.5 
>    protected: none 
>      omitted: none 
> 
> And that seems queer to me, this IS on all systems involved...

This is the intended behavior. See discussion in bug #370295 and bug #370439.
Comment 13 Nico Baggus 2011-07-08 01:23:42 UTC
Ok, i understand.. the nano issue

Maybe something for eselect news?
Comment 14 Zac Medico gentoo-dev 2011-07-08 05:55:24 UTC
(In reply to comment #13)
> Ok, i understand.. the nano issue
> 
> Maybe something for eselect news?

I don't think it's really necessary, since people have always needed to be careful with --depclean, and the solution if people decide they want to keep a package remains the same as always (emerge --noreplace <atom>).
Comment 15 Nico Baggus 2011-07-08 14:04:24 UTC
OK, back on topic, anything you want to be checked?
Comment 16 Zac Medico gentoo-dev 2011-07-08 14:57:59 UTC
It's very puzzling. Have you tried installing sys-apps/portage again like I suggested in comment #9? If that doesn't help then maybe try a reboot.
Comment 17 Nico Baggus 2011-07-08 15:11:11 UTC
I did, and as a respons I posted the requested emerge --info --verbose 
in https:#c11  (comment 11)
Comment 18 Nico Baggus 2011-07-08 15:24:38 UTC
after reboot:
- emerge --unmerge xapian gmime mu ; emerge mu yields:
(xapian, gmime & mu are build in that order.)

>>> Installing (2 of 3) dev-libs/gmime-2.4.22
Traceback (most recent call last):
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4073, in merge
    counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3413, in treewalk
    self.vartree.dbapi._fs_unlock()
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 240, in _fs_unlock
    unlockfile(self._fs_lock_obj)
  File "/usr/lib/portage/pym/portage/locks.py", line 221, in unlockfile
    locking_method(myfd,fcntl.LOCK_UN)
IOError: [Errno 9] Bad file descriptor

>>> Failed to install dev-libs/gmime-2.4.22, Log file:
what does this file descriptor describe?..

The build completes including merge for the first app 
during the 2nd app build AFTER the qmerge etc. it fails to add the newfiles to
the portage database. ( The next rebuild mentions all files in the image as allready present but not owned by any packet and then DO complete the install.
Comment 19 Fabian Groffen gentoo-dev 2011-07-08 15:41:37 UTC
what filesystem is this on?

does the lockfile exists for a died emerge in the filesystem?

would be interesting to know what the value of myfd is, and what lsof would say about python at the moment it hits the error
Comment 20 Zac Medico gentoo-dev 2011-07-08 15:50:22 UTC
(In reply to comment #18)
> what does this file descriptor describe?..

It's used to hold a lock on /var/lib/portage/config. Any file would work for this purpose, and we use /var/lib/portage/config just because we can re-use it for this purpose (and it avoids the need to create another file for this purpose).

The same file is also used to implement the config memory (see --noconfmem in emerge man page), and this use should not interfere with its use for locking purposes.
Comment 21 Zac Medico gentoo-dev 2011-07-08 15:58:11 UTC
(In reply to comment #20)
> The same file is also used to implement the config memory (see --noconfmem in
> emerge man page), and this use should not interfere with its use for locking
> purposes.

It's worth noting that you're experiencing the "IOError: [Errno 9] Bad file descriptor" just after the merge code updates /var/lib/portage/config with new config memory data. This shouldn't cause any interference in theory, but it certainly seems to be doing so on your system.
Comment 22 Zac Medico gentoo-dev 2011-07-08 16:08:25 UTC
(In reply to comment #11)
> Portage 2.1.10.3 (default/linux/x86/10.0, gcc-4.4.5, glibc-2.12.2-r0,
> 2.6.35-vs2.3.0.36.32-gentoo i686)

Those glibc and kernel versions seems a little special. The file descriptor interference might be related to one or both of those.
Comment 23 Nico Baggus 2011-07-08 17:24:46 UTC
I rebooted using a gentoo-kernel in stead of the vserver kernel.. (unsurprisingly:  same result).


>>> Installing (2 of 3) dev-libs/gmime-2.4.22
Traceback (most recent call last):
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4073, in merge
    counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3413, in treewalk
    self.vartree.dbapi._fs_unlock()
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 240, in _fs_unlock
    unlockfile(self._fs_lock_obj)
  File "/usr/lib/portage/pym/portage/locks.py", line 221, in unlockfile
    locking_method(myfd,fcntl.LOCK_UN)
IOError: [Errno 9] Bad file descriptor

>>> Failed to install dev-libs/gmime-2.4.22, Log file:

>>>  '/var/log/portage/dev-libs:gmime-2.4.22:20110708-171940.log'

 * GNU info directory index is up-to-date.
data ~ # uname -a
Linux data 2.6.37-gentoo-r4 #3 SMP PREEMPT Fri May 20 23:39:52 CEST 2011 i686 AMD Phenom(tm) II X4 810 Processor AuthenticAMD GNU/Linux
data ~ # eix vserver-sources
[I] sys-kernel/vserver-sources
     Available versions:  
        (2.2.0.7)       2.2.0.7!b!s
        (2.2.0.7-r1)    ~2.2.0.7-r1!b!s
        (2.3.0.36.31)   ~2.3.0.36.31!b!s
        (2.3.0.36.32)   2.3.0.36.32!b!s
        {build deblob symlink}
     Installed versions:  2.3.0.36.32(2.3.0.36.32)!b!s(12:40:34 05/08/11)(-build -deblob -symlink)
     Homepage:            http://www.gentoo.org/proj/en/vps/
     Description:         Full sources including Gentoo and Linux-VServer patchsets for the 2.6 kernel tree.
Comment 24 Nico Baggus 2011-07-08 17:25:49 UTC
$ eix glibc
[I] sys-libs/glibc
     Available versions:  (2.2) ~2.9_p20081201-r3!s 2.10.1-r1!s 2.11.3!s ~2.12.1-r3!s 2.12.2!s ~2.13-r2!s ~2.13-r3!s **2.14!s
        {crosscompile_opts_headers-only debug gd glibc-omitfp hardened multilib nls profile selinux vanilla}
     Installed versions:  2.12.2(2.2)!s(23:22:31 05/20/11)(gd nls -crosscompile_opts_headers-only -debug -glibc-omitfp -hardened -multilib -profile -selinux -vanilla)                                                                                                                                              
     Homepage:            http://www.gnu.org/software/libc/libc.html
     Description:         GNU libc6 (also called glibc2) C library
Comment 25 Zac Medico gentoo-dev 2011-07-08 17:33:05 UTC
Maybe unpack an official stage3, chroot into it, and see if you can reproduce the bug in there. Given that you reproduced the problem with the gentoo-kernel, it seems that your userland is broken somehow.
Comment 26 Nico Baggus 2011-07-08 17:35:10 UTC
(In reply to comment #19)
> what filesystem is this on?
> 
> does the lockfile exists for a died emerge in the filesystem?

data ~ # ls -l /var/lib/portage/config
-rw-rw---- 1 root portage 107696 Jul  7 14:48 /var/lib/portage/config
data ~ # df /var/lib/portage/config
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/md2               9621816   7613228   1519816  84% /


> 
> would be interesting to know what the value of myfd is, and what lsof would say
> about python at the moment it hits the error

how can one do lsof when the process is allready gone... (or where can i insert a call to system('lsof ...'); print "myfd=",$myfd;
Comment 27 Nico Baggus 2011-07-08 17:37:00 UTC
And from mount:

/dev/md2 on / type ext3 (rw,noatime,errors=continue,acl,barrier=0,data=writeback,usrquota,grpquota)

The system is a quadcore Phenom processor.
Comment 28 Nico Baggus 2011-07-08 18:11:22 UTC
After adding:  >>>
        try:
                if myfd is None:
                        myfd = os.open(lockfilename, os.O_WRONLY,0o660)
                        unlinkfile = 1
>>>                writemsg(_("myfd = %d\n") % myfd)
                locking_method(myfd,fcntl.LOCK_UN)
        except OSError:
                if isinstance(lockfilename, basestring):
                        os.close(myfd)
                raise IOError(_("Failed to unlock file '%s'\n") % lockfilename)

This is the result:


/var/tmp/portage/dev-libs/gmime-2.4.22/image/usr/lib/libgmime-2.4.la: Updating...
myfd = 3
strip: i686-pc-linux-gnu-strip --strip-unneeded -R .comment
   usr/lib/libgmime-2.4.so.2.4.22
   usr/bin/gmime-uuencode-2.4
   usr/bin/gmime-uudecode-2.4
   usr/lib/libgmime-2.4.a
removing executable bit: usr/lib/libgmime-2.4.la
myfd = 3

>>> Installing (2 of 3) dev-libs/gmime-2.4.22
myfd = 4
myfd = 3
myfd = 3
myfd = 3
myfd = 3
Traceback (most recent call last):
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4073, in merge
    counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3413, in treewalk
    self.vartree.dbapi._fs_unlock()
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 240, in _fs_unlock
    unlockfile(self._fs_lock_obj)
  File "/usr/lib/portage/pym/portage/locks.py", line 222, in unlockfile
    locking_method(myfd,fcntl.LOCK_UN)
IOError: [Errno 9] Bad file descriptor
myfd = 12
myfd = 6
myfd = 3

>>> Failed to install dev-libs/gmime-2.4.22, Log file:
Comment 29 Nico Baggus 2011-07-08 20:17:31 UTC
I also added a catch IOError clause, and that printer 3 for myfd.
and the mentioned /..../config file as name.

Now for the stage3 + chroot.
Comment 30 Nico Baggus 2011-07-08 22:12:35 UTC
>>> Installing (2 of 3) dev-libs/gmime-2.4.22
@OSERR: myfd = 3
Filename: /var/lib/portage/config unlinkfile 0
Traceback (most recent call last):
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4073, in merge
    counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3413, in treewalk
    self.vartree.dbapi._fs_unlock()
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 240, in _fs_unlock
    unlockfile(self._fs_lock_obj)
  File "/usr/lib/portage/pym/portage/locks.py", line 221, in unlockfile
    locking_method(myfd,fcntl.LOCK_UN)
IOError: [Errno 9] Bad file descriptor

>>> Failed to install dev-libs/gmime-2.4.22, Log file:

>>>  '/var/log/portage/dev-libs:gmime-2.4.22:20110708-214826.log'

LSOF output

COMMAND     PID       USER   FD      TYPE     DEVICE    SIZE/OFF       NODE NAME
emerge    12846       root  cwd       DIR        9,2        4096     538561 /root
emerge    12846       root  rtd       DIR        9,2        4096          2 /
emerge    12846       root  txt       REG        9,2        5368     900490 /usr/bin/python2.7
emerge    12846       root  mem       REG        9,2      687208     900673 /usr/lib/python2.7/lib-dynload/unicodedata.so
emerge    12846       root  mem       REG        9,2      323096     935694 /lib/libncursesw.so.5.7
emerge    12846       root  mem       REG        9,2       65984     900780 /usr/lib/python2.7/lib-dynload/_curses.so
emerge    12846       root  mem       REG        9,2       19012     900674 /usr/lib/python2.7/lib-dynload/_locale.so
emerge    12846       root  mem       REG        9,2       18492     705023 /usr/lib/python2.7/site-packages/Crypto/Hash/RIPEMD160.so
emerge    12846       root  mem       REG        9,2      156968     688468 /usr/lib/libexpat.so.1.5.2
emerge    12846       root  mem       REG        9,2       10268     705022 /usr/lib/python2.7/site-packages/Crypto/Hash/SHA256.so
emerge    12846       root  mem       REG        9,2       68584     900683 /usr/lib/python2.7/lib-dynload/cPickle.so
emerge    12846       root  mem       REG        9,2       41860     900833 /usr/lib/python2.7/lib-dynload/pyexpat.so
emerge    12846       root  mem       REG        9,2       71296     696411 /lib/libresolv-2.12.2.so
emerge    12846       root  mem       REG        9,2        9368     690880 /lib/libkeyutils-1.2.so
emerge    12846       root  mem       REG        9,2       26060     852143 /usr/lib/libkrb5support.so.0.1
emerge    12846       root  mem       REG        9,2       13628     736137 /lib/libcom_err.so.2.1
emerge    12846       root  mem       REG        9,2      140872     852041 /usr/lib/libk5crypto.so.3.1
emerge    12846       root  mem       REG        9,2      733232     852054 /usr/lib/libkrb5.so.3.3
emerge    12846       root  mem       REG        9,2      356188     966553 /usr/lib/libssl.so.1.0.0
emerge    12846       root  mem       REG        9,2       35584     900834 /usr/lib/python2.7/lib-dynload/_elementtree.so
emerge    12846       root  mem       REG        9,2       17724     900746 /usr/lib/python2.7/lib-dynload/termios.so
emerge    12846       root  mem       REG        9,2       21388     900818 /usr/lib/python2.7/lib-dynload/zlib.so
emerge    12846       root  mem       REG        9,2       28524     900709 /usr/lib/python2.7/lib-dynload/_ssl.so
emerge    12846       root  mem       REG        9,2     1484288     966551 /usr/lib/libcrypto.so.1.0.0
emerge    12846       root  mem       REG        9,2       10580     900665 /usr/lib/python2.7/lib-dynload/_functools.so
emerge    12846       root  mem       REG        9,2       53840     900708 /usr/lib/python2.7/lib-dynload/_socket.so
emerge    12846       root  mem       REG        9,2        9980     900658 /usr/lib/python2.7/lib-dynload/_random.so
emerge    12846       root  mem       REG        9,2       30140     900536 /usr/lib/python2.7/lib-dynload/math.so
emerge    12846       root  mem       REG        9,2      124868     900664 /usr/lib/python2.7/lib-dynload/_io.so
emerge    12846       root  mem       REG        9,2       79352     711728 /lib/libz.so.1.2.5
emerge    12846       root  mem       REG        9,2       15132     900711 /usr/lib/python2.7/lib-dynload/_hashlib.so
emerge    12846       root  mem       REG        9,2        9972     900759 /usr/lib/python2.7/lib-dynload/resource.so
emerge    12846       root  mem       REG        9,2       36136     900493 /usr/lib/python2.7/lib-dynload/array.so
emerge    12846       root  mem       REG        9,2       10356     900677 /usr/lib/python2.7/lib-dynload/grp.so
emerge    12846       root  mem       REG        9,2       19228     900831 /usr/lib/python2.7/lib-dynload/binascii.so
emerge    12846       root  mem       REG        9,2       30600     899843 /usr/lib/python2.7/lib-dynload/_struct.so
emerge    12846       root  mem       REG        9,2       17212     900675 /usr/lib/python2.7/lib-dynload/fcntl.so
emerge    12846       root  mem       REG        9,2       22128     900679 /usr/lib/python2.7/lib-dynload/select.so
emerge    12846       root  mem       REG        9,2       22124     900537 /usr/lib/python2.7/lib-dynload/strop.so
emerge    12846       root  mem       REG        9,2       16620     900662 /usr/lib/python2.7/lib-dynload/_heapq.so
emerge    12846       root  mem       REG        9,2       46436     900570 /usr/lib/python2.7/lib-dynload/itertools.so
emerge    12846       root  mem       REG        9,2       29776     900663 /usr/lib/python2.7/lib-dynload/operator.so
emerge    12846       root  mem       REG        9,2      149256     696512 /lib/libm-2.12.2.so
emerge    12846       root  mem       REG        9,2        9612     696489 /lib/libutil-2.12.2.so
emerge    12846       root  mem       REG        9,2        9604     693624 /lib/libdl-2.12.2.so
emerge    12846       root  mem       REG        9,2     1442204     696462 /lib/libc-2.12.2.so
emerge    12846       root  mem       REG        9,2      121220     696505 /lib/libpthread-2.12.2.so
emerge    12846       root  mem       REG        9,2     1464620     899849 /usr/lib/libpython2.7.so.1.0
emerge    12846       root  mem       REG        9,2       11276     900660 /usr/lib/python2.7/lib-dynload/_bisect.so
emerge    12846       root  mem       REG        9,2       25228     900659 /usr/lib/python2.7/lib-dynload/_collections.so
emerge    12846       root  mem       REG        9,2       16688     900682 /usr/lib/python2.7/lib-dynload/cStringIO.so
emerge    12846       root  mem       REG        9,2       18492     900556 /usr/lib/python2.7/lib-dynload/time.so
emerge    12846       root  mem       REG        9,2      121964     696474 /lib/ld-2.12.2.so
emerge    12846       root    0u      CHR      136,0         0t0          3 /dev/pts/0
emerge    12846       root    1w     FIFO        0,6         0t0    1755015 pipe
emerge    12846       root    2w     FIFO        0,6         0t0    1755015 pipe
emerge    12846       root   11w     FIFO        0,6         0t0    1755016 pipe



emerge    14577       root  cwd       DIR        9,2        4096     538561 /root
emerge    14577       root  rtd       DIR        9,2        4096          2 /
emerge    14577       root  txt       REG        9,2        5368     900490 /usr/bin/python2.7
emerge    14577       root  mem       REG        9,2      687208     900673 /usr/lib/python2.7/lib-dynload/unicodedata.so
emerge    14577       root  mem       REG        9,2      323096     935694 /lib/libncursesw.so.5.7
emerge    14577       root  mem       REG        9,2       65984     900780 /usr/lib/python2.7/lib-dynload/_curses.so
emerge    14577       root  mem       REG        9,2       19012     900674 /usr/lib/python2.7/lib-dynload/_locale.so
emerge    14577       root  mem       REG        9,2       18492     705023 /usr/lib/python2.7/site-packages/Crypto/Hash/RIPEMD160.so
emerge    14577       root  mem       REG        9,2      156968     688468 /usr/lib/libexpat.so.1.5.2
emerge    14577       root  mem       REG        9,2       10268     705022 /usr/lib/python2.7/site-packages/Crypto/Hash/SHA256.so
emerge    14577       root  mem       REG        9,2       68584     900683 /usr/lib/python2.7/lib-dynload/cPickle.so
emerge    14577       root  mem       REG        9,2       41860     900833 /usr/lib/python2.7/lib-dynload/pyexpat.so
emerge    14577       root  mem       REG        9,2       71296     696411 /lib/libresolv-2.12.2.so
emerge    14577       root  mem       REG        9,2        9368     690880 /lib/libkeyutils-1.2.so
emerge    14577       root  mem       REG        9,2       26060     852143 /usr/lib/libkrb5support.so.0.1
emerge    14577       root  mem       REG        9,2       13628     736137 /lib/libcom_err.so.2.1
emerge    14577       root  mem       REG        9,2      140872     852041 /usr/lib/libk5crypto.so.3.1
emerge    14577       root  mem       REG        9,2      733232     852054 /usr/lib/libkrb5.so.3.3
emerge    14577       root  mem       REG        9,2      356188     966553 /usr/lib/libssl.so.1.0.0
emerge    14577       root  mem       REG        9,2       35584     900834 /usr/lib/python2.7/lib-dynload/_elementtree.so
emerge    14577       root  mem       REG        9,2       17724     900746 /usr/lib/python2.7/lib-dynload/termios.so
emerge    14577       root  mem       REG        9,2       21388     900818 /usr/lib/python2.7/lib-dynload/zlib.so
emerge    14577       root  mem       REG        9,2       28524     900709 /usr/lib/python2.7/lib-dynload/_ssl.so
emerge    14577       root  mem       REG        9,2     1484288     966551 /usr/lib/libcrypto.so.1.0.0
emerge    14577       root  mem       REG        9,2       10580     900665 /usr/lib/python2.7/lib-dynload/_functools.so
emerge    14577       root  mem       REG        9,2       53840     900708 /usr/lib/python2.7/lib-dynload/_socket.so
emerge    14577       root  mem       REG        9,2        9980     900658 /usr/lib/python2.7/lib-dynload/_random.so
emerge    14577       root  mem       REG        9,2       30140     900536 /usr/lib/python2.7/lib-dynload/math.so
emerge    14577       root  mem       REG        9,2      124868     900664 /usr/lib/python2.7/lib-dynload/_io.so
emerge    14577       root  mem       REG        9,2       79352     711728 /lib/libz.so.1.2.5
emerge    14577       root  mem       REG        9,2       15132     900711 /usr/lib/python2.7/lib-dynload/_hashlib.so
emerge    14577       root  mem       REG        9,2        9972     900759 /usr/lib/python2.7/lib-dynload/resource.so
emerge    14577       root  mem       REG        9,2       36136     900493 /usr/lib/python2.7/lib-dynload/array.so
emerge    14577       root  mem       REG        9,2       10356     900677 /usr/lib/python2.7/lib-dynload/grp.so
emerge    14577       root  mem       REG        9,2       19228     900831 /usr/lib/python2.7/lib-dynload/binascii.so
emerge    14577       root  mem       REG        9,2       30600     899843 /usr/lib/python2.7/lib-dynload/_struct.so
emerge    14577       root  mem       REG        9,2       17212     900675 /usr/lib/python2.7/lib-dynload/fcntl.so
emerge    14577       root  mem       REG        9,2       22128     900679 /usr/lib/python2.7/lib-dynload/select.so
emerge    14577       root  mem       REG        9,2       22124     900537 /usr/lib/python2.7/lib-dynload/strop.so
emerge    14577       root  mem       REG        9,2       16620     900662 /usr/lib/python2.7/lib-dynload/_heapq.so
emerge    14577       root  mem       REG        9,2       46436     900570 /usr/lib/python2.7/lib-dynload/itertools.so
emerge    14577       root  mem       REG        9,2       29776     900663 /usr/lib/python2.7/lib-dynload/operator.so
emerge    14577       root  mem       REG        9,2      149256     696512 /lib/libm-2.12.2.so
emerge    14577       root  mem       REG        9,2        9612     696489 /lib/libutil-2.12.2.so
emerge    14577       root  mem       REG        9,2        9604     693624 /lib/libdl-2.12.2.so
emerge    14577       root  mem       REG        9,2     1442204     696462 /lib/libc-2.12.2.so
emerge    14577       root  mem       REG        9,2      121220     696505 /lib/libpthread-2.12.2.so
emerge    14577       root  mem       REG        9,2     1464620     899849 /usr/lib/libpython2.7.so.1.0
emerge    14577       root  mem       REG        9,2       11276     900660 /usr/lib/python2.7/lib-dynload/_bisect.so
emerge    14577       root  mem       REG        9,2       25228     900659 /usr/lib/python2.7/lib-dynload/_collections.so
emerge    14577       root  mem       REG        9,2       16688     900682 /usr/lib/python2.7/lib-dynload/cStringIO.so
emerge    14577       root  mem       REG        9,2       18492     900556 /usr/lib/python2.7/lib-dynload/time.so
emerge    14577       root  mem       REG        9,2      121964     696474 /lib/ld-2.12.2.so
emerge    14577       root    0u      CHR      136,0         0t0          3 /dev/pts/0
emerge    14577       root    1u      CHR      136,0         0t0          3 /dev/pts/0
emerge    14577       root    2u      CHR      136,0         0t0          3 /dev/pts/0
emerge    14577       root    3u     IPv4    1727594         0t0        TCP data.local:40176->noci.xs4all.nl:xmpp-client (ESTABLISHED)
emerge    14577       root    4r     FIFO        0,6         0t0    1755015 pipe
emerge    14577       root    5u     IPv4    1727599         0t0        TCP data.local:40177->noci.xs4all.nl:xmpp-client (ESTABLISHED)
emerge    14577       root    6uW     REG        9,2           0    1158294 /var/tmp/portage/dev-libs/.gmime-2.4.22.portage_lockfile
emerge    14577       root    8w      REG        9,2       89867     578485 /var/log/portage/dev-libs:gmime-2.4.22:20110708-214826.log
emerge    14577       root    9u      CHR      136,0         0t0          3 /dev/pts/0
emerge    14577       root   10r     FIFO        0,6         0t0    1755016 pipe
emerge    14577       root   12uW     REG        9,2           0     534719 /var/db/.pkg.portage_lockfile
Comment 31 Nico Baggus 2011-07-08 22:16:48 UTC
This is the code I modified ( my first ever attempt at python).

        try:
                if myfd is None:
                        myfd = os.open(lockfilename, os.O_WRONLY,0o660)
                        unlinkfile = 1
                locking_method(myfd,fcntl.LOCK_UN)
        except IOError:
                os.system(_("/usr/bin/lsof >/tmp/t.t"))
                writemsg(_("@OSERR: myfd = %d\n") % myfd)
                writemsg(_("Filename: %(lock)s unlinkfile %(unl)d\n") % {"lock":lockfilename, "unl":unlinkfile })
                raise
        except OSError:
                if isinstance(lockfilename, basestring):
                        os.close(myfd)
                raise IOError(_("Failed to unlock file '%s'\n") % lockfilename)


the /tmp/t.t is in the previous post, slightly trimmed to anything that could be related to emerge .../ python ...
Comment 32 Fabian Groffen gentoo-dev 2011-07-09 07:06:09 UTC
if I understand the lsof output well, then fd 3 is a TCP socket in your case (to some jabber thing?) ...
Comment 33 Zac Medico gentoo-dev 2011-07-09 07:40:25 UTC
(In reply to comment #32)
> if I understand the lsof output well, then fd 3 is a TCP socket in your case
> (to some jabber thing?) ...

If that's true, then maybe it helps to remove jabber from PORTAGE_ELOG_SYSTEM, though I don't know how the jabber module would manage to cause file descriptor interference like this. Maybe the module needs to be fixed to close its TCP connection when it's not needed.
Comment 34 Nico Baggus 2011-07-09 10:53:02 UTC
I had an 'emerge -1e system' done last night and that made no difference,

Indeed, disabling the jabber thing does provide a clean build.
But the jabber thing is enabled on ALL systems i have.
And this is the only one complaining.
Comment 35 Nico Baggus 2011-07-09 10:58:24 UTC
BTW, the jabber thing is app-portage/portage-mod_jabber-0.0.5.1
Comment 36 Zac Medico gentoo-dev 2011-07-09 16:30:31 UTC
You could try rebuilding app-portage/portage-mod_jabber and dev-python/xmpppy, and check your versions of dev-python/xmpppy.
Comment 37 Nico Baggus 2011-07-09 16:46:18 UTC
(In reply to comment #36)
> You could try rebuilding app-portage/portage-mod_jabber and dev-python/xmpppy,
> and check your versions of dev-python/xmpppy.

See below:

data ~ # eix xmpppy
[I] dev-python/xmpppy
     Available versions:  (~)0.5.0_rc1 {doc}
     Installed versions:  0.5.0_rc1(18:37:52 07/09/11)(-doc)
     Homepage:            http://xmpppy.sourceforge.net/
     Description:         Python library providing easy scripting with Jabber

data ~ # eix mod_jabber
[I] app-portage/portage-mod_jabber
     Available versions:  (~)0.0.3 (~)0.0.5.1
     Installed versions:  0.0.5.1(18:38:17 07/09/11)
     Homepage:            http://usrportage.de/
     Description:         A notification module for the portage elog-system to notify via the XMPP (Jabber) protocol
Comment 38 Zac Medico gentoo-dev 2011-07-09 17:01:40 UTC
Created attachment 279519 [details, diff]
fix mod_jabber to disconnect its socket

Save as /tmp/mod_jabber.patch and apply as follows:

  patch /usr/lib/portage/pym/portage/elog/mod_jabber.py /tmp/mod_jabber.patch
Comment 39 Nico Baggus 2011-07-09 17:21:56 UTC
(In reply to comment #38)
> Created attachment 279519 [details, diff]
> fix mod_jabber to disconnect its socket
> 
> Save as /tmp/mod_jabber.patch and apply as follows:
> 
>   patch /usr/lib/portage/pym/portage/elog/mod_jabber.py /tmp/mod_jabber.patch

  usr/lib/libgmime-2.4.a
removing executable bit: usr/lib/libgmime-2.4.la

>>> Installing (2 of 3) dev-libs/gmime-2.4.22
Traceback (most recent call last):
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4073, in merge
    counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3413, in treewalk
    self.vartree.dbapi._fs_unlock()
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 240, in _fs_unlock
    unlockfile(self._fs_lock_obj)
  File "/usr/lib/portage/pym/portage/locks.py", line 221, in unlockfile
    locking_method(myfd,fcntl.LOCK_UN)
IOError: [Errno 9] Bad file descriptor

>>> Failed to install dev-libs/gmime-2.4.22, Log file:

>>>  '/var/log/portage/dev-libs:gmime-2.4.22:20110709-171422.log'

 * GNU info directory index is up-to-date.
data ~ # tail /usr/lib/portage/pym/portage/elog/mod_jabber.py
                                if not auth:
                                        raise PortageException ("!!! Could not authentificate to %s" %server)
                                if auth <> 'sasl':
                                        raise PortageException ("!!! Unable to perform SASL auth to %s" %server)
                                message = xmpp.protocol.Message (recipient, fulltext, "message", subject)

                                client.send (message)
                                client.disconnect()
                        except Exception, e:
                                raise PortageException ("!!! An error occured while sending a jabber message to "+str(recipient)+": "+str(e))
Comment 40 Nico Baggus 2011-07-09 17:23:37 UTC
This is only happening for New modules, is it possible that the config file is
closed, but that the fd status of the lock isn't cleared in the object.

It makes no sense to update the config file for such a new package.
The xmpppy / portage-mod_jabber isn't aware of the units involved.
Appearantly the unlock in emerge is assumed to be open, has been opened (unit
3) but is not invalidated after a previous close.

Then the assumption that a file will be reopened on that unit seems somewhat rickety.
Comment 41 Zac Medico gentoo-dev 2011-07-09 17:35:35 UTC
(In reply to comment #40)
> Then the assumption that a file will be reopened on that unit seems somewhat
> rickety.

My understanding of the open() function is that it's supposed to create a new file descriptor in any case, so it shouldn't matter you the process happens to have another file descriptor open for the same file path. For reference, here's the single unix specification of the function:

  http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html
Comment 42 Nico Baggus 2011-07-09 18:08:29 UTC
if you have:
   x = open("blabla"...);
   ...
   close(x)
   ...
   y = open("blueblue"...);

Now if there is code with an assumtion on x it might not be valid anymore.
btw another close(x) will disassociate the y<-> blueblue link too.
Now if x happens to be 3 it is the first user file (re)opened...
fd={0,1,2} are stdin, stdout, stderr.


y might happen to be the same value as x, (no guarantee, see dup() en dup2()
for that kind of functionality).
The kernel will start at 0 and use the first free number for the next value to be returned from open()/creat()
Comment 43 Zac Medico gentoo-dev 2011-07-09 18:22:43 UTC
(In reply to comment #42)
> if you have:
>    x = open("blabla"...);
>    ...
>    close(x)
>    ...
>    y = open("blueblue"...);
> 
> Now if there is code with an assumtion on x it might not be valid anymore.

Of course. I don't know of any code making assumptions like that and it would obviously be flawed if it did.
Comment 44 Nico Baggus 2011-12-02 21:33:33 UTC
Example from the 2nd system showing a crash..

--- replaced obj /usr/include/curl/curl.h
--- replaced dir /usr/include/curl
--- replaced dir /usr/include
--- replaced obj /usr/bin/curl-config
--- replaced obj /usr/bin/curl
--- replaced dir /usr/bin
--- replaced dir /usr
ebuild-ipc: daemon process not detected
 * The ebuild phase 'postrm' has exited unexpectedly. This type of behavior
 * is known to be triggered by things such as failed variable assignments
 * (bug #190128) or bad substitution errors (bug #200313). Normally, before
 * exiting, bash should have displayed an error message above. If bash did
 * not produce an error message above, it's possible that the ebuild has
 * called `exit` when it should have called `die` instead. This behavior
 * may also be triggered by a corrupt bash binary or a hardware problem
 * such as memory or cpu malfunction. If the problem is not reproducible or
 * it appears to occur randomly, then it is likely to be triggered by a
 * hardware problem. If you suspect a hardware problem then you should try
 * some basic hardware diagnostics such as memtest. Please do not report
 * this as a bug unless it is consistently reproducible and you are sure
 * that your bash binary and hardware are functioning properly.
ebuild-ipc: daemon process not detected
 * The ebuild phase 'die_hooks' has exited unexpectedly. This type of
 * behavior is known to be triggered by things such as failed variable
 * assignments (bug #190128) or bad substitution errors (bug #200313).
 * Normally, before exiting, bash should have displayed an error message
 * above. If bash did not produce an error message above, it's possible
 * that the ebuild has called `exit` when it should have called `die`
 * instead. This behavior may also be triggered by a corrupt bash binary or
 * a hardware problem such as memory or cpu malfunction. If the problem is
 * not reproducible or it appears to occur randomly, then it is likely to
 * be triggered by a hardware problem. If you suspect a hardware problem
 * then you should try some basic hardware diagnostics such as memtest.
 * Please do not report this as a bug unless it is consistently
 * reproducible and you are sure that your bash binary and hardware are
 * functioning properly.
!!! FAILED postrm: 1
 * The 'postrm' phase of the 'net-misc/curl-7.21.4' package has failed with
 * exit value 1.
 * 
 * The problem occurred while executing the ebuild file named
 * 'curl-7.21.4.ebuild' located in the '/var/db/pkg/net-misc/curl-7.21.4'
 * directory. If necessary, manually remove the environment.bz2 file and/or
 * the ebuild file located in that directory.
 * 
 * Removal of the environment.bz2 file is preferred since it may allow the
 * removal phases to execute successfully. The ebuild will be sourced and
 * the eclasses from the current portage tree will be used when necessary.
 * Removal of the ebuild file will cause the pkg_prerm() and pkg_postrm()
 * removal phases to be skipped entirely.
Traceback (most recent call last):
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4261, in merge
    counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3667, in treewalk
    preserve_paths=preserve_paths)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 1811, in unmerge
    builddir_lock.unlock()
  File "/usr/lib/portage/pym/_emerge/EbuildBuildDir.py", line 91, in unlock
    self._lock_obj.unlock()
  File "/usr/lib/portage/pym/_emerge/AsynchronousLock.py", line 95, in unlock
    unlockfile(self._imp)
  File "/usr/lib/portage/pym/portage/locks.py", line 214, in unlockfile
    os.close(myfd)
  File "/usr/lib/portage/pym/portage/__init__.py", line 215, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
OSError: [Errno 9] Bad file descriptor
Comment 45 Nico Baggus 2011-12-02 21:36:47 UTC
pkgcore-0.7.7-r1 was installed too, (after previous message)
the reproducer (unmerge libnl...) emerge libvirt now doesn't reproduce anymore...
Last week it still worked so I guess a problem might be caused there?
Comment 46 Nico Baggus 2011-12-07 16:43:39 UTC
(ebuild of ???, strace, lxml, a2ps...) fails on strace. [ same errors ] 
emerge --resume produces:


>>> /usr/lib/python3.1/site-packages/lxml/objectify.so
>>> /usr/lib/python3.1/site-packages/lxml/etreepublic.pxd
>>> /usr/lib/python3.1/site-packages/lxml/ElementInclude.py
Traceback (most recent call last):
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4261, in merge
    counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3590, in treewalk
    self.vartree.dbapi._fs_unlock()
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 242, in _fs_unlock
    unlockfile(self._fs_lock_obj)
  File "/usr/lib/portage/pym/portage/locks.py", line 221, in unlockfile
    locking_method(myfd,fcntl.LOCK_UN)
IOError: [Errno 9] Bad file descriptor

>>> Failed to install dev-python/lxml-2.3.1, Log file:

It happens after files are put in there destination directory & before updating the package db, emerge  --resume [lxml, a2ps, ...] builds the same package again... and has the following on "pre merge":

strip: i686-pc-linux-gnu-strip --strip-unneeded -R .comment
   usr/lib/python2.7/site-packages/lxml/etree.so
   usr/lib/python2.7/site-packages/lxml/objectify.so
   usr/lib/python3.1/site-packages/lxml/etree.so
   usr/lib/python3.1/site-packages/lxml/objectify.so

>>> Installing (1 of 3) dev-python/lxml-2.3.1
 * checking 87 files for package collisions
 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at http://bugs.gentoo.org unless you report exactly which
 * two packages install the same file(s). Once again, please do NOT file
 * a bug report unless you have completely understood the above message.
 *
 * Detected file collision(s):
 *
 *      /usr/share/doc/lxml-2.3.1/README.txt.bz2
 *      /usr/lib/python2.7/site-packages/lxml/tree.pxd
 *      /usr/lib/python2.7/site-packages/lxml/etree_defs.h
 *      /usr/lib/python2.7/site-packages/lxml/etreepublic.pxd
 *      /usr/lib/python2.7/site-packages/lxml-2.3.1-py2.7.egg-info/top_level.txt
 *      /usr/lib/python2.7/site-packages/lxml-2.3.1-py2.7.egg-info/SOURCES.txt
 *      /usr/lib/python2.7/site-packages/lxml-2.3.1-py2.7.egg-info/dependency_links.txt
 *      /usr/lib/python2.7/site-packages/lxml-2.3.1-py2.7.egg-info/not-zip-safe
 *      /usr/lib/python2.7/site-packages/lxml-2.3.1-py2.7.egg-info/PKG-INFO
 *      /usr/lib/python3.1/site-packages/lxml-2.3.1-py3.1.egg-info/top_level.txt
 *      /usr/lib/python3.1/site-packages/lxml-2.3.1-py3.1.egg-info/SOURCES.txt
 *      /usr/lib/python3.1/site-packages/lxml-2.3.1-py3.1.egg-info/dependency_links.txt
 *      /usr/lib/python3.1/site-packages/lxml-2.3.1-py3.1.egg-info/not-zip-safe
 *      /usr/lib/python3.1/site-packages/lxml-2.3.1-py3.1.egg-info/PKG-INFO
 *      /usr/lib/python3.1/site-packages/lxml/tree.pxd
 *      /usr/lib/python3.1/site-packages/lxml/etree_defs.h
 *      /usr/lib/python3.1/site-packages/lxml/etreepublic.pxd
 *
 * Searching all installed packages for file collisions...
 *
 * Press Ctrl-C to Stop
 *

& succeeeds, for lxml, just to stop again in a2ps:

--- /etc/a2ps/
>>> /etc/a2ps/a2ps.cfg
>>> /etc/a2ps/a2ps-site.cfg
Traceback (most recent call last):
  File "/usr/lib/portage/pym/portage/dbapi/_MergeProcess.py", line 246, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 4261, in merge
    counter=counter)
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 3590, in treewalk
    self.vartree.dbapi._fs_unlock()
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 242, in _fs_unlock
    unlockfile(self._fs_lock_obj)
  File "/usr/lib/portage/pym/portage/locks.py", line 221, in unlockfile
    locking_method(myfd,fcntl.LOCK_UN)
IOError: [Errno 9] Bad file descriptor
Comment 47 Zac Medico gentoo-dev 2012-03-17 04:49:42 UTC
This issue is very similar to one that I've experience when running portage with PyPy, apparently related to PyPy garbage collector behavior, as noted in the following commit:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=46107423f4a039af6528d14cb86123a05a67f85f
Comment 48 Zac Medico gentoo-dev 2012-03-17 05:32:01 UTC
(In reply to comment #38)
> Created attachment 279519 [details, diff] [details, diff]
> fix mod_jabber to disconnect its socket

If this patch doesn't do the trick, then it seems as though xmpppy leaves a socket open after we call disconnect, and that seems to trigger delayed garbage collection that's similar to the PyPy issue mentioned in comment #47.
Comment 50 Zac Medico gentoo-dev 2012-03-28 01:16:31 UTC
This is fixed in 2.1.10.52 and 2.2.0_alpha96.