#4514: IO manager can deadlock if a file descriptor is closed behind its back
---------------------------------+------------------------------------------
    Reporter:  adept             |       Owner:  tibbe                      
        Type:  bug               |      Status:  new                        
    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 think the `kqueue` back end might be subject to the same problem, but
 I've narrowed the bug to Linux for now.

 In order to deal with this, we need to explicitly notify the back end when
 a file descriptor has been closed, e.g. via something like this:

 {{{
 GHC.Conc.threadClosed :: Fd -> IO ()
 }}}

 For some back ends (e.g. `select` and `poll`), this can be a no-op, but
 for `epoll` and `kqueue`, it should unregister the `Fd` if it's still
 present, and invoke any associated callbacks.

 We'll also need to update the I/O library and the network package to
 actually call this function when a close is performed.

 This doesn't address the problem of what to do about uses of the `dup` or
 `dup2` system calls, but that's really a separate one.

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