[GHC] #14931: Segfault compiling file that uses Template Haskell with -prof

GHC ghc-devs at haskell.org
Fri Mar 16 13:48:50 UTC 2018


#14931: Segfault compiling file that uses Template Haskell with -prof
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Profiling         |              Version:  8.4.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Here's a version which doesn't depend on `mtl`:

 {{{#!hs
 {-# LANGUAGE TemplateHaskell #-}
 module Bug where

 import Data.Functor.Identity (runIdentity)
 import Language.Haskell.TH.Syntax (lift)

 wat :: IO ()
 wat = print $(lift $ runIdentity $ do (_, x) <- return (True, False)
                                       return x)
 }}}
 {{{
 $ ~/Software/ghc-8.4.1/bin/ghc -O -prof -osuf p_o -hisuf p_hi Bug.hs
 [1 of 1] Compiling Bug              ( Bug.hs, Bug.p_o )
 Segmentation fault (core dumped)
 }}}

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


More information about the ghc-tickets mailing list