
#13708: Panic! (the "impossible" happened) bug in GHC 8.2.1 rc2 -------------------------------------+------------------------------------- Reporter: deech | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 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: | -------------------------------------+------------------------------------- Description changed by deech: @@ -1,2 +1,3 @@ - The bug can be reproduced but it does take some setup. Here's the error - report in case it's familiar: + The following causes a panic in GHC 8.2.1 rc2: + {{{ + module Main where @@ -4,18 +5,5 @@ - {{{ - ... - [1 of 2] Compiling Valuators ( .stack- - work/dist/x86_64-linux/Cabal-2.0.0.0/build/fltkhs-fluid-valuators/fltkhs- - fluid-valuators-tmp/Valuators.hs, .stack- - work/dist/x86_64-linux/Cabal-2.0.0.0/build/fltkhs-fluid-valuators/fltkhs- - fluid-valuators-tmp/Valuators.o ) - ghc: panic! (the 'impossible' happened) - (GHC version 8.2.0.20170507 for x86_64-unknown-linux): - idInfo - a_ad4D - Call stack: - CallStack (from HasCallStack): - prettyCurrentCallStack, called at - compiler/utils/Outputable.hs:1134:58 in ghc:Outputable - callStackDoc, called at compiler/utils/Outputable.hs:1138:37 in - ghc:Outputable - pprPanic, called at compiler/basicTypes/Var.hs:526:34 in ghc:Var + indexOr :: a -> Int -> [a] -> a + indexOr fallback idx xs = + if (idx < length xs) + then xs !! idx + else fallback @@ -23,1 +11,2 @@ - Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug + main :: IO () + main = undefined @@ -26,1 +15,17 @@ - The bug is in a demo for a GUI binding. To reproduce: + When compiling I get: + {{{ + [1 of 1] Compiling Main ( src/Examples/table-sort.hs, + .stack-work/dist/x86_64-linux/Cabal-2.0.0.0/build/fltkhs-table-sort + /fltkhs-table-sort-tmp/Main.o ) + ghc: panic! (the 'impossible' happened) + (GHC version 8.2.0.20170507 for x86_64-unknown-linux): + idInfo + a_a2ws + Call stack: + CallStack (from HasCallStack): + prettyCurrentCallStack, called at + compiler/utils/Outputable.hs:1134:58 in ghc:Outputable + callStackDoc, called at compiler/utils/Outputable.hs:1138:37 + in ghc:Outputable + pprPanic, called at compiler/basicTypes/Var.hs:526:34 in + ghc:Var @@ -28,21 +33,2 @@ - {{{ - # Install the FLTK GUI toolkit from source. - > wget http://fltk.org/pub/fltk/1.3.4/fltk-1.3.4-1-source.tar.gz - > tar -zxf fltk-1.3.4-1-source.tar.gz - > cd fltk-1.3.4-1 - > ./configure --enable-gl --enable-shared --enable-localjpeg --enable- - localzlib --enable-localpng - > make - > sudo make install - > fltk-config --version - 1.3.4-1 - - # Install the bindings from source - > git clone -b 8.2.1-rc2 https://github.com/deech/fltkhs - > cd fltkhs - > cabal install - - # Install the package causing the bug from source - > git clone -b 8.2.1-rc2 https://github.com/deech/fltkhs-fluid-demos - > cd fltkhs-fluid-demos - > cabal install + Please report this as a GHC bug: + http://www.haskell.org/ghc/reportabug New description: The following causes a panic in GHC 8.2.1 rc2: {{{ module Main where indexOr :: a -> Int -> [a] -> a indexOr fallback idx xs = if (idx < length xs) then xs !! idx else fallback main :: IO () main = undefined }}} When compiling I get: {{{ [1 of 1] Compiling Main ( src/Examples/table-sort.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.0.0/build/fltkhs-table-sort /fltkhs-table-sort-tmp/Main.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.2.0.20170507 for x86_64-unknown-linux): idInfo a_a2ws Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1134:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1138:37 in ghc:Outputable pprPanic, called at compiler/basicTypes/Var.hs:526:34 in ghc:Var Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13708#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler