$ ( exec 3>&1; : `echo>&3` ) bash: 3: Bad file descriptor It should produce a single blank line of output, and no error message. I get this in both bash 2.05b and 3.0, both from portage (2.05b-r9 and 3.0-r11), and also when compiled without portage, without the other patches, to make sure they didn't cause it. All is fine without adding #define PGRP_PIPE 1 to config-bot.h. Is it still necessary? If not, can it be removed? If it is, well, have fun with this :) emerge --info: Portage 2.0.51.21-r1 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.5-r0, 2.6.11-gentoo-r8 i686) ================================================================= System uname: 2.6.11-gentoo-r8 i686 AMD Duron(tm) Processor Gentoo Base System version 1.6.11 dev-lang/python: 2.4.1 sys-apps/sandbox: 1.2.6 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.16.90.0.3 sys-devel/libtool: 1.5.16 virtual/os-headers: 2.6.11 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-march=athlon-tbird -O2 -pipe -fomit-frame-pointer -fvisibility-inlines-hidden" DISTDIR="/var/dist" FEATURES="autoconfig autopatch collision-protect cvs distlocks noauto notitles sandbox sfperms strict" GENTOO_MIRRORS=" http://ftp.easynet.nl/mirror/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo " LANG="en_GB.UTF-8" LINGUAS="en en_GB ja nl" PKGDIR="/var/pkg" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/var/cvs/gentoo-x86" PORTDIR_OVERLAY="/etc/portage/overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowext X aac accessibility alsa ansi apm avi berkdb bidi bitmap-fonts cdparanoia cjk crypt dvd dvdread emboss encode erandom fbcon ffmpeg foomaticdb fortran gdbm gif gnutls gpm gprof gtk gtk2 hal imagemagick imlib imlib2 immqt-bc ipv6 ithreads jpeg kde kdeenablefinal libg++ libwww lynxkeymap mad mikmod mmx mmxext motif mozdevelop mp3 mpeg ncurses nls noamazon nptl ogg oggvorbis opengl oss pascal pcre pdflib perl pic png postgres quicktime readline rtc slang spell sql ssl tcpd tetex threads tiff truetype truetype-fonts type1-fonts unicode userlocales vim-pager vorbis win32codecs wmf xface xine xml2 xv xvid zlib linguas_en linguas_en_GB linguas_ja linguas_nl userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LC_ALL, LDFLAGS, MAKEOPTS
Works as expected here (app-shells/bash-3.0-r11)
Err, correction. Works as expected for root only. ;-)
can you downgrade to bash-3.0-r9 and see if that works as expected ?
3.0-r9 fails as well.
Created attachment 61460 [details, diff] fix This patch (tested only with 3.0-r11) fixes things by simply moving fds 3 and 4 to 10 and 11 (or higher if they're already taken). Since shells are only required to make fds 0 through 9 available to applications, and bash already sometimes uses fds 10+ internally for other purposes, this shouldn't break anything, and bash seems to work fine here. More testing would be good though.
e-mailed bash bug list with bug info and proposed patch
upstream sent me the fix and ive added it to bash 3.0-r12