Opened 10 years ago

Closed 10 years ago

#3938 closed bug (fixed)

Data growth issue in System.Timeout

Reported by: leimy Owned by:
Priority: normal Milestone:
Component: libraries (other) Version: 6.12.1
Keywords: Cc:
Operating System: MacOS X Architecture: x86
Type of failure: Runtime performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


(This bug is lhs)

The following seemingly simple code causes infinite data growth and resource exhaustion when the code for System.Timeout does not immediately appear to have a bug with respect to resource utilization.

module Main where

import System.Timeout import Control.Monad

timeoutval :: Int timeoutval = 12 * 10 6 -- 12 seconds

doit :: IO (Maybe ()) doit = timeout (-1) $ return ()

main :: IO () main = forever $ return ()

Change History (1)

comment:1 Changed 10 years ago by simonmar

Resolution: fixed
Status: newclosed

The cause of this was the lazy IORef in Data.Unique, which was fixed recently:

Thu Mar 18 10:44:36 GMT 2010  Simon Marlow <>
  * change to use STM, fixing 4 things

Fri Mar 19 12:59:51 GMT 2010  Bas van Dijk <>
  * Write the thunk 'next' to the MVar
Note: See TracTickets for help on using tickets.