GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:41:53Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/9106GHC Panic related to functional dependencies - kindFunResult2019-07-07T18:41:53ZyuriyGHC Panic related to functional dependencies - kindFunResultMinimal example:
```
{-# LANGUAGE
MultiParamTypeClasses, DataKinds, FunctionalDependencies, TypeOperators,
KindSignatures, PolyKinds, FlexibleInstances, FlexibleContexts, UndecidableInstances #-}
import GHC.TypeLits
data Proxy (...Minimal example:
```
{-# LANGUAGE
MultiParamTypeClasses, DataKinds, FunctionalDependencies, TypeOperators,
KindSignatures, PolyKinds, FlexibleInstances, FlexibleContexts, UndecidableInstances #-}
import GHC.TypeLits
data Proxy (a :: k) = Proxy
class FunctorN n f a fa | n f a -> fa where
fmapn :: Proxy n -> Proxy f -> (a -> a) -> fa -> fa
instance FunctorN 0 f a a where
fmapn _ _ a = a
instance (Functor f, FunctorN (n - 1) f a fa) => FunctorN n f a (f fa) where
fmapn _ pf f = fmap (fmapn (Proxy :: Proxy (n-1)) pf f)
```
Crashes with ghc and ghci:
```
>ghc test
[1 of 1] Compiling Main ( test.hs, test.o )
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.8.20140130 for x86_64-unknown-mingw32):
kindFunResult k{tv azb} [sk]
>ghci test
GHCi, version 7.8.20140130: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main ( test.hs, interpreted )
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.8.20140130 for x86_64-unknown-mingw32):
kindFunResult k{tv aPm} [sk]
```
Removing the functional dependency makes the code compile.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC Panic related to functional dependencies - kindFunResult","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Minimal example:\r\n\r\n{{{\r\n{-# LANGUAGE \r\n MultiParamTypeClasses, DataKinds, FunctionalDependencies, TypeOperators,\r\n KindSignatures, PolyKinds, FlexibleInstances, FlexibleContexts, UndecidableInstances #-}\r\n\r\nimport GHC.TypeLits \r\n\r\ndata Proxy (a :: k) = Proxy \r\n\r\nclass FunctorN n f a fa | n f a -> fa where \r\n fmapn :: Proxy n -> Proxy f -> (a -> a) -> fa -> fa\r\n\r\ninstance FunctorN 0 f a a where \r\n fmapn _ _ a = a \r\n\r\ninstance (Functor f, FunctorN (n - 1) f a fa) => FunctorN n f a (f fa) where \r\n fmapn _ pf f = fmap (fmapn (Proxy :: Proxy (n-1)) pf f)\r\n}}}\r\n\r\nCrashes with ghc and ghci:\r\n\r\n{{{\r\n>ghc test\r\n[1 of 1] Compiling Main ( test.hs, test.o )\r\nghc.exe: panic! (the 'impossible' happened)\r\n (GHC version 7.8.20140130 for x86_64-unknown-mingw32):\r\n kindFunResult k{tv azb} [sk]\r\n\r\n>ghci test\r\nGHCi, version 7.8.20140130: http://www.haskell.org/ghc/ :? for help\r\nLoading package ghc-prim ... linking ... done.\r\nLoading package integer-gmp ... linking ... done.\r\nLoading package base ... linking ... done.\r\n[1 of 1] Compiling Main ( test.hs, interpreted )\r\nghc.exe: panic! (the 'impossible' happened)\r\n (GHC version 7.8.20140130 for x86_64-unknown-mingw32):\r\n kindFunResult k{tv aPm} [sk]\r\n}}}\r\n\r\nRemoving the functional dependency makes the code compile. ","type_of_failure":"OtherFailure","blocking":[]} -->7.8.3https://gitlab.haskell.org/ghc/ghc/-/issues/9104internal compiler error: Segmentation fault for haskell-src-exts-1.15.0.12019-07-07T18:41:54Zmhwombatinternal compiler error: Segmentation fault for haskell-src-exts-1.15.0.1```
amy@wombat$ cabal --no-require-sandbox install haskell-src-exts-1.15.0.1
Resolving dependencies...
Configuring haskell-src-exts-1.15.0.1...
Building haskell-src-exts-1.15.0.1...
Failed to install haskell-src-exts-1.15.0.1
Last 10 lin...```
amy@wombat$ cabal --no-require-sandbox install haskell-src-exts-1.15.0.1
Resolving dependencies...
Configuring haskell-src-exts-1.15.0.1...
Building haskell-src-exts-1.15.0.1...
Failed to install haskell-src-exts-1.15.0.1
Last 10 lines of the build log ( /home/amy/.cabal/logs/haskell-src-exts-1.15.0.1.log ):
[22 of 22] Compiling Language.Haskell.Exts ( src/Language/Haskell/Exts.hs, dist/build/Language/Haskell/Exts.o )
[ 1 of 22] Compiling Language.Haskell.Exts.Annotated.Syntax ( src/Language/Haskell/Exts/Annotated/Syntax.hs, dist/build/Language/Haskell/Exts/Annotated/Syntax.p_o )
/tmp/ghc23747_0/ghc23747_3.s:1:0:
internal compiler error: Segmentation fault
.section .rodata
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
cabal: Error: some packages failed to install:
haskell-src-exts-1.15.0.1 failed during the building phase. The exception was:
ExitFailure 1
```
```
amy@wombat$ cabal --version
cabal-install version 1.21.0.0
using version 1.21.0.0 of the Cabal library
```
```
amy@wombat$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.2
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"internal compiler error: Segmentation fault for haskell-src-exts-1.15.0.1","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\namy@wombat$ cabal --no-require-sandbox install haskell-src-exts-1.15.0.1\r\nResolving dependencies...\r\nConfiguring haskell-src-exts-1.15.0.1...\r\nBuilding haskell-src-exts-1.15.0.1...\r\nFailed to install haskell-src-exts-1.15.0.1\r\nLast 10 lines of the build log ( /home/amy/.cabal/logs/haskell-src-exts-1.15.0.1.log ):\r\n[22 of 22] Compiling Language.Haskell.Exts ( src/Language/Haskell/Exts.hs, dist/build/Language/Haskell/Exts.o )\r\n[ 1 of 22] Compiling Language.Haskell.Exts.Annotated.Syntax ( src/Language/Haskell/Exts/Annotated/Syntax.hs, dist/build/Language/Haskell/Exts/Annotated/Syntax.p_o )\r\n\r\n/tmp/ghc23747_0/ghc23747_3.s:1:0:\r\n internal compiler error: Segmentation fault\r\n .section .rodata\r\n ^\r\nPlease submit a full bug report,\r\nwith preprocessed source if appropriate.\r\nSee <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.\r\ncabal: Error: some packages failed to install:\r\nhaskell-src-exts-1.15.0.1 failed during the building phase. The exception was:\r\nExitFailure 1\r\n}}}\r\n{{{\r\namy@wombat$ cabal --version\r\ncabal-install version 1.21.0.0\r\nusing version 1.21.0.0 of the Cabal library \r\n}}}\r\n{{{\r\namy@wombat$ ghc --version\r\nThe Glorious Glasgow Haskell Compilation System, version 7.8.2\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/9100Cannot build crypto-pubkey with GHC 7.8.2 and profiling2019-07-07T18:41:55ZJohnWiegleyCannot build crypto-pubkey with GHC 7.8.2 and profilingI configure crypto-pubkey with:
```
configure flags: --disable-split-objs --enable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests
```
And on building get:
```
Building crypto-pubk...I configure crypto-pubkey with:
```
configure flags: --disable-split-objs --enable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests
```
And on building get:
```
Building crypto-pubkey-0.2.4...
Preprocessing library crypto-pubkey-0.2.4...
[ 1 of 15] Compiling Crypto.PubKey.ECC.Prim ( Crypto/PubKey/ECC/Prim.hs, dist/build/Crypto/PubKey/ECC/Prim.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.2 for x86_64-apple-darwin):
Ix{Int}.index: Index (75497475) out of range ((0,1333))
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Running Haddock for crypto-pubkey-0.2.4...
Preprocessing library crypto-pubkey-0.2.4...
Haddock coverage:
haddock: internal error: Ix{Int}.index: Index (75497475) out of range ((0,1333))
```
If I disable library profiling, it builds cleanly:
```
Building crypto-pubkey-0.2.4...
Preprocessing library crypto-pubkey-0.2.4...
[ 1 of 15] Compiling Crypto.PubKey.ECC.Prim ( Crypto/PubKey/ECC/Prim.hs, dist/build/Crypto/PubKey/ECC/Prim.o )
[ 2 of 15] Compiling Crypto.PubKey.ECC.Generate ( Crypto/PubKey/ECC/Generate.hs, dist/build/Crypto/PubKey/ECC/Generate.o )
[ 3 of 15] Compiling Crypto.PubKey.DH ( Crypto/PubKey/DH.hs, dist/build/Crypto/PubKey/DH.o )
[ 4 of 15] Compiling Crypto.PubKey.HashDescr ( Crypto/PubKey/HashDescr.hs, dist/build/Crypto/PubKey/HashDescr.o )
[ 5 of 15] Compiling Crypto.PubKey.MaskGenFunction ( Crypto/PubKey/MaskGenFunction.hs, dist/build/Crypto/PubKey/MaskGenFunction.o )
[ 6 of 15] Compiling Crypto.PubKey.DSA ( Crypto/PubKey/DSA.hs, dist/build/Crypto/PubKey/DSA.o )
[ 7 of 15] Compiling Crypto.PubKey.ECC.ECDSA ( Crypto/PubKey/ECC/ECDSA.hs, dist/build/Crypto/PubKey/ECC/ECDSA.o )
[ 8 of 15] Compiling Crypto.PubKey.ElGamal ( Crypto/PubKey/ElGamal.hs, dist/build/Crypto/PubKey/ElGamal.o )
[ 9 of 15] Compiling Crypto.PubKey.Internal ( Crypto/PubKey/Internal.hs, dist/build/Crypto/PubKey/Internal.o )
[10 of 15] Compiling Crypto.PubKey.RSA.Types ( Crypto/PubKey/RSA/Types.hs, dist/build/Crypto/PubKey/RSA/Types.o )
[11 of 15] Compiling Crypto.PubKey.RSA.Prim ( Crypto/PubKey/RSA/Prim.hs, dist/build/Crypto/PubKey/RSA/Prim.o )
[12 of 15] Compiling Crypto.PubKey.RSA ( Crypto/PubKey/RSA.hs, dist/build/Crypto/PubKey/RSA.o )
[13 of 15] Compiling Crypto.PubKey.RSA.PKCS15 ( Crypto/PubKey/RSA/PKCS15.hs, dist/build/Crypto/PubKey/RSA/PKCS15.o )
[14 of 15] Compiling Crypto.PubKey.RSA.OAEP ( Crypto/PubKey/RSA/OAEP.hs, dist/build/Crypto/PubKey/RSA/OAEP.o )
[15 of 15] Compiling Crypto.PubKey.RSA.PSS ( Crypto/PubKey/RSA/PSS.hs, dist/build/Crypto/PubKey/RSA/PSS.o )
In-place registering crypto-pubkey-0.2.4...
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Cannot build crypto-pubkey with GHC 7.8.2 and profiling","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"7.8.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I configure crypto-pubkey with:\r\n\r\n{{{\r\nconfigure flags: --disable-split-objs --enable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests\r\n}}}\r\n\r\nAnd on building get:\r\n\r\n{{{\r\nBuilding crypto-pubkey-0.2.4...\r\nPreprocessing library crypto-pubkey-0.2.4...\r\n[ 1 of 15] Compiling Crypto.PubKey.ECC.Prim ( Crypto/PubKey/ECC/Prim.hs, dist/build/Crypto/PubKey/ECC/Prim.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.8.2 for x86_64-apple-darwin):\r\n\tIx{Int}.index: Index (75497475) out of range ((0,1333))\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\nRunning Haddock for crypto-pubkey-0.2.4...\r\nPreprocessing library crypto-pubkey-0.2.4...\r\nHaddock coverage:\r\nhaddock: internal error: Ix{Int}.index: Index (75497475) out of range ((0,1333))\r\n}}}\r\n\r\nIf I disable library profiling, it builds cleanly:\r\n\r\n{{{\r\nBuilding crypto-pubkey-0.2.4...\r\nPreprocessing library crypto-pubkey-0.2.4...\r\n[ 1 of 15] Compiling Crypto.PubKey.ECC.Prim ( Crypto/PubKey/ECC/Prim.hs, dist/build/Crypto/PubKey/ECC/Prim.o )\r\n[ 2 of 15] Compiling Crypto.PubKey.ECC.Generate ( Crypto/PubKey/ECC/Generate.hs, dist/build/Crypto/PubKey/ECC/Generate.o )\r\n[ 3 of 15] Compiling Crypto.PubKey.DH ( Crypto/PubKey/DH.hs, dist/build/Crypto/PubKey/DH.o )\r\n[ 4 of 15] Compiling Crypto.PubKey.HashDescr ( Crypto/PubKey/HashDescr.hs, dist/build/Crypto/PubKey/HashDescr.o )\r\n[ 5 of 15] Compiling Crypto.PubKey.MaskGenFunction ( Crypto/PubKey/MaskGenFunction.hs, dist/build/Crypto/PubKey/MaskGenFunction.o )\r\n[ 6 of 15] Compiling Crypto.PubKey.DSA ( Crypto/PubKey/DSA.hs, dist/build/Crypto/PubKey/DSA.o )\r\n[ 7 of 15] Compiling Crypto.PubKey.ECC.ECDSA ( Crypto/PubKey/ECC/ECDSA.hs, dist/build/Crypto/PubKey/ECC/ECDSA.o )\r\n[ 8 of 15] Compiling Crypto.PubKey.ElGamal ( Crypto/PubKey/ElGamal.hs, dist/build/Crypto/PubKey/ElGamal.o )\r\n[ 9 of 15] Compiling Crypto.PubKey.Internal ( Crypto/PubKey/Internal.hs, dist/build/Crypto/PubKey/Internal.o )\r\n[10 of 15] Compiling Crypto.PubKey.RSA.Types ( Crypto/PubKey/RSA/Types.hs, dist/build/Crypto/PubKey/RSA/Types.o )\r\n[11 of 15] Compiling Crypto.PubKey.RSA.Prim ( Crypto/PubKey/RSA/Prim.hs, dist/build/Crypto/PubKey/RSA/Prim.o )\r\n[12 of 15] Compiling Crypto.PubKey.RSA ( Crypto/PubKey/RSA.hs, dist/build/Crypto/PubKey/RSA.o )\r\n[13 of 15] Compiling Crypto.PubKey.RSA.PKCS15 ( Crypto/PubKey/RSA/PKCS15.hs, dist/build/Crypto/PubKey/RSA/PKCS15.o )\r\n[14 of 15] Compiling Crypto.PubKey.RSA.OAEP ( Crypto/PubKey/RSA/OAEP.hs, dist/build/Crypto/PubKey/RSA/OAEP.o )\r\n[15 of 15] Compiling Crypto.PubKey.RSA.PSS ( Crypto/PubKey/RSA/PSS.hs, dist/build/Crypto/PubKey/RSA/PSS.o )\r\nIn-place registering crypto-pubkey-0.2.4...\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1https://gitlab.haskell.org/ghc/ghc/-/issues/9092ghc: panic! (the 'impossible' happened)2019-07-07T18:41:57ZSacha Sokoloskighc: panic! (the 'impossible' happened)I'm not sure \*why\* this is happening, but I know where. The code for this library is available here: http://hub.darcs.net/alex404/hsl-random
So as is, I can run the script called multivariate and get the expected results, but when I t...I'm not sure \*why\* this is happening, but I know where. The code for this library is available here: http://hub.darcs.net/alex404/hsl-random
So as is, I can run the script called multivariate and get the expected results, but when I try to compile I get
ghc: panic! (the 'impossible' happened)
> (GHC version 7.8.2 for x86_64-unknown-linux):
attempt to prod-split usage call demand C(C1(U(U,U,U,U,U,U)))
If at line 317 in Scientific.Random.Distributions.hs, I replace the statement sgma = ... with sgma = undefined, the code will compile, though obviously it cannot be used. If I transform the code in other ways which are meant to preserve the results, I can get it to compile, but then the script hangs.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghc: panic! (the 'impossible' happened)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":["impossible","panic"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I'm not sure *why* this is happening, but I know where. The code for this library is available here: http://hub.darcs.net/alex404/hsl-random\r\n\r\nSo as is, I can run the script called multivariate and get the expected results, but when I try to compile I get \r\n\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.8.2 for x86_64-unknown-linux):\r\n\tattempt to prod-split usage call demand C(C1(U(U,U,U,U,U,U)))\r\n\r\nIf at line 317 in Scientific.Random.Distributions.hs, I replace the statement sgma = ... with sgma = undefined, the code will compile, though obviously it cannot be used. If I transform the code in other ways which are meant to preserve the results, I can get it to compile, but then the script hangs.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1https://gitlab.haskell.org/ghc/ghc/-/issues/9080GHC error on Win 8.1 64bit2019-07-07T18:42:01ZmaunGHC error on Win 8.1 64bitHi, i get the following error when building GHCJS:
```
Loading package conduit-1.1.1 ... linking ... done.
Loading package yaml-0.8.8.2 ... ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.8.2 for x86_64-unknown-mingw32):
...Hi, i get the following error when building GHCJS:
```
Loading package conduit-1.1.1 ... linking ... done.
Loading package yaml-0.8.8.2 ... ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.8.2 for x86_64-unknown-mingw32):
loadObj "C:\\Users\\Manuel\\AppData\\Roaming\\cabal\\x86_64-windows-ghc-
7.8.2\\yaml-0.8.8.2\\HSyaml-0.8.8.2.o": failed
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
ghc.exe: Unknown PEi386 section name `.text.unlikely' (while processing: C:\User
s\Manuel\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.2\yaml-0.8.8.2\HSyaml-0.8.
8.2.o)
cabal: Error: some packages failed to install:
ghcjs-0.1.0 failed during the building phase. The exception was:
ExitFailure 1
```
Also reported this for ghcjs (https://github.com/ghcjs/ghcjs/issues/170)
I am not using the haskell plattform, but the 7.8.2 binaries + MinGW and MSYS. I also tried mingw-w64 but this made no difference. I am also using the recent ghcjs cabal branch.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC error on Win 8.1 64bit","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"7.8.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Hi, i get the following error when building GHCJS:\r\n\r\n{{{\r\nLoading package conduit-1.1.1 ... linking ... done.\r\nLoading package yaml-0.8.8.2 ... ghc.exe: panic! (the 'impossible' happened)\r\n (GHC version 7.8.2 for x86_64-unknown-mingw32):\r\n loadObj \"C:\\\\Users\\\\Manuel\\\\AppData\\\\Roaming\\\\cabal\\\\x86_64-windows-ghc-\r\n7.8.2\\\\yaml-0.8.8.2\\\\HSyaml-0.8.8.2.o\": failed\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\nghc.exe: Unknown PEi386 section name `.text.unlikely' (while processing: C:\\User\r\ns\\Manuel\\AppData\\Roaming\\cabal\\x86_64-windows-ghc-7.8.2\\yaml-0.8.8.2\\HSyaml-0.8.\r\n8.2.o)\r\ncabal: Error: some packages failed to install:\r\nghcjs-0.1.0 failed during the building phase. The exception was:\r\nExitFailure 1\r\n}}}\r\n\r\nAlso reported this for ghcjs (https://github.com/ghcjs/ghcjs/issues/170)\r\n\r\nI am not using the haskell plattform, but the 7.8.2 binaries + MinGW and MSYS. I also tried mingw-w64 but this made no difference. I am also using the recent ghcjs cabal branch.","type_of_failure":"OtherFailure","blocking":[]} -->7.8.3https://gitlab.haskell.org/ghc/ghc/-/issues/9071Panic with -XDeriveFunctor when deriving from a non-Functor in a separate module2019-07-07T18:42:03ZbensPanic with -XDeriveFunctor when deriving from a non-Functor in a separate module## Mu in the same file
*src/Main.hs*
```
{-# LANGUAGE DeriveFunctor #-}
module Main where
newtype Mu f = Mu (f (Mu f))
newtype K a b = K a
newtype F a = F (Mu (K a)) deriving Functor
main :: IO ()
main = return ()
```
----
```
$ c...## Mu in the same file
*src/Main.hs*
```
{-# LANGUAGE DeriveFunctor #-}
module Main where
newtype Mu f = Mu (f (Mu f))
newtype K a b = K a
newtype F a = F (Mu (K a)) deriving Functor
main :: IO ()
main = return ()
```
----
```
$ cabal build
Building panic-0.1.0.0...
Preprocessing executable 'panic' for panic-0.1.0.0...
[1 of 1] Compiling Main ( src/Main.hs, dist/build/panic/panic-tmp/Main.o )
src/Main.hs:7:37:
No instance for (Functor Mu)
arising from the first field of ‘F’ (type ‘Mu (K a)’)
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Functor F)
```
## Mu in a separate file
*src/Mu.hs*
```
module Mu where
newtype Mu f = Mu (f (Mu f))
```
*src/Main.hs*
```
{-# LANGUAGE DeriveFunctor #-}
module Main where
import Mu
newtype K a b = K a
newtype F a = F (Mu (K a)) deriving Functor
main :: IO ()
main = return ()
```
----
```
$ cabal build
Building panic-0.1.0.0...
Preprocessing executable 'panic' for panic-0.1.0.0...
[1 of 2] Compiling Mu ( src/Mu.hs, dist/build/panic/panic-tmp/Mu.o )
[2 of 2] Compiling Main ( src/Main.hs, dist/build/panic/panic-tmp/Main.o )
src/Main.hs:8:37:ghc: panic! (the 'impossible' happened)
(GHC version 7.8.2 for x86_64-unknown-linux):
Prelude.(!!): index too large
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic with -XDeriveFunctor when deriving from a non-Functor in a separate module","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"== Mu in the same file ==\r\n\r\n''src/Main.hs''\r\n\r\n{{{\r\n{-# LANGUAGE DeriveFunctor #-}\r\n\r\nmodule Main where\r\n\r\nnewtype Mu f = Mu (f (Mu f))\r\nnewtype K a b = K a\r\nnewtype F a = F (Mu (K a)) deriving Functor\r\n\r\nmain :: IO ()\r\nmain = return ()\r\n}}}\r\n\r\n----\r\n\r\n{{{\r\n$ cabal build\r\nBuilding panic-0.1.0.0...\r\nPreprocessing executable 'panic' for panic-0.1.0.0...\r\n[1 of 1] Compiling Main ( src/Main.hs, dist/build/panic/panic-tmp/Main.o )\r\n\r\nsrc/Main.hs:7:37:\r\n No instance for (Functor Mu)\r\n arising from the first field of ‘F’ (type ‘Mu (K a)’)\r\n Possible fix:\r\n use a standalone 'deriving instance' declaration,\r\n so you can specify the instance context yourself\r\n When deriving the instance for (Functor F)\r\n}}}\r\n\r\n\r\n== Mu in a separate file ==\r\n\r\n''src/Mu.hs''\r\n{{{\r\nmodule Mu where\r\n\r\nnewtype Mu f = Mu (f (Mu f))\r\n}}}\r\n\r\n''src/Main.hs''\r\n{{{\r\n{-# LANGUAGE DeriveFunctor #-}\r\n\r\nmodule Main where\r\n\r\nimport Mu\r\n\r\nnewtype K a b = K a\r\nnewtype F a = F (Mu (K a)) deriving Functor\r\n\r\nmain :: IO ()\r\nmain = return ()\r\n}}}\r\n\r\n----\r\n\r\n{{{\r\n$ cabal build\r\nBuilding panic-0.1.0.0...\r\nPreprocessing executable 'panic' for panic-0.1.0.0...\r\n[1 of 2] Compiling Mu ( src/Mu.hs, dist/build/panic/panic-tmp/Mu.o )\r\n[2 of 2] Compiling Main ( src/Main.hs, dist/build/panic/panic-tmp/Main.o )\r\n\r\nsrc/Main.hs:8:37:ghc: panic! (the 'impossible' happened)\r\n (GHC version 7.8.2 for x86_64-unknown-linux):\r\n\tPrelude.(!!): index too large\r\n\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.8.3https://gitlab.haskell.org/ghc/ghc/-/issues/9055unregisterised build fails with: globalRegMaybe not defined for this platform2019-07-07T18:42:07ZPeter Trommlerptrommler@acm.orgunregisterised build fails with: globalRegMaybe not defined for this platformBuilding HEAD fails with:
```
make[1]: *** [rts/dist/build/Updates.o] Error 1
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 7.9.20140429 for powerpc64-unknown-linux):
globalRegMaybe not defined for this platform
...Building HEAD fails with:
```
make[1]: *** [rts/dist/build/Updates.o] Error 1
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 7.9.20140429 for powerpc64-unknown-linux):
globalRegMaybe not defined for this platform
```
on Linux powerpc64 and x86_64 (unregisterised).
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.9 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"unregisterised build fails with: globalRegMaybe not defined for this platform","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Building HEAD fails with:\r\n{{{\r\nmake[1]: *** [rts/dist/build/Updates.o] Error 1\r\nghc-stage1: panic! (the 'impossible' happened)\r\n (GHC version 7.9.20140429 for powerpc64-unknown-linux):\r\n globalRegMaybe not defined for this platform\r\n}}}\r\non Linux powerpc64 and x86_64 (unregisterised).\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1https://gitlab.haskell.org/ghc/ghc/-/issues/9050Panic when compiling cmm file together with -outputdir2019-07-07T18:42:08ZYurasPanic when compiling cmm file together with -outputdirTo reproduce:
```
$ touch test.cmm
$ ghc -c test.cmm -outputdir=build
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 7.9.20140428 for x86_64-unknown-linux):
hscCmmFile: no_mod
```
The panic is declared in `main/HscMain....To reproduce:
```
$ touch test.cmm
$ ghc -c test.cmm -outputdir=build
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 7.9.20140428 for x86_64-unknown-linux):
hscCmmFile: no_mod
```
The panic is declared in `main/HscMain.hs:hscCompileCmmFile` in place of current module name, but forced in `main/CodeOutput.lhs:outputForeignStubs` by `doesFileExist`.
It works without `-outputdir` because in that case module name is not used to create path to stub file, see `main/Finder.lhs:mkStubPaths`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic when compiling cmm file together with -outputdir","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"\r\nTo reproduce:\r\n\r\n{{{\r\n$ touch test.cmm\r\n$ ghc -c test.cmm -outputdir=build\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 7.9.20140428 for x86_64-unknown-linux):\r\n\thscCmmFile: no_mod\r\n}}}\r\n\r\nThe panic is declared in `main/HscMain.hs:hscCompileCmmFile` in place of current module name, but forced in `main/CodeOutput.lhs:outputForeignStubs` by `doesFileExist`.\r\n\r\nIt works without `-outputdir` because in that case module name is not used to create path to stub file, see `main/Finder.lhs:mkStubPaths`.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.8.3https://gitlab.haskell.org/ghc/ghc/-/issues/9036ghc: panic! Binder's type (SingI Symbol <a String>) /= RHS type (String)2019-07-07T18:42:12ZNathan Collinsghc: panic! Binder's type (SingI Symbol <a String>) /= RHS type (String)Compilation error message:
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.6.3 for i386-unknown-linux):
cgLookupPanic (probably invalid Core; try -dcore-lint)
cobox{v a212} [lid]
static binds for:
local binds f...Compilation error message:
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.6.3 for i386-unknown-linux):
cgLookupPanic (probably invalid Core; try -dcore-lint)
cobox{v a212} [lid]
static binds for:
local binds for:
main:Debug.Trace.LogTree.Test.$p1AllShow{v r1pg} [gid[ClassOp]]
main:Debug.Trace.LogTree.Test.$p2AllShow{v r1ph} [gid[ClassOp]]
main:Debug.Trace.LogTree.Test.$p3AllShow{v r1pi} [gid[ClassOp]]
main:Debug.Trace.LogTree.Test.$p4AllShow{v r1pj} [gid[ClassOp]]
main:Debug.Trace.LogTree.Test.$p5AllShow{v r1pk} [gid[ClassOp]]
main:Debug.Trace.LogTree.Test.$p6AllShow{v r1pl} [gid[ClassOp]]
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
Error in -dcore-lint:
```
[10 of 10] Compiling Debug.Trace.LogTree.Test ( src/Debug/Trace/LogTree/Test.hs, tmp/Debug/Trace/LogTree/Test.o )
*** Core Lint errors : in result of Desugar (after optimization) ***
{-# LINE 122 "src/Debug/Trace/LogTree/Test.hs #-}: Warning:
[RHS of $dSingI_a20r :: GHC.TypeLits.SingI GHC.TypeLits.Symbol "h"]
The type of this binder doesn't match the type of its RHS: $dSingI_a20r
Binder's type: GHC.TypeLits.SingI GHC.TypeLits.Symbol "h"
Rhs type: [GHC.Types.Char]
```
So, it looks like it's related to !TypeLits. The full -dcore-lint output is attached.
To reproduce:
1. git clone https://github.com/ntc2/haskell-call-trace.git
1. cd haskell-call-trace
1. git checkout break-ghc
1. \<install dependencies; see below\>
1. make
The dependencies from the .cabal file are:
```
build-depends: base >=4.6 && <4.7
, template-haskell >=2.8 && <2.9
, ghc-prim >=0.3 && <0.4
, parsec >=3.1 && <3.2
, tagged >=0.7 && <0.8
, transformers >=0.3 && <0.4
, mtl >=2.1 && <2.2
```
The problematic file is https://github.com/ntc2/haskell-call-trace/blob/break-ghc/src/Debug/Trace/LogTree/Test.hs . I was in the middle of a program-wide change when I ran into this GHC panic; I was using the type errors to guide my fixes. The Test.hs is not type correct, but I don't see how the stuff I changed as anything to do with my use of type-level strings (!TypeLits). The code in the previous commit compiles.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghc: panic! (the 'impossible' happened) (Binder's type (SingI Symbol <a String>) /= RHS type (String))","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.6.3","keywords":["GHC.TypeLits"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Compilation error message:\r\n{{{\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.6.3 for i386-unknown-linux):\r\n\tcgLookupPanic (probably invalid Core; try -dcore-lint)\r\n cobox{v a212} [lid]\r\n static binds for:\r\n local binds for:\r\n main:Debug.Trace.LogTree.Test.$p1AllShow{v r1pg} [gid[ClassOp]]\r\n main:Debug.Trace.LogTree.Test.$p2AllShow{v r1ph} [gid[ClassOp]]\r\n main:Debug.Trace.LogTree.Test.$p3AllShow{v r1pi} [gid[ClassOp]]\r\n main:Debug.Trace.LogTree.Test.$p4AllShow{v r1pj} [gid[ClassOp]]\r\n main:Debug.Trace.LogTree.Test.$p5AllShow{v r1pk} [gid[ClassOp]]\r\n main:Debug.Trace.LogTree.Test.$p6AllShow{v r1pl} [gid[ClassOp]]\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\nError in -dcore-lint:\r\n{{{\r\n[10 of 10] Compiling Debug.Trace.LogTree.Test ( src/Debug/Trace/LogTree/Test.hs, tmp/Debug/Trace/LogTree/Test.o )\r\n*** Core Lint errors : in result of Desugar (after optimization) ***\r\n{-# LINE 122 \"src/Debug/Trace/LogTree/Test.hs #-}: Warning:\r\n [RHS of $dSingI_a20r :: GHC.TypeLits.SingI GHC.TypeLits.Symbol \"h\"]\r\n The type of this binder doesn't match the type of its RHS: $dSingI_a20r\r\n Binder's type: GHC.TypeLits.SingI GHC.TypeLits.Symbol \"h\"\r\n Rhs type: [GHC.Types.Char]\r\n}}}\r\n\r\nSo, it looks like it's related to !TypeLits. The full -dcore-lint output is attached.\r\n\r\nTo reproduce:\r\n1. git clone https://github.com/ntc2/haskell-call-trace.git\r\n2. cd haskell-call-trace\r\n3. git checkout break-ghc\r\n3. <install dependencies; see below>\r\n4. make\r\n\r\nThe dependencies from the .cabal file are:\r\n{{{\r\n build-depends: base >=4.6 && <4.7\r\n , template-haskell >=2.8 && <2.9\r\n , ghc-prim >=0.3 && <0.4\r\n , parsec >=3.1 && <3.2\r\n , tagged >=0.7 && <0.8\r\n , transformers >=0.3 && <0.4\r\n , mtl >=2.1 && <2.2\r\n}}}\r\n\r\nThe problematic file is https://github.com/ntc2/haskell-call-trace/blob/break-ghc/src/Debug/Trace/LogTree/Test.hs . I was in the middle of a program-wide change when I ran into this GHC panic; I was using the type errors to guide my fixes. The Test.hs is not type correct, but I don't see how the stuff I changed as anything to do with my use of type-level strings (!TypeLits). The code in the previous commit compiles.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/9032Panic with self-import2019-07-07T18:42:13ZJan Stolarekjan.stolarek@ed.ac.ukPanic with self-importA test in the `singletons` package leads to a panic when run:
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.2 for x86_64-unknown-linux):
tcIfaceGlobal (local): not found:
singletons-1.0:Singletons.Star.TFCo:...A test in the `singletons` package leads to a panic when run:
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.2 for x86_64-unknown-linux):
tcIfaceGlobal (local): not found:
singletons-1.0:Singletons.Star.TFCo:R:DemoteRep*KProxy{tc r0}
[]
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
Edit: see [ticket:9032\#comment:83149](https://gitlab.haskell.org//ghc/ghc/issues/9032#note_83149) for a testcase.7.10.1https://gitlab.haskell.org/ghc/ghc/-/issues/9031ghc panic: RegAlloc.Liveness.computeLivenss2019-07-07T18:42:13Zjwlatoghc panic: RegAlloc.Liveness.computeLivenssI have some code where ghc consistently panics with
```
RegAlloc.Liveness.computeLivenss
SCCs aren't in reverse dependent order
bad blockId c1kek
```
The only reference I can find to that block in the dumped output is here:
...I have some code where ghc consistently panics with
```
RegAlloc.Liveness.computeLivenss
SCCs aren't in reverse dependent order
bad blockId c1kek
```
The only reference I can find to that block in the dumped output is here:
```
REC
c1kej:
movq $block{v c1keo}_info,(%rbp)
movsd 7(%rbx),%vSSE_s1ivM
movsd 15(%rbx),%vSSE_s1ivN
movq 96(%rbp),%rbx
movsd %vSSE_s1ivN,88(%rbp)
movsd %vSSE_s1ivM,96(%rbp)
testq $7,%rbx
jne _c1keo
jmp _c1kep
c1kpo:
movq $block{v c1kej}_info,(%rbp)
movq %vI_s1it5,%rbx
movq $0,120(%rbp)
testq $7,%rbx
jne _c1kej
jmp _c1kek,
```
There doesn't appear to be any reference to `c1kpo` either.
Unfortunately I don't yet have a test case I can provide; I'll keep working on that. Building with -dcore-lint and -dcmm-lint don't show any extra errors.
This is with ghc-7.8.2 using NCG.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghc panic: RegAlloc.Liveness.computeLivenss","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I have some code where ghc consistently panics with\r\n\r\n{{{\r\n RegAlloc.Liveness.computeLivenss\r\n SCCs aren't in reverse dependent order\r\n bad blockId c1kek\r\n}}}\r\n\r\nThe only reference I can find to that block in the dumped output is here:\r\n\r\n{{{\r\n REC\r\n c1kej:\r\n movq $block{v c1keo}_info,(%rbp)\r\n movsd 7(%rbx),%vSSE_s1ivM\r\n movsd 15(%rbx),%vSSE_s1ivN\r\n movq 96(%rbp),%rbx\r\n movsd %vSSE_s1ivN,88(%rbp)\r\n movsd %vSSE_s1ivM,96(%rbp)\r\n testq $7,%rbx\r\n jne _c1keo\r\n jmp _c1kep\r\n c1kpo:\r\n movq $block{v c1kej}_info,(%rbp)\r\n movq %vI_s1it5,%rbx\r\n movq $0,120(%rbp)\r\n testq $7,%rbx\r\n jne _c1kej\r\n jmp _c1kek,\r\n}}}\r\n\r\nThere doesn't appear to be any reference to {{{c1kpo}}} either.\r\n\r\nUnfortunately I don't yet have a test case I can provide; I'll keep working on that. Building with -dcore-lint and -dcmm-lint don't show any extra errors.\r\n\r\nThis is with ghc-7.8.2 using NCG.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/8987TH: panic in reportWarning when the message throws an exception2019-07-07T18:42:25ZYurasTH: panic in reportWarning when the message throws an exception`reportWarning` and `reportError` doesn't force it's argument, so `ghc` panics when printing the message.
To reproduce:
```haskell
test :: Q [Dec]
test = do
reportWarning undefined
return []
```
Output:
```
main.hs:5:3: Warning:g...`reportWarning` and `reportError` doesn't force it's argument, so `ghc` panics when printing the message.
To reproduce:
```haskell
test :: Q [Dec]
test = do
reportWarning undefined
return []
```
Output:
```
main.hs:5:3: Warning:ghc: panic! (the 'impossible' happened)
(GHC version 7.8.1 for x86_64-unknown-linux):
Prelude.undefined
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
The fix could be:
```
--- a/compiler/typecheck/TcSplice.lhs
+++ b/compiler/typecheck/TcSplice.lhs
@@ -875,8 +875,8 @@ instance TH.Quasi (IOEnv (Env TcGblEnv TcLclEnv)) where
; let i = getKey u
; return (TH.mkNameU s i) }
- qReport True msg = addErr (text msg)
- qReport False msg = addWarn (text msg)
+ qReport True !msg = addErr (text msg)
+ qReport False !msg = addWarn (text msg)
qLocation = do { m <- getModule
; l <- getSrcSpanM
```
But possibly it should `deepseq` the argument?
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"TH: panic in reportWarning when the message throws an exception","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"\r\n`reportWarning` and `reportError` doesn't force it's argument, so `ghc` panics when printing the message.\r\n\r\nTo reproduce:\r\n\r\n{{{#!haskell\r\ntest :: Q [Dec]\r\ntest = do\r\n reportWarning undefined\r\n return []\r\n}}}\r\n\r\nOutput:\r\n{{{\r\nmain.hs:5:3: Warning:ghc: panic! (the 'impossible' happened)\r\n (GHC version 7.8.1 for x86_64-unknown-linux):\r\n\tPrelude.undefined\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\nThe fix could be:\r\n{{{\r\n--- a/compiler/typecheck/TcSplice.lhs\r\n+++ b/compiler/typecheck/TcSplice.lhs\r\n@@ -875,8 +875,8 @@ instance TH.Quasi (IOEnv (Env TcGblEnv TcLclEnv)) where\r\n ; let i = getKey u\r\n ; return (TH.mkNameU s i) }\r\n \r\n- qReport True msg = addErr (text msg)\r\n- qReport False msg = addWarn (text msg)\r\n+ qReport True !msg = addErr (text msg)\r\n+ qReport False !msg = addWarn (text msg)\r\n \r\n qLocation = do { m <- getModule\r\n ; l <- getSrcSpanM\r\n}}}\r\n\r\nBut possibly it should `deepseq` the argument?\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/8964split_marker_entry assert breaks -split-objs and -ddump-opt-cmm2019-07-07T18:42:31ZEdward Z. Yangsplit_marker_entry assert breaks -split-objs and -ddump-opt-cmm1. ..since the pretty-printer attempts to force the blocks list of the split_marker_entry proc. I'm not really sure what the right way to fix this is: just provide an empty block list, or hack the pretty-printer to treat split markers sp...1. ..since the pretty-printer attempts to force the blocks list of the split_marker_entry proc. I'm not really sure what the right way to fix this is: just provide an empty block list, or hack the pretty-printer to treat split markers specially. But should be easy to fix.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.9 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | lowest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"split_marker_entry assert breaks -split-objs and -ddump-opt-cmm","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"⊥","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.9","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"...since the pretty-printer attempts to force the blocks list of the split_marker_entry proc. I'm not really sure what the right way to fix this is: just provide an empty block list, or hack the pretty-printer to treat split markers specially. But should be easy to fix.","type_of_failure":"OtherFailure","blocking":[]} -->8.10.1https://gitlab.haskell.org/ghc/ghc/-/issues/8960SpecConstr usage explodes beyond 4GB with GHC 7.8.1 rc 22019-07-07T18:42:32ZMichalGajdaSpecConstr usage explodes beyond 4GB with GHC 7.8.1 rc 2GHC 7.8 rc2 exhausts all memory on `Bio.PDB.EventParser.PDBEventParser` module in -O3 mode, but not in -O2 mode.
The tail of *-v3* input seems to indicate that it dies during SpecConstr phase. The module successfully compiled with below...GHC 7.8 rc2 exhausts all memory on `Bio.PDB.EventParser.PDBEventParser` module in -O3 mode, but not in -O2 mode.
The tail of *-v3* input seems to indicate that it dies during SpecConstr phase. The module successfully compiled with below 2GB RAM since GHC 6.12, so I wonder why the memory use exploded with the most recent version.
- \*\* SpecConstr:
#################### SpecConstr
Result size of SpecConstr
STEPS TO REPRODUCE:
1. `cabal install hPDB`
RESULT EXPECTED:
Successful compilation and installation
CURRENT RESULT:
Exhausts available memory and crashes when compiling `Bio.PDB.EventParser.PDBEventParser`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.1-rc2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"SpecConstr usage explodes beyond 4GB with GHC 7.8.1 rc 2","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"7.8.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.1-rc2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"GHC 7.8 rc2 exhausts all memory on `Bio.PDB.EventParser.PDBEventParser` module in -O3 mode, but not in -O2 mode.\r\n\r\nThe tail of ''-v3'' input seems to indicate that it dies during SpecConstr phase. The module successfully compiled with below 2GB RAM since GHC 6.12, so I wonder why the memory use exploded with the most recent version.\r\n\r\n*** SpecConstr:\r\n\r\n==================== SpecConstr ====================\r\nResult size of SpecConstr\r\n\r\nSTEPS TO REPRODUCE:\r\n1. `cabal install hPDB`\r\n\r\nRESULT EXPECTED:\r\nSuccessful compilation and installation\r\n\r\nCURRENT RESULT:\r\nExhausts available memory and crashes when compiling `Bio.PDB.EventParser.PDBEventParser`.","type_of_failure":"OtherFailure","blocking":[]} -->7.8.4https://gitlab.haskell.org/ghc/ghc/-/issues/8932Panic with TemplateHaskell and duplicate indentifiers2019-07-07T18:42:45ZJan Stolarekjan.stolarek@ed.ac.ukPanic with TemplateHaskell and duplicate indentifiersThis code causes GHC panic under 7.8.1-RC2:
```
{-# LANGUAGE TemplateHaskell #-}
module TXXXX where
$([d|
foo :: a -> a
foo x = x
|])
foo :: a
foo = undefined
```
```
[killy@xerxes : /dane/projekty/sandbox/haskell] ghc -fforce-...This code causes GHC panic under 7.8.1-RC2:
```
{-# LANGUAGE TemplateHaskell #-}
module TXXXX where
$([d|
foo :: a -> a
foo x = x
|])
foo :: a
foo = undefined
```
```
[killy@xerxes : /dane/projekty/sandbox/haskell] ghc -fforce-recomp TXXXX.hs
[1 of 1] Compiling TXXXX ( TXXXX.hs, TXXXX.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package containers-0.5.4.0 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.0.20140226 for x86_64-unknown-linux):
lookupExactOcc
foo_a2kL{v}
[main:TXXXX.foo{v a2kL} defined at TXXXX.hs:11:1,
main:TXXXX.foo{v a2kL} defined at TXXXX.hs:5:3]
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 7.8.1-rc2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Template Haskell |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic with TemplateHaskell and duplicate indentifiers","status":"New","operating_system":"","component":"Template Haskell","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.1-rc2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This code causes GHC panic under 7.8.1-RC2:\r\n\r\n{{{\r\n{-# LANGUAGE TemplateHaskell #-}\r\n\r\nmodule TXXXX where\r\n\r\n$([d|\r\n foo :: a -> a\r\n foo x = x\r\n |])\r\n\r\nfoo :: a\r\nfoo = undefined\r\n}}}\r\n\r\n{{{\r\n[killy@xerxes : /dane/projekty/sandbox/haskell] ghc -fforce-recomp TXXXX.hs\r\n[1 of 1] Compiling TXXXX ( TXXXX.hs, TXXXX.o )\r\nLoading package ghc-prim ... linking ... done.\r\nLoading package integer-gmp ... linking ... done.\r\nLoading package base ... linking ... done.\r\nLoading package array-0.5.0.0 ... linking ... done.\r\nLoading package deepseq-1.3.0.2 ... linking ... done.\r\nLoading package containers-0.5.4.0 ... linking ... done.\r\nLoading package pretty-1.1.1.1 ... linking ... done.\r\nLoading package template-haskell ... linking ... done.\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.8.0.20140226 for x86_64-unknown-linux):\r\n lookupExactOcc\r\n foo_a2kL{v}\r\n [main:TXXXX.foo{v a2kL} defined at TXXXX.hs:11:1,\r\n main:TXXXX.foo{v a2kL} defined at TXXXX.hs:5:3]\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.8.3https://gitlab.haskell.org/ghc/ghc/-/issues/8921ghc-stage2 fails with ld: fatal: library -lrt: not found on topHandler02(prof...2019-07-07T18:42:48ZAlainODeaghc-stage2 fails with ld: fatal: library -lrt: not found on topHandler02(profthreaded) testOn SmartOS ghc-stage2 crashes with an error when trying to run the topHandler02(dyn) test:
ld: fatal: library -lrt: not found
Tracing this with the following DTrace script to stop ghc-stage2 at the point of launching ld:
**\~/exit_on_l...On SmartOS ghc-stage2 crashes with an error when trying to run the topHandler02(dyn) test:
ld: fatal: library -lrt: not found
Tracing this with the following DTrace script to stop ghc-stage2 at the point of launching ld:
**\~/exit_on_ld.d**:
{{{
\#!/usr/sbin/dtrace -s
\#pragma D option destructive
syscall::exec\*:entry
/copyinstr(arg0) == "/usr/bin/ld"/
{
trace(pid);
stop();
system("pargs %d", pid);
> exit(0);
}
}}}
This let me observe the command-line arguments to ld:
In ssh session A I started DTrace:
```
chmod +x ~/exit_on_ld.d
~/exit_on_ld.d
```
In a ssh session B I started the topHandler02(dyn) test manually with no output redirection:
```
cd ~/ghc/libraries/base/tests && '/root/ghc/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -o topHandler02 topHandler02.hs -O -prof -static -auto-all -threaded
```
In ssh session A I observed the ld call (ghc-stage2 is now frozen by stop):
```
CPU ID FUNCTION:NAME
3 5167 exece:entry 9186691866: /opt/local/gcc47/libexec/gcc/x86_64-sun-solaris2.11/4.7.3/collect2 -R/opt/local
argv[0]: /opt/local/gcc47/libexec/gcc/x86_64-sun-solaris2.11/4.7.3/collect2
argv[1]: -R/opt/local/lib/
argv[2]: -Y
argv[3]: P,/lib/amd64:/usr/lib/amd64:/opt/local/lib/
argv[4]: -Qy
argv[5]: -o
argv[6]: topHandler02.o
argv[7]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3
argv[8]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib/amd64
argv[9]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../amd64
argv[10]: -L/lib/amd64
argv[11]: -L/usr/lib/amd64
argv[12]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib
argv[13]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../..
argv[14]: -R/opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64
argv[15]: -R/opt/local/gcc47/lib/amd64
argv[16]: -lrt
argv[17]: -r
argv[18]: /tmp/ghc91814_0/ghc91814_6.o
argv[19]: /tmp/ghc91814_0/ghc91814_5.o
```
I was then able to run them in isolation with GHC's temp files present on disk:
```
# /opt/local/gcc47/libexec/gcc/x86_64-sun-solaris2.11/4.7.3/collect2 -R/opt/local/lib/ -Y P,/lib/amd64:/usr/lib/amd64:/opt/local/lib/ -Qy -o topHandler02.o -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib/amd64 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../amd64 -L/lib/amd64 -L/usr/lib/amd64 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../.. -R/opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64 -R/opt/local/gcc47/lib/amd64 -lrt -r /tmp/ghc91814_0/ghc91814_6.o /tmp/ghc91814_0/ghc91814_5.o
ld: fatal: library -lrt: not found
ld: fatal: file processing errors. No output written to topHandler02.o
collect2: error: ld returned 1 exit status
```
If I omit **-lrt** from the arguments it succeeds (on Illumos-based systems, including SmartOS, librt is a passthrough to libc):
```
# /opt/local/gcc47/libexec/gcc/x86_64-sun-solaris2.11/4.7.3/collect2 -R/opt/local/lib/ -Y P,/lib/amd64:/usr/lib/amd64:/opt/local/lib/ -Qy -o topHandler02.o -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib/amd64 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../amd64 -L/lib/amd64 -L/usr/lib/amd64 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../.. -R/opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64 -R/opt/local/gcc47/lib/amd64 -r /tmp/ghc91814_0/ghc91814_6.o /tmp/ghc91814_0/ghc91814_5.o
# echo $?
0
```
No errors are emitted and the exit code is 0 (good).
I would like to conditionally omit **-lrt** from the ld arguments.
Where do I need to look for where ghc-stage2 populates the arguments to ld?
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.1-rc2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghc-stage2 fails with ld: fatal: library -lrt: not found on topHandler02(dyn) test","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.1-rc2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"On SmartOS ghc-stage2 crashes with an error when trying to run the topHandler02(dyn) test:\r\nld: fatal: library -lrt: not found\r\n\r\nTracing this with the following DTrace script to stop ghc-stage2 at the point of launching ld:\r\n\r\n'''~/exit_on_ld.d''':\r\n{{{\r\n#!/usr/sbin/dtrace -s\r\n\r\n#pragma D option destructive\r\n\r\nsyscall::exec*:entry\r\n/copyinstr(arg0) == \"/usr/bin/ld\"/\r\n{\r\n trace(pid);\r\n stop(); \r\n system(\"pargs %d\", pid);\r\n exit(0);\r\n}\r\n}}}\r\n\r\nThis let me observe the command-line arguments to ld:\r\n\r\nIn ssh session A I started DTrace:\r\n\r\n{{{\r\nchmod +x ~/exit_on_ld.d\r\n~/exit_on_ld.d\r\n}}}\r\n\r\nIn a ssh session B I started the topHandler02(dyn) test manually with no output redirection:\r\n\r\n{{{\r\ncd ~/ghc/libraries/base/tests && '/root/ghc/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -o topHandler02 topHandler02.hs -O -prof -static -auto-all -threaded\r\n}}}\r\n\r\nIn ssh session A I observed the ld call (ghc-stage2 is now frozen by stop):\r\n{{{\r\nCPU ID FUNCTION:NAME\r\n 3 5167 exece:entry 9186691866: /opt/local/gcc47/libexec/gcc/x86_64-sun-solaris2.11/4.7.3/collect2 -R/opt/local\r\nargv[0]: /opt/local/gcc47/libexec/gcc/x86_64-sun-solaris2.11/4.7.3/collect2\r\nargv[1]: -R/opt/local/lib/\r\nargv[2]: -Y\r\nargv[3]: P,/lib/amd64:/usr/lib/amd64:/opt/local/lib/\r\nargv[4]: -Qy\r\nargv[5]: -o\r\nargv[6]: topHandler02.o\r\nargv[7]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3\r\nargv[8]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib/amd64\r\nargv[9]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../amd64\r\nargv[10]: -L/lib/amd64\r\nargv[11]: -L/usr/lib/amd64\r\nargv[12]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib\r\nargv[13]: -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../..\r\nargv[14]: -R/opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64\r\nargv[15]: -R/opt/local/gcc47/lib/amd64\r\nargv[16]: -lrt\r\nargv[17]: -r\r\nargv[18]: /tmp/ghc91814_0/ghc91814_6.o\r\nargv[19]: /tmp/ghc91814_0/ghc91814_5.o\r\n}}}\r\n\r\nI was then able to run them in isolation with GHC's temp files present on disk:\r\n\r\n{{{\r\n# /opt/local/gcc47/libexec/gcc/x86_64-sun-solaris2.11/4.7.3/collect2 -R/opt/local/lib/ -Y P,/lib/amd64:/usr/lib/amd64:/opt/local/lib/ -Qy -o topHandler02.o -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib/amd64 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../amd64 -L/lib/amd64 -L/usr/lib/amd64 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../.. -R/opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64 -R/opt/local/gcc47/lib/amd64 -lrt -r /tmp/ghc91814_0/ghc91814_6.o /tmp/ghc91814_0/ghc91814_5.o\r\nld: fatal: library -lrt: not found\r\nld: fatal: file processing errors. No output written to topHandler02.o\r\ncollect2: error: ld returned 1 exit status\r\n}}}\r\n\r\nIf I omit '''-lrt''' from the arguments it succeeds (on Illumos-based systems, including SmartOS, librt is a passthrough to libc):\r\n\r\n{{{\r\n# /opt/local/gcc47/libexec/gcc/x86_64-sun-solaris2.11/4.7.3/collect2 -R/opt/local/lib/ -Y P,/lib/amd64:/usr/lib/amd64:/opt/local/lib/ -Qy -o topHandler02.o -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib/amd64 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../amd64 -L/lib/amd64 -L/usr/lib/amd64 -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../../../x86_64-sun-solaris2.11/lib -L/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.3/../../.. -R/opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64 -R/opt/local/gcc47/lib/amd64 -r /tmp/ghc91814_0/ghc91814_6.o /tmp/ghc91814_0/ghc91814_5.o\r\n# echo $?\r\n0\r\n}}}\r\n\r\nNo errors are emitted and the exit code is 0 (good).\r\n\r\nI would like to conditionally omit '''-lrt''' from the ld arguments.\r\n\r\nWhere do I need to look for where ghc-stage2 populates the arguments to ld?","type_of_failure":"OtherFailure","blocking":[]} -->AlainODeaAlainODeahttps://gitlab.haskell.org/ghc/ghc/-/issues/8911Panic on incorrect record declaration2019-07-07T18:42:50ZguestPanic on incorrect record declaration```
$ echo 'data X = X { x :: { x :: Int } }' >test.hs; ghc test.hs
[1 of 1] Compiling Main ( test.hs, test.o )
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.6.3 for i386-unknown-mingw32):
tc_hs_type: r...```
$ echo 'data X = X { x :: { x :: Int } }' >test.hs; ghc test.hs
[1 of 1] Compiling Main ( test.hs, test.o )
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.6.3 for i386-unknown-mingw32):
tc_hs_type: record
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic on incorrect record declaration","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.6.3","keywords":["record"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"\r\n{{{\r\n$ echo 'data X = X { x :: { x :: Int } }' >test.hs; ghc test.hs\r\n[1 of 1] Compiling Main ( test.hs, test.o )\r\nghc.exe: panic! (the 'impossible' happened)\r\n (GHC version 7.6.3 for i386-unknown-mingw32):\r\n tc_hs_type: record\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/8893-XPolyKinds causes "*** Exception: Prelude.(!!): index too large"2019-07-07T18:42:55Zghorn-XPolyKinds causes "*** Exception: Prelude.(!!): index too large"The following program will compile fine:
```
{-# OPTIONS_GHC -Wall #-}
{-# Language DeriveFunctor #-}
--{-# Language PolyKinds #-}
module Bug where
data V a = V [a] deriving Functor
data C x a = C (V (P x a)) deriving Functor
data P...The following program will compile fine:
```
{-# OPTIONS_GHC -Wall #-}
{-# Language DeriveFunctor #-}
--{-# Language PolyKinds #-}
module Bug where
data V a = V [a] deriving Functor
data C x a = C (V (P x a)) deriving Functor
data P x a = P (x a) deriving Functor
```
But when PolyKinds is enabled, GHC crashes with
```
$ ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:9:37:ghc: panic! (the 'impossible' happened)
(GHC version 7.8.0.20140228 for x86_64-unknown-linux):
Prelude.(!!): index too large
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.1-rc2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"-XPolyKinds causes \"*** Exception: Prelude.(!!): index too large\"","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.1-rc2","keywords":["PolyKinds"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program will compile fine:\r\n{{{\r\n{-# OPTIONS_GHC -Wall #-}\r\n{-# Language DeriveFunctor #-}\r\n--{-# Language PolyKinds #-}\r\n\r\nmodule Bug where\r\n\r\ndata V a = V [a] deriving Functor\r\n\r\ndata C x a = C (V (P x a)) deriving Functor\r\n\r\ndata P x a = P (x a) deriving Functor\r\n}}}\r\n\r\nBut when PolyKinds is enabled, GHC crashes with\r\n\r\n{{{\r\n$ ghc Bug.hs \r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:9:37:ghc: panic! (the 'impossible' happened)\r\n (GHC version 7.8.0.20140228 for x86_64-unknown-linux):\r\n\tPrelude.(!!): index too large\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/8892Ghc panics (variable not found)2019-07-07T18:42:55ZjwlatoGhc panics (variable not found)When attempting to compile a module with ghc-7.8-RC2, using the flags `--ghc-options=-j8 -O2 -Werror`, I encountered this error:
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.0.20140228 for x86_64-unknown-linux):
...When attempting to compile a module with ghc-7.8-RC2, using the flags `--ghc-options=-j8 -O2 -Werror`, I encountered this error:
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.0.20140228 for x86_64-unknown-linux):
StgCmmEnv: variable not found
foldlM'_loop{v i1iSV} [lid]
local binds for:
```
followed by about 1100 bindings (none of are the binding in question). Omitting the `-j` flag makes no difference. Building `-O0` succeeds.
I don't have a standalone test case, and it's not clear to me how to make one as I have no idea what's causing this. I'll try to narrow it down, but if anyone could suggest some flags to twiddle or some other factor to adjust I'd appreciate it. I'm suspecting that it's a function referenced from inlining something vector-related.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.1-rc2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Ghc panics (variable not found)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.1-rc2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"When attempting to compile a module with ghc-7.8-RC2, using the flags `--ghc-options=-j8 -O2 -Werror`, I encountered this error:\r\n\r\n{{{\r\n ghc: panic! (the 'impossible' happened)\r\n (GHC version 7.8.0.20140228 for x86_64-unknown-linux):\r\n StgCmmEnv: variable not found\r\n foldlM'_loop{v i1iSV} [lid]\r\n local binds for:\r\n}}}\r\n\r\nfollowed by about 1100 bindings (none of are the binding in question). Omitting the `-j` flag makes no difference. Building `-O0` succeeds.\r\n\r\nI don't have a standalone test case, and it's not clear to me how to make one as I have no idea what's causing this. I'll try to narrow it down, but if anyone could suggest some flags to twiddle or some other factor to adjust I'd appreciate it. I'm suspecting that it's a function referenced from inlining something vector-related.","type_of_failure":"OtherFailure","blocking":[]} -->7.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/8890segfault on Windows 7 i3862019-07-07T18:42:56Zganeshsegfault on Windows 7 i386This minimal example causes the GHC 7.8.1 i386 RC1 and RC2 binaries to segafult on two different Window 7 machines. It doesn't happen with the x86_64 binaries and it doesn't happen on the one Windows 8.1 machine I tried.
```
{-# LANGUAG...This minimal example causes the GHC 7.8.1 i386 RC1 and RC2 binaries to segafult on two different Window 7 machines. It doesn't happen with the x86_64 binaries and it doesn't happen on the one Windows 8.1 machine I tried.
```
{-# LANGUAGE GADTs #-}
module Test1 where
data T t where
T :: T ()
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.1-rc2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"segfault on Windows 7 i386","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.1-rc2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This minimal example causes the GHC 7.8.1 i386 RC1 and RC2 binaries to segafult on two different Window 7 machines. It doesn't happen with the x86_64 binaries and it doesn't happen on the one Windows 8.1 machine I tried.\r\n\r\n{{{\r\n{-# LANGUAGE GADTs #-}\r\n\r\nmodule Test1 where\r\n\r\ndata T t where\r\n T :: T ()\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->