#4274: Runtime should not set SIGPIPE to ignored for subprocesses
---------------------------------+------------------------------------------
    Reporter:  phunge0           |       Owner:                             
        Type:  bug               |      Status:  new                        
    Priority:  normal            |   Component:  Compiler                   
     Version:  6.12.3            |    Keywords:                             
    Testcase:                    |   Blockedby:                             
          Os:  Unknown/Multiple  |    Blocking:                             
Architecture:  Unknown/Multiple  |     Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------
 The GHC runtime ignores SIGPIPE by setting the signal
 to SIG_IGN. This means that any subprocesses (created via
 System.Process or otherwise) inwill also have their
 SIGPIPE handler set to SIG_IGN; I think this might be
 a bug. The Python runtime does the same thing,
 there's a good explanation of the drawbacks in:
 http://bugs.python.org/issue1652

 IMHO the simplest fix is the patch below: simply
 avoid SIG_IGN, instead install a handler which does nothing.
 This way, an exec() restores the handler to SIG_DFL. I've
 included a testcase too.

 Discussion link: http://www.haskell.org/pipermail/glasgow-haskell-
 users/2010-August/019091.html. Summarizing: Donn Cave expressed concern
 that installing a signal handler for SIGPIPE might not be transparent to
 the rest of the program, but since the runtime already uses signal
 handlers for SIGVTALRM, it shouldn't make matters any worse.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4274>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to