Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92349 - bash: PGRP_PIPE breaks ( exec 3>&1; : `echo>&3` )
Summary: bash: PGRP_PIPE breaks ( exec 3>&1; : `echo>&3` )
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-12 03:20 UTC by Harald van Dijk (RETIRED)
Modified: 2005-07-05 15:52 UTC (History)
0 users

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


Attachments
fix (pipe.patch,540 bytes, patch)
2005-06-18 14:43 UTC, Harald van Dijk (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harald van Dijk (RETIRED) gentoo-dev 2005-05-12 03:20:30 UTC
$ ( 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
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-05-12 03:31:04 UTC
Works as expected here (app-shells/bash-3.0-r11)
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2005-05-12 03:34:05 UTC
Err, correction. Works as expected for root only. ;-)
Comment 3 SpanKY gentoo-dev 2005-05-12 05:24:52 UTC
can you downgrade to bash-3.0-r9 and see if that works as expected ?
Comment 4 Harald van Dijk (RETIRED) gentoo-dev 2005-05-12 10:33:08 UTC
3.0-r9 fails as well.
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2005-06-18 14:43:03 UTC
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.
Comment 6 SpanKY gentoo-dev 2005-06-18 22:51:18 UTC
e-mailed bash bug list with bug info and proposed patch
Comment 7 SpanKY gentoo-dev 2005-07-05 15:52:49 UTC
upstream sent me the fix and ive added it to bash 3.0-r12