GHC: Ticket #7057: Simplifier infinite loop regression
http://ghc.haskell.org/trac/ghc/ticket/7057
<p>
GHC gets stuck in the simplifier when compiling the attached file, eventually exhausting all ram.
Compiling gives:
</p>
<pre class="wiki">$ 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:
...
</pre><p>
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.
</p>
en-usGHChttp://ghc.haskell.org/trac/ghc/chrome/site/ghc_logo.png
http://ghc.haskell.org/trac/ghc/ticket/7057
Trac 1.0.1ronwalfSat, 07 Jul 2012 21:07:16 GMTattachment set
http://ghc.haskell.org/trac/ghc/ticket/7057
http://ghc.haskell.org/trac/ghc/ticket/7057
<ul>
<li><strong>attachment</strong>
set to <em>ghcloop.hs</em>
</li>
</ul>
<p>
Infinite loop test case
</p>
TicketronwalfSat, 07 Jul 2012 22:27:16 GMT
http://ghc.haskell.org/trac/ghc/ticket/7057#comment:1
http://ghc.haskell.org/trac/ghc/ticket/7057#comment:1
<p>
It compiles fine on 6.12.3, and I have reports it does not on GHC 7.0.4 (thank you ben).
</p>
TicketsimonpjThu, 12 Jul 2012 15:51:40 GMTdifficulty set
http://ghc.haskell.org/trac/ghc/ticket/7057#comment:2
http://ghc.haskell.org/trac/ghc/ticket/7057#comment:2
<ul>
<li><strong>difficulty</strong>
set to <em>Unknown</em>
</li>
</ul>
<p>
Thanks. This yet another example of <a class="new ticket" href="http://ghc.haskell.org/trac/ghc/ticket/5448" title="bug: GHC stuck in infinite loop compiling with optimizations (new)">#5448</a>, the Russell-paradox bug.
</p>
<p>
It is easily fixed by adding <tt>{-# NOINLINE #-}</tt> on the <tt>pddlDocExpr</tt> definition in the instance declaration, and in general on every such instance declaration. The threads attached to <a class="new ticket" href="http://ghc.haskell.org/trac/ghc/ticket/5448" title="bug: GHC stuck in infinite loop compiling with optimizations (new)">#5448</a> explain the background. So that's a workaround, but not a satisfactory one.
</p>
<p>
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.
</p>
TicketiglooSun, 14 Oct 2012 16:35:12 GMTowner, milestone set
http://ghc.haskell.org/trac/ghc/ticket/7057#comment:3
http://ghc.haskell.org/trac/ghc/ticket/7057#comment:3
<ul>
<li><strong>owner</strong>
set to <em>simonpj</em>
</li>
<li><strong>milestone</strong>
set to <em>7.8.1</em>
</li>
</ul>
Ticket