ghc-9.10: The impossible happened, coreToStgExpr - Invalid app head:
Summary
Our code hits an error in the compiler:
<no location info>: error:
panic! (the 'impossible' happened)
GHC version 9.10.1:
coreToStgExpr - Invalid app head:
((join {
$j2_svnc [Occ=Once2!T[1], Dmd=1C(1,L)]
:: StateT Int (Decoder RealWorld) ()
-> ST RealWorld (DecodeAction RealWorld (Addr StandardCrypto))
[LclId[JoinId(1)(Just [!])],
Arity=1,
Str=<1C(1,C(1,C(1,L)))>,
Unf=OtherCon []]
$j2_svnc (eta4_svnd [Occ=Once1, OS=OneShot]
:: StateT Int (Decoder RealWorld) ())
= case -# len_sv47 1# of lvl57_svne { __DEFAULT ->
...
Steps to reproduce
This happens every single time I try to compile this code.
However, the code started off as about 500k lines of code and after spending several days on this I have it down to just under 100k lines of code. I would assume that an acceptable mininal reproduction case is under 1k lines of code. The error output (which I have only given the start of above) is over 6k lines long.
I would love to produce a mininal reproduction case but getting it from 500k to just under 100k already took several days and from here on, it seems to be getting more and more difficult to reduce the size. I would not be surprised if getting it down to 1k lines would take several weeks.
Expected behavior
The compiler should not abort even if the code is invalid. However, this code compiles and works
correctly with ghc-8.10
, ghc-9.6.5
, ghc-9.8.2
and probably others.
What do you expect the reproducer described above to do?
Environment
- GHC version used: 9.10.1 release
Optional:
- Operating System: Linux
- System Architecture: x86_86