[GHC] #724: tee complains if used in a process started by ghc

GHC trac at galois.com
Wed Mar 15 05:23:53 EST 2006


#724: tee complains if used in a process started by ghc
-------------------------+--------------------------------------------------
    Reporter:  guest     |        Owner:         
        Type:  bug       |       Status:  new    
    Priority:  normal    |    Milestone:         
   Component:  Compiler  |      Version:  6.4.1  
    Severity:  normal    |     Keywords:         
          Os:  Unknown   |   Difficulty:  Unknown
Architecture:  Unknown   |  
-------------------------+--------------------------------------------------
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

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/724>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list