#4533: IO manager can leak MVars if threads are killed
---------------------------------+------------------------------------------
    Reporter:  bos               |       Owner:  bos                        
        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
---------------------------------+------------------------------------------
Changes (by bos):

  * owner:  => bos


Comment:

 Yikes! Why did I spend most of yesterday messing around with weak
 pointers, when all I needed was an exception handler? I blame the
 Thanksgiving turkey making me slow.

 Anyway. I've attached a patch that adds exception handlers to the uses of
 {{{takeMVar}}} in {{{threadWait}}} and {{{threadDelay}}}. If an exception
 is thrown against the thread while it blocks, they drop the event or
 timeout registration, then rethrow the exception.

 This works with the fix for #4514, and also makes the test case for this
 bug run in constant space, as it should.

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