[GHC] #13695: Highly nested UNPACKed data causes panic

GHC ghc-devs at haskell.org
Tue May 16 04:39:48 UTC 2017


#13695: Highly nested UNPACKed data causes panic
---------------------------------+----------------------------------------
        Reporter:  ryanreich     |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  high          |            Milestone:  8.2.1
       Component:  Compiler      |              Version:  8.2.1-rc2
      Resolution:                |             Keywords:
Operating System:  Linux         |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:  #3990         |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by RyanGlScott):

 Ah, it seems that rebuilding with slight changes is crucial to triggering
 this bug. I've attached simplified versions of your original programs that
 remove the Template Haskell stuff and make clear what specific change is
 needed to make GHC panic. In particular, to reproduce this bug, do the
 following with either GHC 8.2.1 or HEAD:

 1. Run `/opt/ghc/8.2.1/bin/ghc BigWord2.hs -O2`
 2. Edit `BigWord2.hs`, and uncomment the block of code at the bottom (the
 one that starts with `type instance BigWord 5 = BigWord5` and ends with
 `instance LowHigh BigWord4 where ...`)
 3. Run `/opt/ghc/8.2.1/bin/ghc BigWord2.hs -O2` again:

 {{{
 $ /opt/ghc/8.2.1/bin/ghc BigWord2.hs -O2
 [3 of 3] Compiling BigWord2         ( BigWord2.hs, BigWord2.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.2.0.20170505 for x86_64-unknown-linux):
         urk! lookup local fingerprint
   D:R:DoubleWordDoubleWord4
   [cESeWE :-> (BigWord2, 34dc4d50eaf3c3f1fec88a99dae21850),
    cESfxE :-> (BigWord3, 2b1c1772a861f399344dc06c29e7e7c0),
    cESfxF :-> (BigWord4, df345db7e7bc5c1dd0c73d6b038bc339),
    cESfxY :-> (BigWord5, 2b3cbb09e91bec36a2a2c359191139d2),
    cESg1l :-> (R:DoubleWordDoubleWord5,
                00000000000000000000000000000000),
    cESg1n :-> (D:R:DoubleWordDoubleWord6,
                00000000000000000000000000000000),
    cESg1v :-> (D:R:BigWord5, 560a80c635c7dd211457b5d4dab86d51),
    dESfxY :-> (BigWord5, 775d4a6ae2e1194445cb6e4252de8b91),
    iESfxY :-> (BigWord5, fc430fea13ebb9a94e051713cccf16ee),
    iESg1p :-> ($WBigWord5, c95ed7d25584a6ae4abaf9ae169cd259)]
   Call stack:
       CallStack (from HasCallStack):
         prettyCurrentCallStack, called at
 compiler/utils/Outputable.hs:1134:58 in ghc:Outputable
         callStackDoc, called at compiler/utils/Outputable.hs:1138:37 in
 ghc:Outputable
         pprPanic, called at compiler/iface/MkIface.hs:508:37 in
 ghc:MkIface

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

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


More information about the ghc-tickets mailing list