Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Apr 2014 00:40:46 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        ports@freebsd.org, ehaupt@freebsd.org, bdrewery@freebsd.org
Subject:   Re: bash usage of fdescfs [was: Re: amd64/188699: Dev tree]
Message-ID:  <20140421214046.GS4016@kib.kiev.ua>
In-Reply-To: <201404211723.04580.jhb@freebsd.org>
References:  <201404171850.s3HIo1am064874@freefall.freebsd.org> <201404211431.12922.jhb@freebsd.org> <20140421195133.GO4016@kib.kiev.ua> <201404211723.04580.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--/hP/389S7qb5BOej
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Apr 21, 2014 at 05:23:04PM -0400, John Baldwin wrote:
> On Monday, April 21, 2014 3:51:33 pm Konstantin Belousov wrote:
> > On Mon, Apr 21, 2014 at 02:31:12PM -0400, John Baldwin wrote:
> > > On Thursday, April 17, 2014 2:50:01 pm Konstantin Belousov wrote:
> > > > The following reply was made to PR amd64/188699; it has been noted =
by=20
> GNATS.
> > > >=20
> > > > From: Konstantin Belousov <kostikbel@gmail.com>
> > > > To: John Allman <freebsd@hugme.org>
> > > > Cc: freebsd-gnats-submit@FreeBSD.org
> > > > Subject: Re: amd64/188699: Dev tree
> > > > Date: Thu, 17 Apr 2014 21:44:52 +0300
> > > >=20
> > > >  On Wed, Apr 16, 2014 at 05:32:45PM +0000, John Allman wrote:
> > > >  > This is how to reproduce it:
> > > >  >=20
> > > >  > Fresh install of 10 on AMD 64
> > > >  > install bash `pkg install bash`
> > > >  > Switch to bash `bash`
> > > >  > push a here document into a loop: `while true ; do echo; done< <=
(echo=20
> "123")`
> > > >  > receive an error: "-su: /dev/fd/62: No such file or directory"
> > > >  >=20
> > > >  > I'm sorry I haven't been able to research this any further. I fo=
und=20
> how while working on some important matters. As I mentioned the above wor=
ks=20
> fine in all=20
> > > previous versions of FreeBSD up until 10.
> > > >  > >How-To-Repeat:
> > > >  > Fresh install
> > > >  > pkg install bash
> > > >  > bash
> > > >  > while true; do echo foo done< <(echo "123")
> > > >  >=20
> > > >  > -su: /dev/fd/62: No such file or directory
> > > > =20
> > > >  So do you have fdescfs mounted on /dev/fd on the machine where the
> > > >  test fails ?  It works for me on head, and if unmounted, I get the
> > > >  same failure message as yours.  I very much doubt that it has anyt=
hing
> > > >  to do with a system version.
> > >=20
> > > Question I have is why is bash deciding to use /dev/fd/<n> and require
> > > fdescfs?  On older releases bash uses named pipes for this instead.
> >=20
> > The aclocal.m4 contains the test which verifies the presence and usabil=
ity
> > of /dev/fd/n for n>=3D3 on the _build_ host.  The result of the test
> > is used on the installation host afterward.
> >=20
> > Such kinds of bugs are endemic in our ports, but apparently upstreams
> > are guilty too.
>=20
> Yuck, yuck.  Should we fix our default package builders to not mount fdes=
cfs?

IMO, using /dev/fd is more efficient since it avoids pipe inode creation
for the 'document here' interpretation.  The /dev/fd is also needed for
fexecve(2) to work (with the shebang scripts).  Also, I believe that
some other high-profile ports require it (OpenJDK ?).

That said, the solution is to have fdescfs mounted on /dev/fd.
This probably should be done by an installer.

--/hP/389S7qb5BOej
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQIcBAEBAgAGBQJTVZBdAAoJEJDCuSvBvK1Bn8IP/1AMKv+7k4e87N1jHMhJ5AKX
SXnlXMCKwMgMigz3Zcd14pw/1Mq9MdvAtazcAKuJJpKwgSWFefDVBaq+3a5fTYbx
jC1hMm11BcWf1Z4Y9AqqE4PAmypbVfzqQIbxm7KHZneMiyZL0PXPwq0uSi017HJY
9XoxaEWakX2fX+b64CVg/pGJjj8fQhONe4kGuDbxBsINErjTWf8hoRWZvQ6S4Biq
DP6Fp3hsKv3Npgnu8X9ATgj4AmWQAAiY6ds4O5Dos4MbLzQvDhlvE+doK9z96chZ
FDCpR2TrBE1FieOX7bjuxDt49ku3CBr3vJ6DhTjSlXn/+3TqFEXHxKsTO3HE9w+t
MfdTxCoTi845fIQYbWVZPBde6tuW+EuQU8Is31Qb9DoSZjx2+7VpyOcpgel8Gke7
BDcBTJdS+vQenlsw4WxUxoh5jTKqCLm3X92xASLkgFBc7ZK+KUCUy4l1fWzh6hWU
TAqNXVu0MtEDmy+VFCyBy8/nrhd/jAqAFR8ecO9mJ6b8/wfSGg5W8TtYnr0InNph
fansbxPRNWZIE7DT2d4j3DXGZa/iNBH8lI8I42PSk7+TbYcjtJtPNi/IlhZPS18q
6WTUoZEeXGz2UGcnwp8JbJg1biMN6IDA3SVKrXJRIoGncxHAdcAxf4f89Op0MlW3
AZ9dvJ9Vy1vyd6yaZBT0
=E7Ch
-----END PGP SIGNATURE-----

--/hP/389S7qb5BOej--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140421214046.GS4016>