#4514: IO manager can deadlock if a file descriptor is closed behind its back
---------------------------------+------------------------------------------
    Reporter:  adept             |       Owner:  bos                        
        Type:  bug               |      Status:  patch                      
    Priority:  normal            |   Component:  Runtime System             
     Version:  7.0.1             |    Keywords:                             
    Testcase:                    |   Blockedby:                             
          Os:  Linux             |    Blocking:                             
Architecture:  Unknown/Multiple  |     Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------

Comment(by bos):

 I just uploaded what should be the final patches against {{{base}}} and
 {{{network}}}.

 * The public APIs for {{{threadWaitRead}}} and {{{threadWaitWrite}}}
 remain unchanged, and now throw an {{{IOError}}} if a file descriptor is
 closed behind their backs.
 * The {{{GHC.Conc}}} API is extended to add a {{{closeFd}}} function, the
 behaviour of which is documented.
 * Behind the scenes, we add a new {{{evtClose}}} event, which is used
 ''only'' when one thread closes a file descriptor that other threads are
 blocking on.
 * Both {{{base}}}'s IO code and {{{network}}} use the new {{{closeFd}}}
 function.

 I've verified that adept's test case remains fixed.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4514#comment:25>
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