Opened 7 years ago

Last modified 4 years ago

#7057 new bug

Simplifier infinite loop regression

Reported by: ronwalf Owned by: simonpj
Priority: normal Milestone:
Component: Compiler Version: 7.4.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


GHC gets stuck in the simplifier when compiling the attached file, eventually exhausting all ram. Compiling gives:

$ ghc -v3 -O --make ghcloop.hs 
Glasgow Haskell Compiler, Version 7.4.2, stage 2 booted by GHC version 7.0.3
*** Simplifier:
^C*** Deleting temp files:

Running with with all the dump flags suggests the fault is pddlDocExpr's. I'm finding it hard to create a smaller example, as even silly things like removing the container (or not using Data.Generics) restore termination.

Attachments (1)

ghcloop.hs (2.3 KB) - added by ronwalf 7 years ago.
Infinite loop test case

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by ronwalf

Attachment: ghcloop.hs added

Infinite loop test case

comment:1 Changed 7 years ago by ronwalf

It compiles fine on 6.12.3, and I have reports it does not on GHC 7.0.4 (thank you ben).

comment:2 Changed 7 years ago by simonpj

difficulty: Unknown

Thanks. This yet another example of #5448, the Russell-paradox bug.

It is easily fixed by adding {-# NOINLINE #-} on the pddlDocExpr definition in the instance declaration, and in general on every such instance declaration. The threads attached to #5448 explain the background. So that's a workaround, but not a satisfactory one.

Since the "live" examples of this bug all involve a class used contravariantly in one of its methods, I'm beginning to think that an effective counter-measure might be to NOINLINE such methods. It's a bit disgusting, and does not solve the whole problem, but it would fix all the real occurrences in the wild.

comment:3 Changed 7 years ago by igloo

Milestone: 7.8.1
Owner: set to simonpj

comment:4 Changed 6 years ago by thoughtpolice


Moving to 7.10.1.

comment:5 Changed 5 years ago by thoughtpolice


Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:6 Changed 4 years ago by thoughtpolice


Milestone renamed

comment:7 Changed 4 years ago by thomie

Milestone: 8.0.1

Other instances of this bug: #8833, #3872, #5400, #5448, #5722, #7057, #7369, #9235. All marked with Milestone bottom.

Note: See TracTickets for help on using tickets.