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

GHC ghc-devs at haskell.org
Fri Mar 16 13:43:35 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 nmattia):

 Ok, this is really strange. I've tried to reproduce the example given in
 https://ghc.haskell.org/trac/ghc/ticket/8025. In this case, GHC 8.0.2 and
 8.2.2 fail with
 {{{
     ByteCodeLink.lookupCE
         During interactive linking, GHCi couldn't find the following
 symbol: ...
 }}}

 while 8.4.1 (actually, [8.4.0
 https://github.com/NixOS/nixpkgs/issues/37026]) ) compiles successfully:
 {{{

 nicolas at nicolas-XPS-13-9370:/tmp/no-code$ cat A.hs
 {-# LANGUAGE TemplateHaskell #-}
 module A where
 a = [|3|]
 nicolas at nicolas-XPS-13-9370:/tmp/no-code$ cat B.hs
 {-# LANGUAGE TemplateHaskell #-}
 module B where
 import A
 x = $(a)
 nicolas at nicolas-XPS-13-9370:/tmp/no-code$ nix-shell -p
 'haskell.compiler.ghc802' --run 'ghc -fno-code B'
 [1 of 2] Compiling A                ( A.hs, nothing )
 [2 of 2] Compiling B                ( B.hs, nothing )

 ByteCodeLink.lookupCE
 During interactive linking, GHCi couldn't find the following symbol:
   A_a_closure
 This may be due to you not asking GHCi to load extra object files,
 archives or DLLs needed by your current session.  Restart GHCi, specifying
 the missing library using the -L/path/to/object/dir and -lmissinglibname
 flags, or simply by naming the relevant files on the GHCi command line.
 Alternatively, this link failure might indicate a bug in GHCi.
 If you suspect the latter, please send a bug report to:
   glasgow-haskell-bugs at haskell.org

 nicolas at nicolas-XPS-13-9370:/tmp/no-code$ nix-shell -p
 'haskell.compiler.ghc822' --run 'ghc -fno-code B'
 [1 of 2] Compiling A                ( A.hs, nothing )
 [2 of 2] Compiling B                ( B.hs, nothing )
 ghc: ^^ Could not load 'A_a_closure', dependency unresolved. See top entry
 above.


 ByteCodeLink.lookupCE
 During interactive linking, GHCi couldn't find the following symbol:
   A_a_closure
 This may be due to you not asking GHCi to load extra object files,
 archives or DLLs needed by your current session.  Restart GHCi, specifying
 the missing library using the -L/path/to/object/dir and -lmissinglibname
 flags, or simply by naming the relevant files on the GHCi command line.
 Alternatively, this link failure might indicate a bug in GHCi.
 If you suspect the latter, please send a bug report to:
   glasgow-haskell-bugs at haskell.org

 nicolas at nicolas-XPS-13-9370:/tmp/no-code$ nix-shell -p
 'haskell.compiler.ghc841' --run 'ghc -fno-code B'
 [1 of 2] Compiling A                ( A.hs,
 /run/user/1001/ghc17566_0/ghc_2.o )
 [2 of 2] Compiling B                ( B.hs,
 /run/user/1001/ghc17566_0/ghc_4.o )
 nicolas at nicolas-XPS-13-9370:/tmp/no-code$ echo $?
 0
 }}}

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


More information about the ghc-tickets mailing list