Ticket #724 (closed bug: fixed)
tee complains if used in a process started by ghc
| Reported by: | guest | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 6.8.1 |
| Component: | libraries/base | Version: | 6.4.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Moderate (less than a day) | |
| Test Case: | concio001 | Blocked By: | |
| Blocking: | Related Tickets: |
Description
I have the following program:
import System main = getArgs >>= system . head
i.e., a simple wrapper around the system command. I compile this using
ghc -o Sys --make Sys.hs
into a binary Sys. If I then call
./Sys "yes | head -n 20000000 | tee /dev/null"
the program quits with the message tee: write error. I tried on some machines, and on some I have to increase the argument to head, but at some point it always fails. Calling the shell command directly gives no error. However, calling
./Sys "yes | head -n 20000000" | tee /dev/null
(note the difference!) also fails.
This bug is a showstopper for my current project. In my program, I call other programs which internally employ tee for logging. Whenever there is a lot of screen output, there seems to be a good chance that my program fails.
I have no idea if this is a problem with tee or with ghc, but I couldn't yet reproduce it in any non-ghc context.
Andres Loeh

