Bugs item #960029, was opened at 2004-05-25 12:33 Message generated for change (Comment added) made by stefanheimann You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=960029&group_id=8032
Category: Compiler Group: None >Status: Open Resolution: Fixed Priority: 5 Submitted By: Stefan Heimann (stefanheimann) Assigned to: Nobody/Anonymous (nobody) Summary: Segmentation fault with Template Haskell Initial Comment: When compiling the files attached, I get the following output: $ ./compile.sh Chasing modules from: TemplateTryOut.hs Skipping OHaskellPrimitives ( ./OHaskellPrimitives.hs, ./OHaskellPrimitives.o ) Skipping Utils ( ./Utils.hs, ./Utils.o ) Compiling Templates ( ./Templates.hs, ./Templates.o ) Compiling Main ( TemplateTryOut.hs, TemplateTryOut.o ) Loading package base ... linking ... done. Loading package haskell98 ... linking ... done. Loading package haskell-src ... linking ... done. [Info] Starting processing template [Info] Start of translation phase [Debug Trans] translating let expr [Debug Trans] translating declaration [Debug Trans] finished translating declarations of let, now translating body ./compile.sh: line 6: 23126 Segmentation fault ghc -fglasgow-exts --make TemplateTryOut.hs The problem is in Templates.hs, around line 202. As soon as you "touches" the body expression of an LetE, the compiler crashes. This is the GHC version I'm using: Glasgow Haskell Compiler, Version 6.2.1, for Haskell 98, compiled by GHC version 6.2 I first thought that I might have a stage 1 compiler, because the line above says "compiled by GHC version 6.2", but I just used the defaults when building GHC, so it should be a stage 2 compiler. ---------------------------------------------------------------------- >Comment By: Stefan Heimann (stefanheimann) Date: 2004-06-07 15:54 Message: Logged In: YES user_id=327401 I reopened the bug, because I get now the following error message: $ ./compile.sh Chasing modules from: TemplateTryOut.hs Compiling Templates ( ./Templates.hs, ./Templates.o ) Compiling Main ( TemplateTryOut.hs, TemplateTryOut.o ) /opt/ghc-cvs/lib/ghc-6.3.20040606/HSbase_cbits.o: unknown symbol `barf' Loading package base ... linking ... ghc-6.3.20040606: unable to load package `base' When I delete the calls to the template, the compilation goes fine. I tested it with ghc built from CVS (Head, 2004-06-05) and with the development snapshoot ghc-6.3.20040606-i386-unknown-linux.tar.bz2. In both cases, the error is the same ---------------------------------------------------------------------- Comment By: Simon Peyton Jones (simonpj) Date: 2004-06-02 10:25 Message: Logged In: YES user_id=50165 Great bug report. Fixed in the HEAD. Thanks ---------------------------------------------------------------------- Comment By: Stefan Heimann (stefanheimann) Date: 2004-05-28 11:38 Message: Logged In: YES user_id=327401 I' ve now provided a much smaller testcase. The error message is now: $ ./compile.sh Chasing modules from: TemplateTryOut.hs Compiling Templates ( ./Templates.hs, ./Templates.o ) Compiling Main ( TemplateTryOut.hs, TemplateTryOut.o ) Loading package base ... linking ... done. Loading package haskell98 ... linking ... done. Loading package template-haskell ... linking ... done. start of template TupE [LamE [VarP d_1627400335] (InfixE (Just (VarE d_1627400335)) (VarE GHC.Num.*) (Just (LitE (RationalL (157%50))))),AppE (VarE GHC.Base.return) (LitE (RationalL (1%1)))] template finished start of template ./compile.sh: line 6: 23032 Segmentation fault /opt/ghc-cvs/bin/ghc -fth --make TemplateTryOut.hs I think it has something to do with the record construction expression, because the example without the record construction works fine. ---------------------------------------------------------------------- Comment By: Stefan Heimann (stefanheimann) Date: 2004-05-27 23:49 Message: Logged In: YES user_id=327401 The bug also occurs with GHC from CVS (Head, 2004-05-27). The error message is: $ ./compile.sh Chasing modules from: TemplateTryOut.hs Skipping OHaskellPrimitives ( ./OHaskellPrimitives.hs, ./OHaskellPrimitives.o ) Skipping Utils ( ./Utils.hs, ./Utils.o ) Compiling Templates ( ./Templates.hs, ./Templates.o ) Compiling Main ( TemplateTryOut.hs, TemplateTryOut.o ) Loading package base ... linking ... done. Loading package haskell98 ... linking ... done. Loading package template-haskell ... linking ... done. [Info] Starting processing template [Info] Start of translation phase [Debug Trans] translating let expr [Debug Trans] translating declaration [Debug Trans] finished translating declarations of let, now translating body ./compile.sh: line 6: 1602 Segmentation fault /opt/ghc-cvs/bin/ghc -fth --make TemplateTryOut.hs ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=960029&group_id=8032 _______________________________________________ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs