[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: interrupted system call when using named pipes on FreeBSD
From: |
Lionel Cons |
Subject: |
Re: interrupted system call when using named pipes on FreeBSD |
Date: |
Wed, 30 Jan 2013 11:16:44 +0100 |
On 18 January 2013 13:55, Chet Ramey <chet.ramey@case.edu> 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.
>>
>> a simple patch to workaround/fix the issue by Yuta SATOH:
>> --- bash-4.2/redir.c
>> +++ bash-4.2/redir.c
>> @@ -632,7 +632,9 @@
>> }
>> else
>> {
>> - fd = open (filename, flags, mode);
>> + do {
>> + fd = open (filename, flags, mode);
>> + } while ((fd < 0) && (errno == EINTR));
>> #if defined (AFS)
>> if ((fd < 0) && (errno == EACCES))
>> {
>>
>> but we're not sure if this is the route to take ? seems like if bash is
>> handling SIGCHLD, there's no avoiding this sort of check.
>
> Why is open returning -1/EINTR when the SIGCHLD handler is installed with
> SA_RESTART? The intent is that opens get restarted even when bash handles
> SIGCHLD.
SA_RESTART is buggy on some platform/filesystem combinations, for
example Solaris/ZFS with high latency storage or Solaris/NFS are prone
to SA_RESTART not working unless you've installed the latest kernel
patches (this is at least the case with Solaris 10 and 11). However
Oracle now wants money for such patches which makes such fixes not
generally available (certainly not for Universities).
Lionel