bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interrupted system call when piping to grep


From: Chet Ramey
Subject: Re: Interrupted system call when piping to grep
Date: Tue, 21 Oct 2008 12:07:42 -0400
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Tanel Rebane wrote:
> Hello,
> 
> a problem occurs when running the following bash shell script:
> #!/usr/bin/env bash
> for (( q = 0 ; q < 10000 ; q++ )); do
>                 while read -d '' z; do result+=("$z"); done < <(printf 
> "%s\000\n" hej | grep -a 'hej')
> done
> 
> For some reason the following output is printed:
> ./test.bash: line 4: /var/tmp//sh-np-2094024698: Interrupted system call
> ./test.bash: line 4: /var/tmp//sh-np-1952491205: Interrupted system call
> ./test.bash: line 4: /var/tmp//sh-np-2936939995: Interrupted system call
> ./test.bash: line 4: /var/tmp//sh-np-255058020: Interrupted system call
> etc etc...
> 
> This seems to only happen when piping to grep. I'm using FBSD 6.2-STABLE, 
> Bash 3.2.33(0)-release and grep (GNU grep) 2.5.1-FreeBSD.

I took a look at this, and it's not just due to the grep.  I think it's a
timing problem, but I can't tell what signal is interrupting the open.  I
thought it might be SIGCHLD, but I don't think so now.  It just seems that
FreeBSD's named pipe implementation is a bit fragile.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]