Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 131875 - bash-3.1_p16 uses fifo's in /tmp instead of /dev/fd because of FEATURES=userpriv
Summary: bash-3.1_p16 uses fifo's in /tmp instead of /dev/fd because of FEATURES=userpriv
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 133778 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-01 02:12 UTC by Heinrich Nirschl
Modified: 2006-05-22 23:18 UTC (History)
4 users (show)

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


Attachments
the config.log file with /dev/fd test failed (config.log,134.16 KB, text/plain)
2006-05-05 10:26 UTC, Heinrich Nirschl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heinrich Nirschl 2006-05-01 02:12:16 UTC
When process substitution is used inside command substitution, the named pipes are not cleaned up. For example:

echo $( diff <(echo abc) <(echo adb) )

leaves two named pipes in /tmp behind.

The net init scripts use such constructs. Which means, there are lots of sh-np-XXXXXXX files piling up in /tmp.

My emerge --info:
Portage 2203-svn (default-linux/x86/2006.0, gcc-3.4.5, glibc-2.3.6-r3, 2.6.16-gentoo-r3 i686)
=================================================================
System uname: 2.6.16-gentoo-r3 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz
Gentoo Base System version 1.6.14
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="ftp://gentoo.inode.at/source/ ftp://mirror.switch.ch/mirror/gentoo/ http://ftp.easynet.nl/mirror/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 X alsa apache2 apm atm audiofile avi berkdb bitmap-fonts bzip2 cdr cli crypt cups curl dga doc dri dvd eds emboss encode esd exif expat fam ffmpeg firefox flac foomaticdb fortran gd gdbm gif glut gmp gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml idn imagemagick imlib isdnlog java jce jpeg junit lcms libg++ libwww mad mhash mikmod mmx mng motif mp3 mpeg mysql ncurses nls no-htdocs nptl nsplugin offensive ogg openal opengl pam pcre pdflib perl php png pppd python quicktime readline real recode reflection sdl session slang source spell spl sse sse2 ssl svg svga tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts udev usb vorbis wmf xine xml xml2 xmms xorg xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-05-01 02:15:15 UTC
Ah... same here. And I always blamed evil green men w/ the pipe for that... :=)
Comment 2 Da Fox 2006-05-01 03:27:15 UTC
same here :(
Comment 3 Kevin Parent 2006-05-02 09:25:55 UTC
I have two boxes running gentoo that are nearly identical.  Both are Athlon 64 - one in 64 bit mode and one in 32 bit mode.  The 64 bit machine is a server.  The 32 bit box is my mythtv box.

Only the 64 bit setup (server) has the named pipes in the /tmp dir and seem to be created on boot, then not cleaned up.

Restarting individual services do not recreate the pipes, but restarting net.eth0 does - two for every restarted daemon.

emerge info for affected machine:

Portage 2.0.54 (default-linux/amd64/2006.0, gcc-3.4.5, glibc-2.3.5-r3, 2.6.16-ck6-r1 x86_64)
=================================================================
System uname: 2.6.16-ck6-r1 x86_64 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.8.1-r1, 2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-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/lib64/mozilla/defaults/pref /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://gentoo.chem.wisc.edu/gentoo/"
LANG="en_US"
LC_ALL="en_US"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://63.150.226.21/gentoo-portage"
USE="amd64 X alsa apache2 audiofile avi berkdb bitmap-fonts bzip2 cdparanoia cdr cli crypt cups curl dga dri eds emboss encode esd ethereal evo exif expat fam ffmpeg flac foomaticdb fortran frontendonly gd gdbm gif glut gmp gnome gpm gstreamer gtk gtk2 gtkhtml guile idn imap imlib irda irmc isdnlog ithreads java jpeg kde lcms ldap libwww lzw lzw-tiff mad mbox mhash mng mozilla mp3 mpeg mysql mythtv ncurses nls nptl nvidia oav offensive ogg oggvorbis opengl oss pam pcre pda pdf pdflib perl php png posix ppds pppd pthreads python quicktime readline recode reflection samba sdl session slang spell spl ssl tcpd tiff truetype truetype-fonts type1-fonts udev usb vorbis xine xml xml2 xmms xorg xpm xv xvmc zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LDFLAGS, LINGUAS


Comment 4 SpanKY gentoo-dev 2006-05-03 18:42:37 UTC
unable to reproduce over here with bash-3.1_p16 on i686 or bash-3.1_p17 on amd64
Comment 5 Heinrich Nirschl 2006-05-04 10:05:40 UTC
I am not sure, if bash is supposed to use named pipes when /dev/fd is available. Maybe this could explain the differences. Here is another experiment:

set -x
echo $( diff <(echo abc) <(echo adb) )

gives this output:

++ diff /tmp/sh-np-1146764446 /tmp/sh-np-3438175859
+++ echo abc
+++ echo adb
+ echo 1c1 '<' abc --- '>' adb
1c1 < abc --- > adb

both named pipes are not cleaned up.

On systems where it works, does it use named pipes or /dev/fd ?
Comment 6 Heinrich Nirschl 2006-05-04 11:28:00 UTC
Interestingly, the configure test for /dev/fd succeeds if I run configure manually but fails if configure is run by emerge ...

A manually compiled bash uses /dev/fd instead of named pipes.
Comment 7 SpanKY gentoo-dev 2006-05-05 10:11:32 UTC
please run:
FEATURES=noauto ebuild bash-3.1_p17.ebuild clean unpack compile

verify that the /dev/fd test failed then post the config.log file from /var/tmp/portage/bash-3.1_p17/bash-3.1/ as an attachment
Comment 8 Heinrich Nirschl 2006-05-05 10:26:37 UTC
Created attachment 86214 [details]
the config.log file with /dev/fd test failed

here it is.
Comment 9 Heinrich Nirschl 2006-05-05 11:23:39 UTC
Just found out, that the /dev/fd test succeeds if I remove userpriv usersandbox from the FEATURES.
Comment 10 SpanKY gentoo-dev 2006-05-05 17:48:51 UTC
this is because the links in /dev/fd/ point to device nodes owned by root and thus the user running the compile is unable to access them
Comment 11 SpanKY gentoo-dev 2006-05-05 17:58:47 UTC
ok, ive tweaked the test so it should work now with FEATURES=userpriv

also e-mailed upstream ... maybe get the test to be less anal ...
Comment 12 SpanKY gentoo-dev 2006-05-22 23:18:10 UTC
*** Bug 133778 has been marked as a duplicate of this bug. ***