Ticket #4533 (closed bug: fixed)
IO manager can leak MVars if threads are killed
If a thread is killed in threadWaitRead and no data ever comes in on the file descriptor it was waiting on, the IO manager will not remove the FdData structure from its queue of waited-for events. This causes the queue to slowly grow in size.
-- Compile with: ghc -threaded --make import Control.Monad import Control.Concurrent main = do forM_ [0..10000] $ \i -> do when (i`mod`100==0) $ print i t <- forkIO $ threadWaitRead 0 threadDelay 5000 killThread t
This is not hugely likely to affect real programs, but could lead to a (perhaps accidental) denial of service against a long-running application.