#4533: IO manager can leak MVars if threads are killed
---------------------------------+------------------------------------------
    Reporter:  bos               |       Owner:                             
        Type:  bug               |      Status:  new                        
    Priority:  normal            |   Component:  Runtime System             
     Version:  7.0.1             |    Keywords:                             
    Testcase:                    |   Blockedby:                             
          Os:  Unknown/Multiple  |    Blocking:                             
Architecture:  Unknown/Multiple  |     Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------

Comment(by bos):

 This isn't going to be entirely trivial to fix.

 I think what we need to do is use
 [http://haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/System-
 Mem-Weak.html System.Mem.Weak] to store the callback in an {{{FdData}}} as
 a weak reference.

 We'd also add a finalizer such that, if the callback gets GCed because its
 thread has died, we'd use {{{unregisterFd}}} to drop the registration.

 This should happen within {{{System.Event.Manager}}} rather than
 {{{System.Event.Thread}}}.

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