misc/77493: freebsd 5.3 + bash process substitution
Bruce Evans
bde at zeta.org.au
Thu Mar 24 02:10:07 PST 2005
The following reply was made to PR kern/77493; it has been noted by GNATS.
From: Bruce Evans <bde at zeta.org.au>
To: Travis Morgan <travis at bigfiber.net>
Cc: freebsd-gnats-submit at freebsd.org
Subject: Re: misc/77493: freebsd 5.3 + bash process substitution
Date: Thu, 24 Mar 2005 21:06:23 +1100 (EST)
On Wed, 23 Mar 2005, Travis Morgan wrote:
> I filed this bug with the bash bugs team as well and received the following response from them. According to Chet this would appear to be a FreeBSD problem, not a bash problem.
> Date: Wed, 9 Mar 2005 21:45:17 -0500
> From: Chet Ramey <chet at caleb.ins.cwru.edu>
> ...
> I think this is a FreeBSD bug. I did some testing today using
> 5.4-PRERELEASE.
>
> The bash `read' builtin, unless it's reading from a pipe, uses
> buffered reads. When reading from stdin, upon reading a newline, it
> must seek the input file pointer back to the offset of the newline to
> avoid potentially stealing input from other programs.
>
> This seeking backward does not work when applied to named pipes on
> FreeBSD 5.[34], though there is no indication that it fails.
>
> I don't know how FreeBSD implements named pipes, but they're not pipes:
> lseek doesn't return failure when applied to them.
> ...
This (the non-failure of lseek() on named pipes) was fixed in 1996 in
rev.1.52 of vfs_syscalls.c and associated changes, but was broken in
2003 in rev.1.319 of vfs_syscalls.c and associated changes. See PR
65786 for details. (This PR is about the affect of lseek()'s bug on
dd.)
Bruce
More information about the freebsd-bugs
mailing list