Ticket #2665 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

Compiler hangs

Reported by: rolyp Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Sorry for not providing a more specific summary.

The following code hangs the 6.8.2 compiler:

data U a = U [a] [a]

row :: a -> U a row u = U (iterate (fmap id) u) (iterate (fmap id) u)

This is the entire program. Simpler versions seem to make the problem go away, although I haven't investigated in detail. I'm running without any special compiler options enabled.

I have a suspicion this may be related to the problem with the inliner described at http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs.html#bugs-ghc.

cheers, Roly

Change History

Changed 5 years ago by NeilMitchell

It doesn't look like a case of the inliner bug - your data type is not of the right form. Using GHC 6.9 I get the error:

hang.hs:7:20:
    Couldn't match expected type `a1' against inferred type `f a'
      `a1' is a rigid type variable bound by
           the type signature for `row' at hang.hs:6:7
    In the first argument of `iterate', namely `(fmap id)'
    In the first argument of `U', namely `(iterate (fmap id) u)'
    In the expression: U (iterate (fmap id) u) (iterate (fmap id) u)

So your code has a type error, and whatever bug GHC was exhibiting has since been fixed.

Changed 5 years ago by simonpj

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to fixed

Yes, it's a bug in 6.8, fixed in 6.10. Thanks for reporting it though.

Simon

Note: See TracTickets for help on using tickets.