#5421: <<loop>> in withMVar (reproducible, but with large test case)
-------------------------------+--------------------------------------------
Reporter: JohnMillikin | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.2.1 | Keywords:
Testcase: | Blockedby:
Os: Linux | Blocking:
Architecture: x86_64 (amd64) | Failure: Incorrect result at runtime
-------------------------------+--------------------------------------------
Comment(by JohnMillikin):
After sleeping on it, I just realized the underlying cause. Here's a
reduced test case:
{{{
import Control.Concurrent
import Control.Monad.Fix
data Client = Client
{ clientLock :: MVar ()
}
main = do
mvar <- newMVar ()
client <- mfix $ \client -> do
_ <- forkIO (mainLoop client)
threadDelay 500000
return (Client mvar)
return ()
mainLoop client = withMVar (clientLock client) (\_ -> return ())
}}}
The weirdness in the code itself is now much more obvious. However, I
still can't get it to <<loop>> in GHC 7.0.4 or earlier.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5421#comment:2>
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