[GHC] #9514: Haddock panics when exporting a module with pattern synonyms

GHC ghc-devs at haskell.org
Mon Aug 25 22:05:47 UTC 2014


#9514: Haddock panics when exporting a module with pattern synonyms
-------------------------------------+-------------------------------------
       Reporter:  Artyom.Kazak       |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Compiler           |                 Version:  7.8.3
       Keywords:  haddock            |        Operating System:  Linux
   Architecture:  x86_64 (amd64)     |         Type of failure:  Compile-
     Difficulty:  Unknown            |  time crash
     Blocked By:                     |               Test Case:
Related Tickets:                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 First of all: Haddock version: '''2.14.3''', GHC version: '''7.8.3'''.

 Create 2 files, `PatSymDef.hs` and `PatSymUse.hs`:

 {{{#!hs
 -- PatSymDef.hs

 {-# Language PatternSynonyms #-}
 module PatSymDef where

 pattern Pat = ()
 }}}

 {{{#!hs
 -- PatSymUse.hs

 {-# Language PatternSynonyms #-}
 module PatSymUse (module PatSymDef) where

 import PatSymDef
 }}}

 Run Haddock on them:

 {{{
 [yom at shiny tmp]$ haddock -h PatSymDef.hs PatSymUse.hs
 Haddock coverage:
 Warning: Not found in environment: PatSymDef.Pat
   50% (  1 /  2) in 'PatSymDef'
 haddock: panic! (the 'impossible' happened)
   (GHC version 7.8.3 for x86_64-unknown-linux):
         mkUsage
 <<details unavailable>>

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

 And with `-ddump-if-trace`:

 {{{
 [yom at shiny tmp]$ haddock -h PatSymDef.hs PatSymUse.hs --optghc='-ddump-if-
 trace'
 Haddock coverage:
 Considering whether to load base:Prelude
 Reading interface for base:Prelude;
     reason: Prelude is directly imported
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/Prelude.hi
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/Prelude.dyn_hi
 updating EPS_
 updating EPS_
 Considering whether to load base:GHC.Base {- SYSTEM -}
 Reading interface for base:GHC.Base;
     reason: Loading orphan modules (base:GHC.Base)
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/GHC/Base.hi
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/GHC/Base.dyn_hi
 updating EPS_
 Considering whether to load base:GHC.Float {- SYSTEM -}
 Reading interface for base:GHC.Float;
     reason: Loading orphan modules (base:GHC.Float)
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/GHC/Float.hi
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/GHC/Float.dyn_hi
 updating EPS_
 Considering whether to load base:GHC.Real {- SYSTEM -}
 Reading interface for base:GHC.Real;
     reason: Loading orphan modules (base:GHC.Real)
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/GHC/Real.hi
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/GHC/Real.dyn_hi
 updating EPS_
 loadHiBootInterface main:PatSymDef
 Starting fork { Declaration for Monad
 Loading decl for GHC.Base.Monad
 updating EPS_
 Considering whether to load ghc-prim:GHC.Prim {- SYSTEM -}
 Reading interface for ghc-prim:GHC.Prim;
     reason: Need home interface for wired-in thing *
 updating EPS_
 Considering whether to load ghc-prim:GHC.Prim {- SYSTEM -}
 tc-iface-class1 Monad
 tc-iface-class2 Monad
 tc-iface-class3 Monad
 tc-iface-class4 Monad
 buildClass
 buildClass GHC.Base.Monad
 } ending fork Declaration for Monad
 Need decl for Control.Applicative.Applicative
 Considering whether to load base:Control.Applicative {- SYSTEM -}
 Reading interface for base:Control.Applicative;
     reason: Need decl for Control.Applicative.Applicative
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/Control/Applicative.hi
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/Control/Applicative.dyn_hi
 updating EPS_
 Starting fork { Declaration for Applicative
 Loading decl for Control.Applicative.Applicative
 updating EPS_
 Considering whether to load ghc-prim:GHC.Prim {- SYSTEM -}
 Considering whether to load ghc-prim:GHC.Prim {- SYSTEM -}
 tc-iface-class1 Applicative
 tc-iface-class2 Applicative
 tc-iface-class3 Applicative
 tc-iface-class4 Applicative
 buildClass
 buildClass Control.Applicative.Applicative
 } ending fork Declaration for Applicative
 Need decl for Control.Monad.MonadPlus
 Considering whether to load base:Control.Monad {- SYSTEM -}
 Reading interface for base:Control.Monad;
     reason: Need decl for Control.Monad.MonadPlus
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/Control/Monad.hi
 readIFace /usr/lib/ghc-7.8.3/base-4.7.0.1/Control/Monad.dyn_hi
 updating EPS_
 Starting fork { Declaration for MonadPlus
 Loading decl for Control.Monad.MonadPlus
 updating EPS_
 Considering whether to load ghc-prim:GHC.Prim {- SYSTEM -}
 Considering whether to load ghc-prim:GHC.Prim {- SYSTEM -}
 tc-iface-class1 MonadPlus
 tc-iface-class2 MonadPlus
 tc-iface-class3 MonadPlus
 tc-iface-class4 MonadPlus
 buildClass
 buildClass Control.Monad.MonadPlus
 } ending fork Declaration for MonadPlus
 Starting fork { Declaration for Alternative
 Loading decl for Control.Applicative.Alternative
 updating EPS_
 Considering whether to load ghc-prim:GHC.Prim {- SYSTEM -}
 Considering whether to load ghc-prim:GHC.Prim {- SYSTEM -}
 tc-iface-class1 Alternative
 tc-iface-class2 Alternative
 tc-iface-class3 Alternative
 tc-iface-class4 Alternative
 buildClass
 buildClass Control.Applicative.Alternative
 } ending fork Declaration for Alternative

 ==================== Interface statistics ====================
 Renamer stats: 7 interfaces read
                4 type/class/variable imported, out of 1234 read
                0 instance decls imported, out of 97 read
                0 rule decls imported, out of 53 read


 Need decl for PatSymDef.Pat
 Considering whether to load main:PatSymDef {- SYSTEM -}
 Warning: Not found in environment: PatSymDef.Pat
   50% (  1 /  2) in 'PatSymDef'
 Considering whether to load base:Prelude
 Considering whether to load main:PatSymDef
 updating EPS_
 Considering whether to load base:GHC.Base {- SYSTEM -}
 Considering whether to load base:GHC.Float {- SYSTEM -}
 Considering whether to load base:GHC.Real {- SYSTEM -}
 loadHiBootInterface main:PatSymUse
 haddock: panic! (the 'impossible' happened)
   (GHC version 7.8.3 for x86_64-unknown-linux):
         mkUsage
 <<details unavailable>>

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

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


More information about the ghc-tickets mailing list