
#16087: TH tests fail in ext-interp way when ghc-stage2 is built using LLVM -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.10.1 Component: Compiler (LLVM) | Version: 8.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I'm going to look a bit harder at `T15502`. The test is quite simple: {{{#!hs main = print ( $( lift (toInteger (maxBound :: Int) + 1) ) , $( lift (minBound :: Int) ) ) }}} GHC falls over when evaluating the first splice. If I comment it out compilation finishes without crashing. Consequently, the minimal reproducer is: {{{#!hs {-# LANGUAGE TemplateHaskell #-} import Language.Haskell.TH.Syntax (Lift(lift)) main = print $( lift (toInteger (maxBound :: Int) + 1) ) }}} compiled with `-fexternal-interpreter` by a GHC compiled with `-fllvm`. Indeed, this is also easily reproducible with `ghci`: {{{ inplace/bin/ghc-stage2 -fexternal-interpreter --interactive GHCi, version 8.7.20190128: https://www.haskell.org/ghc/ :? for help Prelude> print $ toInteger (maxBound :: Int) + 1 ghc-stage2: ghc-iserv terminated (-11) Leaving GHCi. }}} The backtrace after the crash reliably looks like: {{{
x/80a $rbp 0x4200185e48: 0x8000000000000000 0x1b59860
0x4200185e58: 0x420001fad8 0x41de6980 0x4200185e68: 0x420001fad8 0x41677621 0x4200185e78: 0x40c63dd8 0x420001fad8 0x4200185e88: 0x41068ca1 0x40c64290 0x4200185e98: 0x1b59860 0x4200033518 0x4200185ea8: 0x40b5c330 0x4165e490 0x4200185eb8: 0x4200033518 0x40b6f020 0x4200185ec8: 0x4165e490 0x4200033518 0x4200185ed8: 0x41068c7a 0x40a02560 0x4200185ee8: 0x420001fa80 0x1b59040 0x4200185ef8: 0x1b59490 0xc 0x4200185f08: 0x42000334aa 0x40cb3790 0x4200185f18: 0x420002e879 0x4200032512 0x4200185f28: 0x420002b7d0 0x420003301a 0x4200185f38: 0x1b59490 0xc 0x4200185f48: 0x4200032002 0x40cb3790 0x4200185f58: 0x420002e879 0x4200030082 0x4200185f68: 0x420001fa18 0x4200031122 0x4200185f78: 0x1b58f00 0xf38490 0x4200185f88: 0x1b59490 0x0 0x4200185f98: 0x420002e7ca 0xf38570 0x4200185fa8: 0x1b59490 0x0 0x4200185fb8: 0x1e02eca 0xf386c8 0x4200185fc8: 0x1b59070 0xf388d0 0x4200185fd8: 0x420002e580 0x1b59490 0x4200185fe8: 0x4 0x1eaec12 0x4200185ff8: 0x1b5cad0 0x1b56b30 0x4200186008: 0x8000 0x10000000113 0x4200186018: 0x23000000000000 0x2000000000000000 0x4200186028: 0x4 0x4200186158 0x4200186038: 0x41068ca0 0x4163b8b8 0x4200186048: 0x420002f100 0x1b13e20 0x4200186058: 0x8000 0x1b13e70 0x4200186068: 0x4200186189 0x1fd7e11 0x4200186078: 0xe51ac8 0x42001861b5 0x4200186088: 0x11953a0 0x1def943 0x4200186098: 0x1def909 0x1def8fa 0x42001860a8: 0x119c158 0x42001852e9 0x42001860b8: 0x1195080 0x1b13e70 }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16087#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler