id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
767	withMVar family have a bug	simonmar		"{{{withMVar}}} is defined like this:

{{{
withMVar :: MVar a -> (a -> IO b) -> IO b
withMVar m io = 
  block $ do
    a <- takeMVar m
    b <- catch (unblock (io a))
      	    (\e -> do putMVar m a; throw e)
    putMVar m a
    return b
}}}

unfortunately this has a (very rare) bug: {{{catch}}} can raise a stack overflow exception, which would leave the {{{MVar}}} empty.

This is a tricky one.  Perhaps in the event of a stack overflow, catch should ensure that the exception is passed directly to its handler, and we always add some extra stack space for the handler."	bug	closed	high	6.8.1	Compiler	6.4.1	fixed			Unknown/Multiple	Unknown/Multiple		Unknown	N/A			
