[GHC] #13125: GHC Panics when encoding Russel's paradox using GADTs

GHC ghc-devs at haskell.org
Sat Jan 14 23:51:11 UTC 2017


#13125: GHC Panics when encoding Russel's paradox using GADTs
-------------------------------------+-------------------------------------
        Reporter:  tysonzero         |                Owner:
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:  duplicate         |             Keywords:  panic, GADTs
Operating System:  MacOS X           |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by carter):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/bugs.html
 #bugs-in-ghc

 see the remark at the end

 {{{


 GHC’s inliner can be persuaded into non-termination using the standard way
 to encode recursion via a data type:

 data U = MkU (U -> Bool)

 russel :: U -> Bool
 russel u@(MkU p) = not $ p u

 x :: Bool
 x = russel (MkU russel)
 The non-termination is reported like this:

 ghc: panic! (the 'impossible' happened)
   (GHC version 7.10.1 for x86_64-unknown-linux):
     Simplifier ticks exhausted
   When trying UnfoldingDone x_alB
   To increase the limit, use -fsimpl-tick-factor=N (default 100)
 with the panic being reported no matter how high a -fsimpl-tick-factor you
 supply.

 We have never found another class of programs, other than this contrived
 one, that makes GHC diverge, and fixing the problem would impose an extra
 overhead on every compilation. So the bug remains un-fixed. There is more
 background in Secrets of the GHC inliner.

 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13125#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list