Problem regarding pipe the implementation

Tanel Rebane tr at lc24.net
Tue Mar 31 02:38:18 PDT 2009


Hello,

it seems like I've ran across a problem with the pipe implementation of FreeBSD.

[tanelr at fbsd-bugtest ~]$ cat pipeproblem
#!/usr/bin/env bash
for (( q = 0 ; q < 30 ; q++ )); do
        while read -d '' z; do result+=("$z"); done < <(printf "%s\000\n" test | grep -a 'test')
done
[tanelr at fbsd-bugtest ~]$ ./pipeproblem
./pipeproblem: line 4: /var/tmp//sh-np-1625797870: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-4194883147: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-762535206: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-2528063441: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-1213045640: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-3210308902: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-134196816: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-3268002277: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-3950698013: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-2799887371: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-3391227547: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-2888089950: Interrupted system call
./pipeproblem: line 4: /var/tmp//sh-np-2618507856: Interrupted system call
[tanelr at fbsd-bugtest ~]$ bash --version
GNU bash, version 3.2.48(0)-release (i386-portbld-freebsd7.1)
Copyright (C) 2007 Free Software Foundation, Inc.
[tanelr at fbsd-bugtest ~]$ uname -a
FreeBSD fbsd-bugtest.XXXX 7.2-PRERELEASE FreeBSD 7.2-PRERELEASE #0: Tue Mar 31 00:25:41 CEST 2009     root at fbsd-bugtest.XXXX:/usr/obj/usr/src/sys/GENERIC <mailto:root at fbsd-bugtest.XXXX:/usr/obj/usr/src/sys/GENERIC>   i386

At first I thought bash and grep were the sources of this problem but Mr. Chet Ramey had this to say*: "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."

*http://www.mail-archive.com/bug-bash@gnu.org/msg04035.html

Yours faithfully,
Tanel Rebane

P.S: Please CC me as I'm not subscribed to the list. Thanks!


More information about the freebsd-bugs mailing list