[GHC] #10539: ghc internal error compiling simple template haskell + lens program

#10539: ghc internal error compiling simple template haskell + lens program -------------------------------------+------------------------------------- Reporter: andrew.wja | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Keywords: lens | Operating System: Linux template-haskell | Type of failure: Compile-time Architecture: x86_64 | crash (amd64) | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- The following happens when compiling a piece of Haskell code with GHC 7.10.1 (code at the bottom of this report). Compilation is successful with GHC 7.8.4 -- both using lens-4.11, which makes this seem like a TH issue. {{{#!sh Building language-arithmetic-0.1.0.0... Preprocessing library language-arithmetic-0.1.0.0... [1 of 2] Compiling Language.Arithmetic.Syntax ( src/Language/Arithmetic/Syntax.hs, dist/build/Language/Arithmetic/Syntax.o ) ghc: internal error: stg_ap_v_ret (GHC version 7.10.1 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Aborted (core dumped) }}} {{{#!hs module Language.Arithmetic.Syntax where import Control.Applicative hiding (Const) import Control.Lens hiding (Const) import Control.Lens.Plated import Prelude hiding (const) import Data.Data data Arith a b c = Plus { _left :: (Arith a b c), _right :: (Arith a b c) } | Minus { _left :: (Arith a b c), _right :: (Arith a b c) } | Times { _left :: (Arith a b c), _right :: (Arith a b c) } | Divide { _left :: (Arith a b c), _right :: (Arith a b c) } | Modulo { _left :: (Arith a b c), _right :: (Arith a b c) } | Parens { _subexp :: (Arith a b c) } | FunCall{ _name :: String, _subexp :: (Arith a b c) } | Const { _const :: a} | Var { _var :: b } | Embed { _embed :: c } deriving (Show, Eq, Ord, Data, Typeable) makeLenses ''Arith instance Plated (Arith a b c) where plate = uniplate }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10539 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10539: ghc internal error compiling simple template haskell + lens program -------------------------------------+------------------------------------- Reporter: andrew.wja | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: lens Operating System: Linux | template-haskell Type of failure: Compile-time | Architecture: x86_64 crash | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Can others reproduce this? Please use `-dcore-lint`. Thanks -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10539#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10539: ghc internal error compiling simple template haskell + lens program -------------------------------------+------------------------------------- Reporter: andrew.wja | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: lens Operating System: Linux | template-haskell Type of failure: Compile-time | Architecture: x86_64 crash | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => infoneeded Comment: No because even after adding `{-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-}` I get {{{ Syntax.hs:24:11: Not in scope: ‘uniplate’ }}} On the other hand, I guess that means the splice `makeLenses ''Arith`, which is probably where GHC crashes for you, has already run successfully, so in that sense I can't reproduce it either. Can you double check the reproducer? Maybe you minimized it too much? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10539#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10539: ghc internal error compiling simple template haskell + lens program -------------------------------------+------------------------------------- Reporter: andrew.wja | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: worksforme | Keywords: lens | template-haskell Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: infoneeded => closed * resolution: => worksforme Comment: I tried with ghc-7.10.2 and lens-4.12.3, and couldn't reproduce it either. andrew.wja: please reopen if you can reproduce this problem with ghc-7.10.2. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10539#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC