[GHC] #14880: GHC panic: updateRole

GHC ghc-devs at haskell.org
Mon Jul 16 14:43:12 UTC 2018


#14880: GHC panic: updateRole
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.2
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15076            |  Differential Rev(s):  Phab:D4769
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by tdammers):

 `-ddump-simpl` suggests the problem is not increased Core size; the output
 is practically identical.

 So I did a run with `+RTS -p`, and got this:

 {{{
         Mon Jul 16 16:37 2018 Time and Allocation Profiling Report
 (Final)

            ghc-stage2 +RTS -p -RTS -B/home/tobias/well-typed/devel/ghc-
 phab/inplace/lib -c T5631.hs -fforce-recomp

         total time  =        1.38 secs   (1383 ticks @ 1000 us, 1
 processor)
         total alloc = 1,208,527,080 bytes  (excludes profiling overheads)

 COST CENTRE                MODULE     SRC
 %time %alloc

 tc_rn_src_decls            TcRnDriver
 compiler/typecheck/TcRnDriver.hs:(491,4)-(553,7)     38.7   55.9
 withCleanupSession.cleanup GHC
 compiler/main/GHC.hs:(468,4)-(475,37)                23.1    0.0
 zonkTopDecls               TcRnDriver
 compiler/typecheck/TcRnDriver.hs:(442,16)-(443,43)    7.0    8.7
 CorePrep                   HscMain
 compiler/main/HscMain.hs:(1317,24)-(1318,57)          3.0    4.9
 deSugar                    HscMain    compiler/main/HscMain.hs:512:7-44
 2.6    2.5
 pprNativeCode              AsmCodeGen
 compiler/nativeGen/AsmCodeGen.hs:(529,37)-(530,65)    2.4    1.8
 CoreTidy                   HscMain    compiler/main/HscMain.hs:1257:27-67
 1.8    2.3
 simplIdF                   Simplify
 compiler/simplCore/Simplify.hs:859:61-79              1.6    1.3
 simplifyTop                TcRnDriver
 compiler/typecheck/TcRnDriver.hs:409:25-39            1.4    2.2
 Parser                     HscMain
 compiler/main/HscMain.hs:(317,5)-(385,20)             1.4    2.6
 StgCmm                     HscMain
 compiler/main/HscMain.hs:(1432,13)-(1433,62)          1.3    1.0
 }}}

 And then digging into the call graph analysis, this surprising bit:

 {{{
          hscTypecheck                            HscMain
 compiler/main/HscMain.hs:(425,1)-(428,20)          1564          1    0.0
 0.0    51.9   73.1
           extract_renamed_stuff                  HscMain
 compiler/main/HscMain.hs:(397,1)-(410,31)          1640          1    0.0
 0.0     0.0    0.0
           hscTypecheck'                          HscMain
 compiler/main/HscMain.hs:(434,1)-(456,38)          1565          1    0.0
 0.0    51.9   73.1
            [...]
            tcRnModule'                           HscMain
 compiler/main/HscMain.hs:(461,1)-(500,72)          1570          1    0.0
 0.0    50.5   70.5
             Typecheck-Rename                     HscMain
 compiler/main/HscMain.hs:(464,16)-(465,73)         1571          1    0.0
 0.0    50.5   70.5
              ioMsgMaybe                          HscMain
 compiler/main/HscMain.hs:(251,1)-(256,122)         1572          1    0.4
 0.8    50.5   70.5

 }}}

 In other words, we spend 70% of our allocations on "dealing with errors
 and warnings returned by a compilation step".

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


More information about the ghc-tickets mailing list