SpecConstr explodes when compiling module BSP of frag-1.1.2
GHC will get stuck when trying to compile Frag. Steps to reproduce:
- 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
). - 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)
`
cabal configure
cabal build
GHC will get stuck on the module BSP
and consume memory until it crashes. According to 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.
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |