Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 264435 - sys-apps/portage-2.1.6.7: IOError: [Errno 11] Resource temporarily unavailable (while writing to stdout)
Summary: sys-apps/portage-2.1.6.7: IOError: [Errno 11] Resource temporarily unavailabl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 268228
  Show dependency tree
 
Reported: 2009-03-31 20:19 UTC by Alexey Vladykin
Modified: 2013-02-09 15:36 UTC (History)
4 users (show)

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


Attachments
handle stdout EAGAIN errors due to subprocesses setting O_NONBLOCK (stdio_noblock.patch,1.58 KB, patch)
2009-04-09 06:20 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Vladykin 2009-03-31 20:19:22 UTC
Emerging sys-devel/gcc-4.3.2-r3 with FEATURES=test leads to gfortran test failures and portage crash. Corresponding log looks like:

		=== gfortran tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /var/tmp/portage/sys-devel/gcc-4.3.2-r3/work/gcc-4.3.2/gcc/testsuite/config/default.exp as tool-and-target-specific interface file.
Running /var/tmp/portage/sys-devel/gcc-4.3.2-r3/work/gcc-4.3.2/gcc/testsuite/gfortran.dg/dg.exp ...
FAIL: gfortran.dg/fmt_l.f90  -O0  output pattern test, is At line 14 of file /var/tmp/portage/sys-devel/gcc-4.3.2-r3/work/gcc-4.3.2/gcc/testsuite/gfortran.dg/fmt_l.f90
Fortran runtime warning: Positive width required in format
At line 15 of file /var/tmp/portage/sys-devel/gcc-4.3.2-r3/work/gcc-4.3.2/gcc/testsuite/gfortran.dg/fmt_l.f90
Fortran runtime warning: Positive width required in format

<hundreds of similar lines skipped>

At line 30 of file.*
?ortran runtime warning: Positive width required in format.

<hundreds of similar lines skipped>

At line 15 of file.*
?ortran runtime warning: Positive width required in format.
At line 19 of file.*
Fortran runtime warning: P    myopts, myaction, myfiles, spinner)
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 13766, in action_build
    retval = mergetask.merge()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 10246, in merge
    rval = self._merge()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 10488, in _merge
    self._main_loop()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 10623, in _main_loop
    self._poll_loop()
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 9177, in _poll_loop
    handler(f, event)
  File "//usr/lib64/portage/pym/_emerge/__init__.py", line 2245, in _output_handler
    buf.tofile(files.stdout)
IOError: [Errno 11] Resource temporarily unavailable


Reproducible: Always

Steps to Reproduce:
1. emerge =gcc-4.3.2-r3

Actual Results:  
Test failure and portage crash.

Expected Results:  
Successful emerge.

Portage 2.1.6.7 (default/linux/amd64/2008.0/desktop, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.29-gentoo x86_64)
=================================================================
System uname: Linux-2.6.29-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P8600_@_2.40GHz-with-glibc2.2.5
Timestamp of tree: Tue, 31 Mar 2009 19:30:16 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.7
dev-lang/python:     2.5.2-r7
dev-python/pycrypto: 2.0.1-r8
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.1-r1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
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/revdep-rebuild /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict test unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="C"
LDFLAGS="-Wl,-O1"
LINGUAS="en ru"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/wschlich-testing /usr/portage/local/layman/jokey /usr/portage/local/layman/sunrise /usr/portage/local/av"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa amd64 bash-completion berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups dbus dri dvd dvdr dvdread emboss encode evo fam firefox fortran gdbm gif gnome gnome-keyring gpm gstreamer gtk hal iconv isdnlog jpeg libnotify mad midi mikmod mmx mmxext mp3 mpeg mudflap multilib nautilus ncurses nls nptl nptlonly opengl openmp pam pcre pdf perl png ppds pppd python qt3support quicktime readline reflection sdl session spell spl sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd tiff truetype unicode usb xinerama xml xorg xulrunner xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon ptp2" ELIBC="glibc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en ru" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Daniel Jakob 2009-04-04 08:15:15 UTC
I can confirm this one on my server.

Portage 2.1.6.7 (default/linux/amd64/2008.0, gcc-4.1.2, glibc-2.8_p20080602-r1, 2.6.26-hardened-r9.stu x86_64)
=================================================================
System uname: Linux-2.6.26-hardened-r9.stu-x86_64-Quad-Core_AMD_Opteron-tm-_Processor_2376-with-glibc2.2.5
Timestamp of tree: Sat, 04 Apr 2009 08:00:17 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.2-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.63
sys-devel/automake:  1.7.9-r1, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=k8 -pipe -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -march=k8 -pipe -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="de"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl amd64 apache2 authdaemond bash-completion berkdb bzip2 cli cracklib crypt ctype cups dri fortran gd gdbm gif gpm hardened iconv idn isdnlog ithreads jpeg midi mmx mod_php mudflap multilib mysql ncurses nls nptl nptlonly nptonly openmp pam pcre perl png pppd python readfile readline reflection sasl session simplexml snmp sockets spl sse sse2 ssl sysfs tcpd threads tiff unicode xml xorg xsl zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 2 infobox.oleg 2009-04-05 19:16:17 UTC
Same here:

?ortran runtime warning: Positive width required in format.
At line 50 Traceback (most recent call last):
  File "/usr/bin/emerge", line 40, in <module>
    retval = _emerge.emerge_main()
  File "//usr/lib/portage/pym/_emerge/__init__.py", line 15715, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "//usr/lib/portage/pym/_emerge/__init__.py", line 14659, in action_build
    retval = mergetask.merge()
  File "//usr/lib/portage/pym/_emerge/__init__.py", line 10723, in merge
    rval = self._merge()
  File "//usr/lib/portage/pym/_emerge/__init__.py", line 11024, in _merge
    self._main_loop()
  File "//usr/lib/portage/pym/_emerge/__init__.py", line 11161, in _main_loop
    self._poll_loop()
  File "//usr/lib/portage/pym/_emerge/__init__.py", line 9540, in _poll_loop
    handler(f, event)
  File "//usr/lib/portage/pym/_emerge/__init__.py", line 2428, in _output_handler
    buf.tofile(files.stdout)
IOError: [Errno 11] Resource temporarily unavailable

