[GHC] #367: Infinite loops can hang Concurrent Haskell
GHC
cvs-ghc at haskell.org
Mon Sep 24 21:16:47 CEST 2012
#367: Infinite loops can hang Concurrent Haskell
------------------------------------------+---------------------------------
Reporter: simonpj | Owner: ezyang
Type: bug | Status: new
Priority: lowest | Milestone: _|_
Component: Compiler | Version: 6.4.1
Resolution: None | Keywords: scheduler allocation
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: Incorrect result at runtime | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
------------------------------------------+---------------------------------
Comment(by ezyang):
For reference, here is an example of a non-allocating recursive let-no-
escape:
{{{
{-# LANGUAGE MagicHash #-}
import GHC.Conc
import GHC.Prim
import GHC.Exts
main = numSparks >>= \x -> f x `seq` return ()
{-# NOINLINE f #-}
f :: Int -> Bool
f i@(I# j) = let fail :: Int# -> Bool
fail i = fail (i +# 1#)
in if (case i of
0 -> True
_ -> False) then fail j else False
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/367#comment:27>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list