
#7898: Compiler diverges when compiling module BSP of frag-1.1.2 -------------------------------+-------------------------------------------- Reporter: tinctorius | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Compile-time crash | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- GHC will get stuck when trying to compile [http://www.haskell.org/haskellwiki/Frag Frag]. Steps to reproduce: 1. Get Frag 1.1.2 from the Darcs repository (`darcs get http://code.haskell.org/frag`), or from snowmantw's !GitHub fork (`git clone https://github.com/snowmantw/Frag.git`). 1. Fix the code so it'll actually compile: {{{ diff --git a/src/Textures.hs b/src/Textures.hs index 7383fd8..b5516a5 100644 --- a/src/Textures.hs +++ b/src/Textures.hs @@ -10,6 +10,7 @@ import Graphics.UI.GLUT import TGA (readTga) import Data.Word (Word8) import Foreign.Marshal.Alloc (free) +import Control.Exception (catch, SomeException) -- read a list of images and returns a list of textures @@ -32,7 +33,8 @@ getAndCreateTexture fileName = do -- read the image data readImageC :: String -> IO (Maybe (Size, PixelData Word8)) -readImageC path = catch (readTga path) (\_ -> do print ("missing texture: "++path) +readImageC path = catch (readTga path) (\e -> do print (e :: SomeException) + print ("missing texture: "++path) return Nothing) }}} 1. `cabal configure` 1. `cabal build` GHC will get stuck on the module `BSP` and consume memory until it crashes. According to [https://github.com/snowmantw/Frag/issues/1 this ticket on the GitHub fork mentioned earlier], this problem only occurs with `-O2`. When I split the reading part of the module (`readBSP` and all functions it depends on), it crashed on that part. Will investigate further. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7898 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler