On 01/29/2013 10:59 PM, Chet Ramey wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 1/18/13 1:30 AM, Mike Frysinger wrote:
this is somewhat a continuation of this thread:
http://lists.gnu.org/archive/html/bug-bash/2008-10/msg00091.html
i've gotten more or less the same report in Gentoo:
http://bugs.gentoo.org/447810
the simple test case is:
$ cat test.sh
#!/bin/bash
while :; do
(:)& (:)& (:)& (:)& (:)& (:)& (:)& (:)& (:)& (:)&
while read x ; do : ; done < <(echo foo)
done
execute `./test.sh` and we see failures pretty much all the time.
I did some looking around, and the script does result in open returning
- -1/EINTR, even if SIGCHLD is installed with SA_RESTART, on FreeBSD and
Mac OS X. It doesn't happen on RHEL 5. I may test Solaris 11 later.
I did find a reference to the Linux kernel patch that makes this work:
http://marc.info/?l=linux-kernel&m=134071285509470
Chet
- --
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlEIRk8ACgkQu1hp8GTqdKvk/QCfQ+bl09en7Yonmj+0+Vqhjvlk
7ykAn00mDwdQT5hTD9L7z/GN+8NFMTzS
=wKJk
-----END PGP SIGNATURE-----
There is similar problem with ioctl() syscall in read.
Consider following script:
#!/bin/bash
( while :; do kill -CHLD $$ 2>&- || break; done ) &
while :; do
read -p 1 -t 0.01 -d ' '
done
On my Fedora it is reporting many
/tmp/test.sh: line 4: read: error setting terminal attributes:
Interrupted system call
Hold down Enter key and when you are lucky you'll end up with SIGABRT.
Definitely it's a bug in kernel, but I'm not sure if there is also
something wrong in bash.
RR