Ticket #7057 (new bug)

Opened 11 months ago

Last modified 7 months ago

Simplifier infinite loop regression

Reported by: ronwalf Owned by: simonpj
Priority: normal Milestone: 7.8.1
Component: Compiler Version: 7.4.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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

ghcloop.hs Download (2.3 KB) - added by ronwalf 11 months ago.
Infinite loop test case

Change History

Changed 11 months ago by ronwalf

Infinite loop test case

Changed 11 months 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).

Changed 10 months ago by simonpj

  • difficulty set to 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.

Changed 7 months ago by igloo

  • owner set to simonpj
  • milestone set to 7.8.1
Note: See TracTickets for help on using tickets.