|
[GHC] #767: withMVar family have a bug: msg#00040lang.haskell.glasgow.bugs
#767: withMVar family have a bug -------------------------+-------------------------------------------------- Reporter: simonmar | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 6.4.1 Severity: normal | Keywords: Os: Unknown | Difficulty: Unknown Architecture: Unknown | -------------------------+-------------------------------------------------- {{{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. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/767> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler_______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@xxxxxxxxxxx http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Conflict in HEAD between suffix.mk and config.mk.in, Reilly Hayes |
|---|---|
| Next by Date: | Re: [GHC] #764: DESTDIR Makefile variable, GHC |
| Previous by Thread: | Conflict in HEAD between suffix.mk and config.mk.in, Reilly Hayes |
| Next by Thread: | [GHC] #768: Improve performance of binary serialisation for interface files, GHC |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |