kern/170203: [kern] piped dd's don't behave sanely when dealing
with a fifo
Garrett Cooper
yanegomi at gmail.com
Thu Jul 26 23:00:22 UTC 2012
>Number: 170203
>Category: kern
>Synopsis: [kern] piped dd's don't behave sanely when dealing with a fifo
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Jul 26 23:00:21 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Garrett Cooper
>Release: 9-STABLE
>Organization:
EMC Isilon
>Environment:
FreeBSD forza.west.isilon.com 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #1 r238738M: Mon Jul 23 22:39:40 PDT 2012 gcooper at forza.west.isilon.com:/usr/obj/usr/src/sys/FORZA amd64
>Description:
Creating a fifo and then dd'ing across the fifo using /dev/zero doesn't seem to yield the behavior one would expect to have; dd should either exit thanks to SIGPIPE being sent or the count being completed.
Furthermore, the count is bogus:
Terminal 1:
$ dd if=fifo bs=512k count=4
0+4 records in
0+4 records out
32768 bytes transferred in 0.002121 secs (15449523 bytes/sec)
$ dd if=fifo bs=512k count=4
0+4 records in
0+4 records out
32768 bytes transferred in 0.001483 secs (22096295 bytes/sec)
$ dd if=fifo bs=512M count=4
0+4 records in
0+4 records out
32768 bytes transferred in 0.003908 secs (8384514 bytes/sec)
Terminal 2:
$ dd if=/dev/zero bs=512k count=4 of=fifo
^T
load: 0.40 cmd: dd 1779 [sbwait] 2.63r 0.00u 0.00s 0% 1800k
1+0 records in
0+0 records out
0 bytes transferred in 2.639078 secs (0 bytes/sec)
^T
load: 0.37 cmd: dd 1779 [sbwait] 8.19r 0.00u 0.00s 0% 1804k
1+0 records in
0+1 records out
40960 bytes transferred in 8.191172 secs (5001 bytes/sec)
>How-To-Repeat:
mkfifo fifo
Terminal 1:
dd if=fifo bs=512k count=4
Terminal 2:
dd if=/dev/zero bs=512k count=4 of=fifo
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list