Portage 2.2_rc28 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.28-tuxonice-r8 i686)                                                                               
=================================================================                          
System uname: Linux-2.6.28-tuxonice-r8-i686-Intel-R-_Core-TM-2_CPU_T5500_@_1.66GHz-with-glibc2.0                                                                                      
Timestamp of tree: Sun, 05 Apr 2009 12:00:01 +0000                                         
ccache version 2.4 [enabled]                                                               
app-shells/bash:     3.2_p39                                                               
dev-java/java-config: 1.3.7-r1, 2.1.7                                                      
dev-lang/python:     2.4.4-r14, 2.5.2-r7                                                   
dev-util/ccache:     2.4-r7                                                                
dev-util/cmake:      2.6.3-r1                                                              
sys-apps/baselayout: 2.0.0                                                                 
sys-apps/openrc:     0.3.0-r1                                                              
sys-apps/sandbox:    1.3.5                                                                 
sys-devel/autoconf:  2.13, 2.63                                                            
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2                     
sys-devel/binutils:  2.18-r3                                                               
sys-devel/gcc-config: 1.4.0-r4                                                             
sys-devel/libtool:   1.5.26                                                                
virtual/os-headers:  2.6.27-r2                                                             
ACCEPT_KEYWORDS="x86"                                                                      
CBUILD="i686-pc-linux-gnu"                                                                 
CFLAGS="-march=prescott -pipe -O2"                                                         
CHOST="i686-pc-linux-gnu"                                                                  
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.2/env /usr/kde/4.2/share/config /usr/kde/4.2/shutdown /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/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"                                                                           
CXXFLAGS="-march=prescott -pipe -O2"                                                       
DISTDIR="/usr/portage/distfiles"                                                           
FEATURES="ccache collision-protect distlocks fixpackages metadata-transfer parallel-fetch preserve-libs protect-owned sandbox sfperms strict test unmerge-orphans userfetch userpriv" 
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"                                                                                 
LC_ALL="en_US.utf8"                                                                        
LDFLAGS="-Wl,-O1"                                                                          
LINGUAS="en cs ru uk"                                                                      
MAKEOPTS="-j3"                                                                             
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/synce /usr/portage/local/layman/kde-testing /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acl acpi adns alsa apache2 arts audiofile automount bash-completion berkdb bluetooth branding bzip2 cairo calendars caps cdparanoia cdr chm cli cracklib crypt cups curl curlwrappers custom-optimization cvs dbus dhcp dri dts dvd dvdr dvdread eds emboss encode escreen esd evo fam fbcon ffmpeg firefox flac fortran gcj gdbm gif glut gpm gstreamer gtk gtk2 hal iconv icq ieee1394 imap imlib inotify ipv6 isdnlog jabber java javascript jikes jingle jpeg junit kde kdeprefix kipi laptop lash ldap libnotify libwww lm_sensors log4j logitech-mouse logrotate mad madwifi matroska mcal midi mikmod mime mozilla mp3 mpeg mplayer mudflap mysql ncurses nls nntp nocd nodrm nptl nptlonly nsplugin ntfs obex ogg openal opengl openmp osc oscar oss pam pcmcia pcre pdf perl php png postgres ppds pppd prelude python qt3 qt3support qt4 quicktime rdesktop readline reflection reiserfs samba scanner sdl session shorten soap sockets spell spl sqlite sqlite3 ssl startup-notification subversion svg synaptics sysfs tcpd test theora threads tidy tiff truetype unicode usb vhosts videos vorbis wifi win32codecs x86 xcomposite xine xml xorg xosd xprint xulrunner xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbdauthn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache 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" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en cs ru uk" USERLAND="GNU" VIDEO_CARDS="vesa v4l intel"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Ryan Hill (RETIRED) gentoo-dev 2009-04-06 18:53:22 UTC
reassigning.  (fortran testsuite is wigging portage out)
Comment 4 Zac Medico gentoo-dev 2009-04-07 04:00:26 UTC
This is quite strange because normally stdout just blocks as long as necessary. It leads me to suspect that the test suite is doing something it shouldn't be doing.
Comment 5 Zac Medico gentoo-dev 2009-04-08 21:47:55 UTC
It seems as if one of the gfortran tests is putting stdout into non-blocking mode. This is a bad idea, as explained in detail here:

  http://homepages.tesco.net/~J.deBoynePollard/FGA/dont-set-shared-file-descriptors-to-non-blocking-mode.html

I'll make portage respond to the EAGAIN error by putting the file descriptor back into blocking mode and trying again (according to the linked website, this is the same way that bash handles it).
Comment 6 Zac Medico gentoo-dev 2009-04-09 06:20:18 UTC
Created attachment 187755 [details, diff]
handle stdout EAGAIN errors due to subprocesses setting O_NONBLOCK

This patch works for me. If it's as /tmp/stdio_noblock.patch then it can be applied as follows:

 patch /usr/lib/portage/pym/_emerge/__init__.py /tmp/stdio_noblock.patch
Comment 7 Zac Medico gentoo-dev 2009-04-09 06:22:34 UTC
If anybody can find were the gcc testsuite is setting O_NONBLOCK mode then please file a bug for gcc upstream because it's extremely poor practice.
Comment 8 Zac Medico gentoo-dev 2009-04-11 04:26:30 UTC
This is fixed in 2.2_rc29.
Comment 9 Zac Medico gentoo-dev 2009-05-02 02:40:37 UTC
This is fixed in 2.1.6.12.