GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:04:06Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/15567security of package environment files2019-07-07T18:04:06Zjoeyhesssecurity of package environment filesghc will read package environment files owned by other users than the current user, in directories below the current directory. So using ghc in shared directories like /tmp is now a security concern.
```
joey@darkstar:/tmp/test/sub>ls -...ghc will read package environment files owned by other users than the current user, in directories below the current directory. So using ghc in shared directories like /tmp is now a security concern.
```
joey@darkstar:/tmp/test/sub>ls -l ../../.ghc.environment.x86_64-linux-8.2.2
-rw-r--r-- 1 mail mail 9 Aug 25 15:03 ../../.ghc.environment.x86_64-linux-8.2.2
joey@darkstar:/tmp/test/sub>cat ../../.ghc.environment.x86_64-linux-8.2.2
outdated
joey@darkstar:/tmp/test/sub>ghc --make foo
<command line>: cannot satisfy -package-id outdated
(use -v for more information)
```
I suppose this could at least be used to trick ghc into building against an older version of some package that was updated with a security fix. It might be possible to exploit in other ways, perhaps by pointing to a backdoored build of a package?8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15502-ddump-splices truncates Integer literals to Int literals2019-07-14T05:09:54ZChaiTRex-ddump-splices truncates Integer literals to Int literalsI trusted that the splice results shown by `-ddump-splices` were correct. They weren't, which caused me to waste a lot of time debugging my Template Haskell expressions when they were already correct.
```
$ ghc --version
The Glorious Gl...I trusted that the splice results shown by `-ddump-splices` were correct. They weren't, which caused me to waste a lot of time debugging my Template Haskell expressions when they were already correct.
```
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.4.3
```
## Example program
```hs
{-# OPTIONS_GHC -ddump-splices #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Language.Haskell.TH.Syntax (Lift(lift))
main = print ( $( lift (toInteger (maxBound :: Int) + 1) )
, $( lift (minBound :: Int) )
)
```
## Output of `runghc`
Note that the output of the program on the bottom line below is correct. The two splice results shown by `-ddump-splices` incorrectly match each other:
```
Example.hs:8:19-56: Splicing expression
lift (toInteger (maxBound :: Int) + 1) ======> -9223372036854775808
Example.hs:9:19-40: Splicing expression
lift (minBound :: Int) ======> (-9223372036854775808)
(9223372036854775808,-9223372036854775808)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.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":"-ddump-splices truncates Integer literals to Int literals","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I trusted that the splice results shown by `-ddump-splices` were correct. They weren't, which caused me to waste a lot of time debugging my Template Haskell expressions when they were already correct.\r\n\r\n{{{\r\n$ ghc --version\r\nThe Glorious Glasgow Haskell Compilation System, version 8.4.3\r\n}}}\r\n\r\n== Example program ==\r\n\r\n{{{#!hs\r\n{-# OPTIONS_GHC -ddump-splices #-}\r\n{-# LANGUAGE TemplateHaskell #-}\r\n\r\nmodule Main where\r\n\r\nimport Language.Haskell.TH.Syntax (Lift(lift))\r\n\r\nmain = print ( $( lift (toInteger (maxBound :: Int) + 1) )\r\n , $( lift (minBound :: Int) )\r\n )\r\n}}}\r\n\r\n== Output of `runghc` ==\r\n\r\nNote that the output of the program on the bottom line below is correct. The two splice results shown by `-ddump-splices` incorrectly match each other:\r\n\r\n{{{\r\nExample.hs:8:19-56: Splicing expression\r\n lift (toInteger (maxBound :: Int) + 1) ======> -9223372036854775808\r\nExample.hs:9:19-40: Splicing expression\r\n lift (minBound :: Int) ======> (-9223372036854775808)\r\n(9223372036854775808,-9223372036854775808)\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15428Oversaturated type family application panicks GHC (piResultTys2)2019-07-07T18:04:56ZRyan ScottOversaturated type family application panicks GHC (piResultTys2)The following program panics when compiled with GHC 8.6.1 or HEAD:
```hs
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
im...The following program panics when compiled with GHC 8.6.1 or HEAD:
```hs
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Proxy
import Data.Type.Equality
type family Flurmp :: k
type family Pure (x :: a) :: f a
wat :: forall (f :: Type -> Type) (p :: Type).
Proxy (f p) -> ()
wat _ =
let s :: (Flurmp :: f p)
:~: Pure (Flurmp :: p -> p) (Flurmp :: p)
s = undefined
in ()
```
```
$ /opt/ghc/8.6.1/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.0.20180714 for x86_64-unknown-linux):
piResultTys2
f_aAT a_aAU
[(->) p_a1uI[sk:1], p_a1uI[sk:1] -> p_a1uI[sk:1], Flurmp, Flurmp]
[Flurmp]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:1041:9 in ghc:Type
```
On GHC 8.4 and earlier, this simply gives an error message:
```
$ /opt/ghc/8.4.3/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:18:16: error:
• Expecting one more argument to ‘Pure (Flurmp :: p -> p)’
Expected kind ‘p -> f p’,
but ‘Pure (Flurmp :: p -> p)’ has kind ‘p -> p -> p’
• In the second argument of ‘(:~:)’, namely
‘Pure (Flurmp :: p -> p) (Flurmp :: p)’
In the type signature:
s :: (Flurmp :: f p) :~: Pure (Flurmp :: p -> p) (Flurmp :: p)
In the expression:
let
s :: (Flurmp :: f p) :~: Pure (Flurmp :: p -> p) (Flurmp :: p)
s = undefined
in ()
• Relevant bindings include
wat :: Proxy (f p) -> () (bound at Bug.hs:16:1)
|
18 | :~: Pure (Flurmp :: p -> p) (Flurmp :: p)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC 8.6+ panics (piResultTys2), older GHCs don't","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypeFamilies","TypeInType,"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program panics when compiled with GHC 8.6.1 or HEAD:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\nimport Data.Proxy\r\nimport Data.Type.Equality\r\n\r\ntype family Flurmp :: k\r\ntype family Pure (x :: a) :: f a\r\n\r\nwat :: forall (f :: Type -> Type) (p :: Type).\r\n Proxy (f p) -> ()\r\nwat _ =\r\n let s :: (Flurmp :: f p)\r\n :~: Pure (Flurmp :: p -> p) (Flurmp :: p)\r\n s = undefined\r\n in ()\r\n}}}\r\n{{{\r\n$ /opt/ghc/8.6.1/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.6.0.20180714 for x86_64-unknown-linux):\r\n piResultTys2\r\n f_aAT a_aAU\r\n [(->) p_a1uI[sk:1], p_a1uI[sk:1] -> p_a1uI[sk:1], Flurmp, Flurmp]\r\n [Flurmp]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Type.hs:1041:9 in ghc:Type\r\n}}}\r\n\r\nOn GHC 8.4 and earlier, this simply gives an error message:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.3/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:18:16: error:\r\n • Expecting one more argument to ‘Pure (Flurmp :: p -> p)’\r\n Expected kind ‘p -> f p’,\r\n but ‘Pure (Flurmp :: p -> p)’ has kind ‘p -> p -> p’\r\n • In the second argument of ‘(:~:)’, namely\r\n ‘Pure (Flurmp :: p -> p) (Flurmp :: p)’\r\n In the type signature:\r\n s :: (Flurmp :: f p) :~: Pure (Flurmp :: p -> p) (Flurmp :: p)\r\n In the expression:\r\n let\r\n s :: (Flurmp :: f p) :~: Pure (Flurmp :: p -> p) (Flurmp :: p)\r\n s = undefined\r\n in ()\r\n • Relevant bindings include\r\n wat :: Proxy (f p) -> () (bound at Bug.hs:16:1)\r\n |\r\n18 | :~: Pure (Flurmp :: p -> p) (Flurmp :: p)\r\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15380Infinite typechecker loop in GHC 8.62019-07-07T18:12:54ZRyan ScottInfinite typechecker loop in GHC 8.6The following program loops infinitely during typechecking with GHC 8.6.1 and HEAD:
```hs
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
class Generic a where...The following program loops infinitely during typechecking with GHC 8.6.1 and HEAD:
```hs
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
class Generic a where
type Rep a :: Type
class PGeneric a where
type To a (x :: Rep a) :: a
type family MDefault (x :: a) :: a where
MDefault x = To (M x)
class C a where
type M (x :: a) :: a
type M (x :: a) = MDefault x
```
In GHC 8.4.3, however this fails with a proper error:
```
$ /opt/ghc/8.4.3/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:15:16: error:
• Occurs check: cannot construct the infinite kind:
a ~ Rep (M x) -> M x
• In the type ‘To (M x)’
In the type family declaration for ‘MDefault’
• Type variable kinds: x :: a
|
15 | MDefault x = To (M x)
| ^^^^^^^^
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Infinite typechecker loop in GHC 8.6","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":["TypeFamilies","TypeInType,"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program loops infinitely during typechecking with GHC 8.6.1 and HEAD:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\n\r\nclass Generic a where\r\n type Rep a :: Type\r\n\r\nclass PGeneric a where\r\n type To a (x :: Rep a) :: a\r\n\r\ntype family MDefault (x :: a) :: a where\r\n MDefault x = To (M x)\r\n\r\nclass C a where\r\n type M (x :: a) :: a\r\n type M (x :: a) = MDefault x\r\n}}}\r\n\r\nIn GHC 8.4.3, however this fails with a proper error:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.3/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:15:16: error:\r\n • Occurs check: cannot construct the infinite kind:\r\n a ~ Rep (M x) -> M x\r\n • In the type ‘To (M x)’\r\n In the type family declaration for ‘MDefault’\r\n • Type variable kinds: x :: a\r\n |\r\n15 | MDefault x = To (M x)\r\n | ^^^^^^^^\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15370Typed hole panic on GHC 8.6 (tcTyVarDetails)2019-07-07T18:12:57ZRyan ScottTyped hole panic on GHC 8.6 (tcTyVarDetails)The following program panics on GHC 8.6 and HEAD:
```hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperat...The following program panics on GHC 8.6 and HEAD:
```hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Type.Equality
import Data.Void
data family Sing :: forall k. k -> Type
data (~>) :: Type -> Type -> Type
infixr 0 ~>
type family Apply (f :: k1 ~> k2) (x :: k1) :: k2
newtype instance Sing (f :: k1 ~> k2) =
SLambda { applySing :: forall t. Sing t -> Sing (Apply f t) }
mkRefl :: n :~: j
mkRefl = Refl
right :: forall (r :: (x :~: y) ~> z).
Sing r -> ()
right no =
case mkRefl @x @y of
Refl -> applySing no _
```
```
$ /opt/ghc/8.6.1/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.0.20180627 for x86_64-unknown-linux):
tcTyVarDetails
co_a1BG :: y_a1Bz[sk:1] ~# x_a1By[sk:1]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable
pprPanic, called at compiler/basicTypes/Var.hs:497:22 in ghc:Var
```
On GHC 8.4, this simply errors:
```
$ /opt/ghc/8.4.3/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:23:10: error:
• Couldn't match type ‘n’ with ‘j’
‘n’ is a rigid type variable bound by
the type signature for:
mkRefl :: forall k1 (n :: k1) (j :: k1). n :~: j
at Bug.hs:22:1-17
‘j’ is a rigid type variable bound by
the type signature for:
mkRefl :: forall k1 (n :: k1) (j :: k1). n :~: j
at Bug.hs:22:1-17
Expected type: n :~: j
Actual type: n :~: n
• In the expression: Refl
In an equation for ‘mkRefl’: mkRefl = Refl
• Relevant bindings include
mkRefl :: n :~: j (bound at Bug.hs:23:1)
|
23 | mkRefl = Refl
| ^^^^
Bug.hs:29:13: error:
• Couldn't match type ‘Sing (Apply r t0)’ with ‘()’
Expected type: ()
Actual type: Sing (Apply r t0)
• In the expression: applySing no _
In a case alternative: Refl -> applySing no _
In the expression: case mkRefl @x @y of { Refl -> applySing no _ }
• Relevant bindings include
no :: Sing r (bound at Bug.hs:27:7)
right :: Sing r -> () (bound at Bug.hs:27:1)
|
29 | Refl -> applySing no _
| ^^^^^^^^^^^^^^
Bug.hs:29:26: error:
• Found hole: _ :: Sing t0
Where: ‘t0’ is an ambiguous type variable
‘y’, ‘x’, ‘k’ are rigid type variables bound by
the type signature for:
right :: forall k1 (x1 :: k1) (y1 :: k1) z (r :: (x1 :~: y1) ~> z).
Sing r -> ()
at Bug.hs:(25,1)-(26,21)
• In the second argument of ‘applySing’, namely ‘_’
In the expression: applySing no _
In a case alternative: Refl -> applySing no _
• Relevant bindings include
no :: Sing r (bound at Bug.hs:27:7)
right :: Sing r -> () (bound at Bug.hs:27:1)
Valid substitutions include
undefined :: forall (a :: TYPE r).
GHC.Stack.Types.HasCallStack =>
a
(imported from ‘Prelude’ at Bug.hs:7:8-10
(and originally defined in ‘GHC.Err’))
|
29 | Refl -> applySing no _
| ^
```
Note that this is distinct from #15142, as this is still reproducible on HEAD, even after commit 030211d21207dabb7a4bf21cc9af6fa5eb066db1.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Typed hole panic on GHC 8.6 (tcTyVarDetails)","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":["TypeInType,","TypedHoles"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program panics on GHC 8.6 and HEAD:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeApplications #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\nimport Data.Type.Equality\r\nimport Data.Void\r\n\r\ndata family Sing :: forall k. k -> Type\r\n\r\ndata (~>) :: Type -> Type -> Type\r\ninfixr 0 ~>\r\ntype family Apply (f :: k1 ~> k2) (x :: k1) :: k2\r\n\r\nnewtype instance Sing (f :: k1 ~> k2) =\r\n SLambda { applySing :: forall t. Sing t -> Sing (Apply f t) }\r\n\r\nmkRefl :: n :~: j\r\nmkRefl = Refl\r\n\r\nright :: forall (r :: (x :~: y) ~> z).\r\n Sing r -> ()\r\nright no =\r\n case mkRefl @x @y of\r\n Refl -> applySing no _\r\n}}}\r\n{{{\r\n$ /opt/ghc/8.6.1/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.6.0.20180627 for x86_64-unknown-linux):\r\n tcTyVarDetails\r\n co_a1BG :: y_a1Bz[sk:1] ~# x_a1By[sk:1]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable\r\n pprPanic, called at compiler/basicTypes/Var.hs:497:22 in ghc:Var\r\n}}}\r\n\r\nOn GHC 8.4, this simply errors:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.3/bin/ghc Bug.hs \r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:23:10: error:\r\n • Couldn't match type ‘n’ with ‘j’\r\n ‘n’ is a rigid type variable bound by\r\n the type signature for:\r\n mkRefl :: forall k1 (n :: k1) (j :: k1). n :~: j\r\n at Bug.hs:22:1-17\r\n ‘j’ is a rigid type variable bound by\r\n the type signature for:\r\n mkRefl :: forall k1 (n :: k1) (j :: k1). n :~: j\r\n at Bug.hs:22:1-17\r\n Expected type: n :~: j\r\n Actual type: n :~: n\r\n • In the expression: Refl\r\n In an equation for ‘mkRefl’: mkRefl = Refl\r\n • Relevant bindings include\r\n mkRefl :: n :~: j (bound at Bug.hs:23:1)\r\n |\r\n23 | mkRefl = Refl\r\n | ^^^^\r\n\r\nBug.hs:29:13: error:\r\n • Couldn't match type ‘Sing (Apply r t0)’ with ‘()’\r\n Expected type: ()\r\n Actual type: Sing (Apply r t0)\r\n • In the expression: applySing no _\r\n In a case alternative: Refl -> applySing no _\r\n In the expression: case mkRefl @x @y of { Refl -> applySing no _ }\r\n • Relevant bindings include\r\n no :: Sing r (bound at Bug.hs:27:7)\r\n right :: Sing r -> () (bound at Bug.hs:27:1)\r\n |\r\n29 | Refl -> applySing no _\r\n | ^^^^^^^^^^^^^^\r\n\r\nBug.hs:29:26: error:\r\n • Found hole: _ :: Sing t0\r\n Where: ‘t0’ is an ambiguous type variable\r\n ‘y’, ‘x’, ‘k’ are rigid type variables bound by\r\n the type signature for:\r\n right :: forall k1 (x1 :: k1) (y1 :: k1) z (r :: (x1 :~: y1) ~> z).\r\n Sing r -> ()\r\n at Bug.hs:(25,1)-(26,21)\r\n • In the second argument of ‘applySing’, namely ‘_’\r\n In the expression: applySing no _\r\n In a case alternative: Refl -> applySing no _\r\n • Relevant bindings include\r\n no :: Sing r (bound at Bug.hs:27:7)\r\n right :: Sing r -> () (bound at Bug.hs:27:1)\r\n Valid substitutions include\r\n undefined :: forall (a :: TYPE r).\r\n GHC.Stack.Types.HasCallStack =>\r\n a\r\n (imported from ‘Prelude’ at Bug.hs:7:8-10\r\n (and originally defined in ‘GHC.Err’))\r\n |\r\n29 | Refl -> applySing no _\r\n | ^\r\n}}}\r\n\r\nNote that this is distinct from #15142, as this is still reproducible on HEAD, even after commit 030211d21207dabb7a4bf21cc9af6fa5eb066db1.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Matthías Páll GissurarsonMatthías Páll Gissurarsonhttps://gitlab.haskell.org/ghc/ghc/-/issues/15350gcdExtInteger violates assertion2020-09-30T20:15:39ZBodigrimgcdExtInteger violates assertion```haskell
{-# LANGUAGE UnboxedTuples #-}
import GHC.Integer.GMP.Internals
main = let (# _, s #) = gcdExtInteger 2 (2^65 + 1) in print s
```
fails with
```haskell
Assertion failed: (sn <= mp_size_abs(xn)), function integer_gmp_gcdext,...```haskell
{-# LANGUAGE UnboxedTuples #-}
import GHC.Integer.GMP.Internals
main = let (# _, s #) = gcdExtInteger 2 (2^65 + 1) in print s
```
fails with
```haskell
Assertion failed: (sn <= mp_size_abs(xn)), function integer_gmp_gcdext, file libraries/integer-gmp/cbits/wrappers.c, line 316.
Abort trap: 6
```
It happens because `s = -2^64` and does not fit one-limbed `BigNat`. The implementation of `gcdExtInteger x y` (https://github.com/ghc/ghc/blob/master/libraries/integer-gmp/src/GHC/Integer/Type.hs\#L1392) allocates for `s` a buffer, equal to size of `x` (one limb in our case), but according to GMP manual (https://gmplib.org/manual/Number-Theoretic-Functions.html\#index-mpz_005fgcdext) it should be equal to size of `y` (two limbs in our case).
Hopefully, the diff is simple enough for a PR on GitHub (https://github.com/ghc/ghc/pull/163). Otherwise I'll be happy to prepare a patch for Phabricator.
```diff
- s@(MBN# s#) <- newBigNat# (absI# xn#)
+ s@(MBN# s#) <- newBigNat# (absI# yn#)
```
---
Reopening, because
```haskell
{-# LANGUAGE UnboxedTuples #-}
import GHC.Integer.GMP.Internals
main = let (# _, s #) = gcdExtInteger (- (2^63 - 1) * 2^63) 0 in print s
```
fails in GHC 8.6.1 with
```haskell
Assertion failed: (0 <= gn && gn <= gn0), function integer_gmp_gcdext, file libraries/integer-gmp/cbits/wrappers.c, line 309.
Abort trap: 6
```
I have not yet understood what is going on.8.6.1BodigrimBodigrimhttps://gitlab.haskell.org/ghc/ghc/-/issues/15343Implicitly quantifying a kind variable causes GHC 8.6 to panic (coercionKind)2019-07-07T18:13:05ZRyan ScottImplicitly quantifying a kind variable causes GHC 8.6 to panic (coercionKind)The following program panics on GHC 8.6 and later:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFam...The following program panics on GHC 8.6 and later:
```hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Type.Equality
data family Sing :: forall k. k -> Type
data SomeSing :: Type -> Type where
SomeSing :: Sing (a :: k) -> SomeSing k
class SingKind k where
type Demote k :: Type
fromSing :: Sing (a :: k) -> Demote k
toSing :: Demote k -> SomeSing k
data instance Sing (z :: a :~~: b) where
SHRefl :: Sing HRefl
instance SingKind (a :~~: b) where
type Demote (a :~~: b) = a :~~: b
fromSing SHRefl = HRefl
toSing HRefl = SomeSing SHRefl
data TyFun :: Type -> Type -> Type
type a ~> b = TyFun a b -> Type
infixr 0 ~>
type family Apply (f :: k1 ~> k2) (x :: k1) :: k2
(~>:~~:) :: forall (j :: Type) (k :: Type) (a :: j) (b :: k)
(p :: forall (z :: Type) (y :: z). (a :~~: y) ~> Type)
(r :: a :~~: b).
Sing r
-> Apply p HRefl
-> Apply p r
(~>:~~:) SHRefl pHRefl = pHRefl
type family Why (a :: j) (e :: a :~~: (y :: z)) :: Type where
Why a (_ :: a :~~: y) = y :~~: a
data WhySym (a :: j) :: forall (y :: z). (a :~~: y) ~> Type
-- data WhySym (a :: j) :: forall z (y :: z). (a :~~: y) ~> Type
-- The version above does NOT panic
type instance Apply (WhySym a) e = Why a e
hsym :: forall (j :: Type) (k :: Type) (a :: j) (b :: k).
a :~~: b -> b :~~: a
hsym eq = case toSing eq of
SomeSing (singEq :: Sing r) ->
(~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl
```
```
$ /opt/ghc/8.6.1/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.0.20180627 for x86_64-unknown-linux):
coercionKind
Nth:3
(Inst {co_a1jI} (Coh <k_a1js[sk:1]>_N (Nth:0 (Sym {co_a1jI}))))
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable
pprPanic, called at compiler/types/Coercion.hs:1887:9 in ghc:Coercion
```
As noted in the comments, replacing `WhySym` with a version that explicitly quantifies `z` avoids the panic.
This is a regression from GHC 8.4.3, in which the program simply errored:
```
$ /opt/ghc/8.4.3/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:56:38: error:
• Expected kind ‘forall z (y :: z). (a1 :~~: y) ~> *’,
but ‘WhySym a’ has kind ‘forall (y :: z0).
TyFun (a1 :~~: y) * -> *’
• In the type ‘(WhySym a)’
In the expression: (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl
In a case alternative:
SomeSing (singEq :: Sing r)
-> (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl
• Relevant bindings include
singEq :: Sing a2 (bound at Bug.hs:55:23)
eq :: a1 :~~: b (bound at Bug.hs:54:6)
hsym :: (a1 :~~: b) -> b :~~: a1 (bound at Bug.hs:54:1)
|
56 | (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl
| ^^^^^^^^
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Implicitly quantifying a kind variable causes GHC 8.6 to panic (coercionKind)","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program panics on GHC 8.6 and later:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE AllowAmbiguousTypes #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeApplications #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\nimport Data.Type.Equality\r\n\r\ndata family Sing :: forall k. k -> Type\r\ndata SomeSing :: Type -> Type where\r\n SomeSing :: Sing (a :: k) -> SomeSing k\r\n\r\nclass SingKind k where\r\n type Demote k :: Type\r\n fromSing :: Sing (a :: k) -> Demote k\r\n toSing :: Demote k -> SomeSing k\r\n\r\ndata instance Sing (z :: a :~~: b) where\r\n SHRefl :: Sing HRefl\r\n\r\ninstance SingKind (a :~~: b) where\r\n type Demote (a :~~: b) = a :~~: b\r\n fromSing SHRefl = HRefl\r\n toSing HRefl = SomeSing SHRefl\r\n\r\ndata TyFun :: Type -> Type -> Type\r\ntype a ~> b = TyFun a b -> Type\r\ninfixr 0 ~>\r\ntype family Apply (f :: k1 ~> k2) (x :: k1) :: k2\r\n\r\n(~>:~~:) :: forall (j :: Type) (k :: Type) (a :: j) (b :: k)\r\n (p :: forall (z :: Type) (y :: z). (a :~~: y) ~> Type)\r\n (r :: a :~~: b).\r\n Sing r\r\n -> Apply p HRefl\r\n -> Apply p r\r\n(~>:~~:) SHRefl pHRefl = pHRefl\r\n\r\ntype family Why (a :: j) (e :: a :~~: (y :: z)) :: Type where\r\n Why a (_ :: a :~~: y) = y :~~: a\r\n\r\ndata WhySym (a :: j) :: forall (y :: z). (a :~~: y) ~> Type\r\n-- data WhySym (a :: j) :: forall z (y :: z). (a :~~: y) ~> Type\r\n-- The version above does NOT panic\r\ntype instance Apply (WhySym a) e = Why a e\r\n\r\nhsym :: forall (j :: Type) (k :: Type) (a :: j) (b :: k).\r\n a :~~: b -> b :~~: a\r\nhsym eq = case toSing eq of\r\n SomeSing (singEq :: Sing r) ->\r\n (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl\r\n}}}\r\n\r\n{{{\r\n$ /opt/ghc/8.6.1/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.6.0.20180627 for x86_64-unknown-linux):\r\n coercionKind\r\n Nth:3\r\n (Inst {co_a1jI} (Coh <k_a1js[sk:1]>_N (Nth:0 (Sym {co_a1jI}))))\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in ghc:Outputable\r\n pprPanic, called at compiler/types/Coercion.hs:1887:9 in ghc:Coercion\r\n}}}\r\n\r\nAs noted in the comments, replacing `WhySym` with a version that explicitly quantifies `z` avoids the panic.\r\n\r\nThis is a regression from GHC 8.4.3, in which the program simply errored:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.3/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:56:38: error:\r\n • Expected kind ‘forall z (y :: z). (a1 :~~: y) ~> *’,\r\n but ‘WhySym a’ has kind ‘forall (y :: z0).\r\n TyFun (a1 :~~: y) * -> *’\r\n • In the type ‘(WhySym a)’\r\n In the expression: (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl\r\n In a case alternative:\r\n SomeSing (singEq :: Sing r)\r\n -> (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl\r\n • Relevant bindings include\r\n singEq :: Sing a2 (bound at Bug.hs:55:23)\r\n eq :: a1 :~~: b (bound at Bug.hs:54:6)\r\n hsym :: (a1 :~~: b) -> b :~~: a1 (bound at Bug.hs:54:1)\r\n |\r\n56 | (~>:~~:) @j @k @a @b @(WhySym a) @r singEq HRefl\r\n | ^^^^^^^^\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15304Huge increase of compile time and memory use from 8.0.2 to 8.2.2 or 8.4.22021-10-19T08:50:33ZNathanWaivioHuge increase of compile time and memory use from 8.0.2 to 8.2.2 or 8.4.2I am the author of the cl3 library on Hackage. I have noticed a huge increase of compile time and memory use when testing 8.2.2 and 8.4.2. ghc-8.0.2 compiled in 4:17.33 using 3.5 GB. ghc-8.2.2 compiled in 26:40.15 using 32.8 GB. This is ...I am the author of the cl3 library on Hackage. I have noticed a huge increase of compile time and memory use when testing 8.2.2 and 8.4.2. ghc-8.0.2 compiled in 4:17.33 using 3.5 GB. ghc-8.2.2 compiled in 26:40.15 using 32.8 GB. This is an increase of 6x in time and 9x in memory. This is not all bad, my nbody benchmark has improved about 35% between ghc-8.0.2 and ghc-8.4.2 so the increased compilation time and memory usage are producing much better runtime performance. I am interested if you could suggest some workarounds to help others compile on systems with less resources. I have 64GB memory in my system and would like to test out some -fno-\* GHC Options. Could you point me in the right direction? The library is almost entirely pure functions. I am also interested in other options, like if there are ways to rewrite things to make it easier on the compiler or using NOINLINE on a trouble spot and how to find that trouble spot.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.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":"Huge increase of compile time and memory use from 8.0.2 to 8.2.2 or 8.4.2","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I am the author of the cl3 library on Hackage. I have noticed a huge increase of compile time and memory use when testing 8.2.2 and 8.4.2. ghc-8.0.2 compiled in 4:17.33 using 3.5 GB. ghc-8.2.2 compiled in 26:40.15 using 32.8 GB. This is an increase of 6x in time and 9x in memory. This is not all bad, my nbody benchmark has improved about 35% between ghc-8.0.2 and ghc-8.4.2 so the increased compilation time and memory usage are producing much better runtime performance. I am interested if you could suggest some workarounds to help others compile on systems with less resources. I have 64GB memory in my system and would like to test out some -fno-* GHC Options. Could you point me in the right direction? The library is almost entirely pure functions. I am also interested in other options, like if there are ways to rewrite things to make it easier on the compiler or using NOINLINE on a trouble spot and how to find that trouble spot.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Matthew PickeringMatthew Pickeringhttps://gitlab.haskell.org/ghc/ghc/-/issues/15287T11627[ab] fail on some Darwin environments2024-03-06T20:42:17ZBen GamariT11627[ab] fail on some Darwin environmentsAs of d6216443c61cee94d8ffc31ca8510a534d9406b9 I am seeing `T11627a` and `T11627b` fail in the `prof_hr` way on Darwin under CircleCI (but not Harbormaster!):
```
Wrong exit code for T11627b(prof_hr)(expected 0 , actual 139 )
Stderr ( T...As of d6216443c61cee94d8ffc31ca8510a534d9406b9 I am seeing `T11627a` and `T11627b` fail in the `prof_hr` way on Darwin under CircleCI (but not Harbormaster!):
```
Wrong exit code for T11627b(prof_hr)(expected 0 , actual 139 )
Stderr ( T11627b ):
/bin/sh: line 1: 73247 Segmentation fault: 11 ./T11627b +RTS -hr -RTS +RTS -i0 -RTS
*** unexpected failure for T11627b(prof_hr)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"T11627[ab] fail on some Darwin environments","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"As of d6216443c61cee94d8ffc31ca8510a534d9406b9 I am seeing `T11627a` and `T11627b` fail in the `prof_hr` way on Darwin under CircleCI (but not Harbormaster!):\r\n{{{\r\nWrong exit code for T11627b(prof_hr)(expected 0 , actual 139 )\r\nStderr ( T11627b ):\r\n/bin/sh: line 1: 73247 Segmentation fault: 11 ./T11627b +RTS -hr -RTS +RTS -i0 -RTS\r\n*** unexpected failure for T11627b(prof_hr)\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15281GHC 8.6.1 can't be bootstrapped with GHC 8.2.12019-07-07T18:13:28ZBen GamariGHC 8.6.1 can't be bootstrapped with GHC 8.2.160e4bb4d305bc1a65457ee79b1e69c11b9ed747d (#9136) triggers a bug in GHC 8.2.1 which causes the build to fail with,
```
ghc: panic! (the 'impossible' happened)
(GHC version 8.2.1 for x86_64-unknown-linux):
runtimeRepPrimRep
typePrimR...60e4bb4d305bc1a65457ee79b1e69c11b9ed747d (#9136) triggers a bug in GHC 8.2.1 which causes the build to fail with,
```
ghc: panic! (the 'impossible' happened)
(GHC version 8.2.1 for x86_64-unknown-linux):
runtimeRepPrimRep
typePrimRep (r_aqbE :: TYPE rep_aqbD)
rep_aqbD
Call stack:
CallStack (from HasCallStack):
prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
pprPanic, called at compiler/simplStg/RepType.hs:360:5 in ghc:RepType
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
This is a manifestation of #14393, which is fixed in 8.2.2 and later.
We should probably add a `configure` check warning about this brokenness when the user tries to bootstrap with GHC 8.2.1.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC 8.6.1 can't be bootstrapped with GHC 8.2.1","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"60e4bb4d305bc1a65457ee79b1e69c11b9ed747d (#9136) triggers a bug in GHC 8.2.1 which causes the build to fail with,\r\n{{{\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.2.1 for x86_64-unknown-linux):\r\n\truntimeRepPrimRep\r\n typePrimRep (r_aqbE :: TYPE rep_aqbD)\r\n rep_aqbD\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable\r\n callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable\r\n pprPanic, called at compiler/simplStg/RepType.hs:360:5 in ghc:RepType\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\nThis is a manifestation of #14393, which is fixed in 8.2.2 and later.\r\n\r\nWe should probably add a `configure` check warning about this brokenness when the user tries to bootstrap with GHC 8.2.1.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15275AArch64 validation fails with many invalid relocations2021-10-08T01:57:13ZBen GamariAArch64 validation fails with many invalid relocationsTest ways requiring the RTS linker (e.g. `ext-interp`) are failing due to the `assert(isInt64(32, addend));` assertion in the `COMPAT_R_AARCH64_ADR_PREL_PG_HI21` of `encodeAddendAarch64`. One such relocation is,
```
RELOCATION RECORDS F...Test ways requiring the RTS linker (e.g. `ext-interp`) are failing due to the `assert(isInt64(32, addend));` assertion in the `COMPAT_R_AARCH64_ADR_PREL_PG_HI21` of `encodeAddendAarch64`. One such relocation is,
```
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
000000000000001c R_AARCH64_ADR_PREL_PG_HI21 stg_upd_frame_info
```
although there are plenty of others.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------ |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler (Linking) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | angerman |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"AArch64 validation fails with many invalid relocations","status":"New","operating_system":"","component":"Compiler (Linking)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["angerman"],"type":"Bug","description":"Test ways requiring the RTS linker (e.g. `ext-interp`) are failing due to the `assert(isInt64(32, addend));` assertion in the `COMPAT_R_AARCH64_ADR_PREL_PG_HI21` of `encodeAddendAarch64`. One such relocation is,\r\n{{{\r\nRELOCATION RECORDS FOR [.text]:\r\nOFFSET TYPE VALUE\r\n000000000000001c R_AARCH64_ADR_PREL_PG_HI21 stg_upd_frame_info\r\n}}}\r\nalthough there are plenty of others.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15274Numerous validation failures when building GHC with LLVM2019-07-07T18:13:29ZBen GamariNumerous validation failures when building GHC with LLVMThe CircleCI x86_64/Linux LLVM way exhibits numerous testsuite failures:
```
Unexpected results from:
TEST="CPUTime001 ClosedFam1TH T10828 T10891 T11341 T11345 T11463 T11721_TH T11797 T12403 T12646 T12962 T13642 T13887 T14060 T1835 T222...The CircleCI x86_64/Linux LLVM way exhibits numerous testsuite failures:
```
Unexpected results from:
TEST="CPUTime001 ClosedFam1TH T10828 T10891 T11341 T11345 T11463 T11721_TH T11797 T12403 T12646 T12962 T13642 T13887 T14060 T1835 T2222 T2552 T2700 T3920 T4135 T4188 T5037 T5358 T5362 T5363 T5559 T680 T7477 T8761 T8884 T8953 T9064 T9262 T9692 TH_PromotedList TH_RichKinds TH_RichKinds2 TH_Roles3 TH_TyInstWhere2 TH_foreignCallingConventions TH_reifyDecl1 TH_reifyDecl2 TH_reifyInstances TH_repE2 TH_repGuard TH_repPrim TH_repPrim2 TH_repUnboxedTuples posix002 prof-doc-fib prof-doc-last profinline001 scc001 scc002 scc003 scc005"
SUMMARY for test run started at Mon Jun 18 08:57:25 2018 UTC
1:18:58 spent to go through
6443 total tests, which gave rise to
25148 test cases, of which
4810 were skipped
229 had missing libraries
19825 expected passes
227 expected failures
0 caused framework failures
0 caused framework warnings
0 unexpected passes
57 unexpected failures
0 unexpected stat failures
Unexpected failures:
profiling/should_run/scc001.run scc001 [bad exit code] (ghci-ext-prof)
profiling/should_run/scc002.run scc002 [bad exit code] (ghci-ext-prof)
profiling/should_run/scc003.run scc003 [bad exit code] (ghci-ext-prof)
profiling/should_run/scc005.run scc005 [bad exit code] (ghci-ext-prof)
profiling/should_run/T680.run T680 [bad exit code] (ghci-ext-prof)
profiling/should_run/T2552.run T2552 [bad exit code] (ghci-ext-prof)
profiling/should_run/prof-doc-fib.run prof-doc-fib [bad exit code] (ghci-ext-prof)
profiling/should_run/T5559.run T5559 [bad exit code] (ghci-ext-prof)
profiling/should_run/prof-doc-last.run prof-doc-last [bad exit code] (ghci-ext-prof)
profiling/should_run/profinline001.run profinline001 [bad exit code] (ghci-ext-prof)
profiling/should_run/T5363.run T5363 [bad exit code] (ghci-ext-prof)
profiling/should_run/T12962.run T12962 [bad exit code] (ghci-ext-prof)
th/TH_repPrim.run TH_repPrim [exit code non-0] (ext-interp)
th/TH_repPrim2.run TH_repPrim2 [exit code non-0] (ext-interp)
th/TH_repUnboxedTuples.run TH_repUnboxedTuples [exit code non-0] (ext-interp)
th/TH_repGuard.run TH_repGuard [exit code non-0] (ext-interp)
th/TH_repE2.run TH_repE2 [exit code non-0] (ext-interp)
th/TH_reifyDecl1.run TH_reifyDecl1 [exit code non-0] (ext-interp)
th/TH_reifyDecl2.run TH_reifyDecl2 [exit code non-0] (ext-interp)
th/TH_reifyInstances.run TH_reifyInstances [exit code non-0] (ext-interp)
th/T2700.run T2700 [exit code non-0] (ext-interp)
th/TH_foreignCallingConventions.run TH_foreignCallingConventions [exit code non-0] (ext-interp)
th/T4188.run T4188 [exit code non-0] (ext-interp)
th/T3920.run T3920 [exit code non-0] (ext-interp)
th/T5037.run T5037 [exit code non-0] (ext-interp)
th/T5362.run T5362 [exit code non-0] (ext-interp)
th/T1835.run T1835 [exit code non-0] (ext-interp)
th/T5358.run T5358 [stderr mismatch] (ext-interp)
th/TH_PromotedList.run TH_PromotedList [exit code non-0] (ext-interp)
th/TH_RichKinds.run TH_RichKinds [exit code non-0] (ext-interp)
th/TH_RichKinds2.run TH_RichKinds2 [exit code non-0] (ext-interp)
th/T4135.run T4135 [exit code non-0] (ext-interp)
th/TH_TyInstWhere2.run TH_TyInstWhere2 [exit code non-0] (ext-interp)
th/T2222.run T2222 [exit code non-0] (ext-interp)
th/ClosedFam1TH.run ClosedFam1TH [exit code non-0] (ext-interp)
th/TH_Roles3.run TH_Roles3 [exit code non-0] (ext-interp)
th/T7477.run T7477 [exit code non-0] (ext-interp)
th/T8884.run T8884 [exit code non-0] (ext-interp)
th/T9262.run T9262 [exit code non-0] (ext-interp)
th/T9692.run T9692 [exit code non-0] (ext-interp)
th/T8953.run T8953 [exit code non-0] (ext-interp)
th/T9064.run T9064 [exit code non-0] (ext-interp)
th/T10828.run T10828 [exit code non-0] (ext-interp)
th/T10891.run T10891 [exit code non-0] (ext-interp)
th/T11341.run T11341 [exit code non-0] (ext-interp)
th/T11345.run T11345 [exit code non-0] (ext-interp)
th/T11721_TH.run T11721_TH [exit code non-0] (ext-interp)
th/T11797.run T11797 [exit code non-0] (ext-interp)
th/T11463.run T11463 [exit code non-0] (ext-interp)
th/T8761.run T8761 [exit code non-0] (ext-interp)
th/T12403.run T12403 [exit code non-0] (ext-interp)
th/T12646.run T12646 [exit code non-0] (ext-interp)
th/T13642.run T13642 [exit code non-0] (ext-interp)
th/T13887.run T13887 [exit code non-0] (ext-interp)
th/T14060.run T14060 [exit code non-0] (ext-interp)
../../libraries/base/tests/CPUTime001.run CPUTime001 [bad stdout] (threaded2)
../../libraries/unix/tests/libposix/posix002.run posix002 [bad exit code] (threaded2)
```
Unfortunately, most of these appear to be segmentation faults and similar, suggesting miscompilation.8.6.1Alp MestanogullariAlp Mestanogullarihttps://gitlab.haskell.org/ghc/ghc/-/issues/15266Add QuantifiedConstraints to release notes2020-06-23T23:16:09ZRichard Eisenbergrae@richarde.devAdd QuantifiedConstraints to release notesIt seems `-XQuantifiedConstraints` never made it into the release notes. We should fix this.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version ...It seems `-XQuantifiedConstraints` never made it into the release notes. We should fix this.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Add QuantifiedConstraints to release notes","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"It seems `-XQuantifiedConstraints` never made it into the release notes. We should fix this.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15255overflow1 breaks on i3862019-07-07T18:13:36ZBen Gamarioverflow1 breaks on i386The i386 CircleCI target is showing a mysterious failure of the `overflow1` test:
```
=====> overflow1(normal) 4082 of 6414 [0, 3, 0]
Wrong exit code for overflow1(normal)(expected 251 , actual 0 )
*** unexpected failure for overflow1(n...The i386 CircleCI target is showing a mysterious failure of the `overflow1` test:
```
=====> overflow1(normal) 4082 of 6414 [0, 3, 0]
Wrong exit code for overflow1(normal)(expected 251 , actual 0 )
*** unexpected failure for overflow1(normal)
```
Need to work out what is going on here.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Continuous Integration |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"overflow1 breaks on i386","status":"New","operating_system":"","component":"Continuous Integration","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"bgamari"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The i386 CircleCI target is showing a mysterious failure of the `overflow1` test:\r\n{{{\r\n=====> overflow1(normal) 4082 of 6414 [0, 3, 0]\r\nWrong exit code for overflow1(normal)(expected 251 , actual 0 )\r\n*** unexpected failure for overflow1(normal)\r\n}}}\r\n\r\nNeed to work out what is going on here.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/15237New SRT scheme breaks -fvia-C2019-07-07T18:13:40ZBen GamariNew SRT scheme breaks -fvia-CThe SRT rework implemented in 2b0918c9834be1873728176e4944bec26271234a introduces a sub-word-size field into `StgSRT`. Unfortunately `-fvia-C` doesn't support such fields. This breaks CircleCI's unregisterised target.
<details><summary>...The SRT rework implemented in 2b0918c9834be1873728176e4944bec26271234a introduces a sub-word-size field into `StgSRT`. Unfortunately `-fvia-C` doesn't support such fields. This breaks CircleCI's unregisterised target.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"New SRT scheme breaks -fvia-C","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The SRT rework implemented in 2b0918c9834be1873728176e4944bec26271234a introduces a sub-word-size field into `StgSRT`. Unfortunately `-fvia-C` doesn't support such fields. This breaks CircleCI's unregisterised target.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15230unix tests fail under CircleCI's fedora environment2021-03-12T00:39:41ZBen Gamariunix tests fail under CircleCI's fedora environmentIt's a bit unclear what is going on here:
```
=====> getGroupEntryForName(normal) 6377 of 6403 [0, 0, 0]
Actual stdout output differs from expected:
--- ../../libraries/unix/tests/user001.run/user001.stdout.normalised 2018-06-05 15:18:3...It's a bit unclear what is going on here:
```
=====> getGroupEntryForName(normal) 6377 of 6403 [0, 0, 0]
Actual stdout output differs from expected:
--- ../../libraries/unix/tests/user001.run/user001.stdout.normalised 2018-06-05 15:18:37.243934191 +0000
+++ ../../libraries/unix/tests/user001.run/user001.run.stdout.normalised 2018-06-05 15:18:37.243934191 +0000
@@ -6,6 +6,6 @@
getEffectiveUserName: OK
getGroupEntryForID: OK
getGroupEntryForName: OK
-getAllGroupEntries: OK
+getAllGroupEntries: ERROR: getAllGroupEntries: does not exist (No such file or directory)
getUserEntryForID: OK
getAllUserEntries: OK
*** unexpected failure for user001(normal)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Continuous Integration |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"unix tests fail under CircleCI's fedora environment","status":"New","operating_system":"","component":"Continuous Integration","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"bgamari"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"It's a bit unclear what is going on here:\r\n\r\n{{{\r\n=====> getGroupEntryForName(normal) 6377 of 6403 [0, 0, 0]\r\nActual stdout output differs from expected:\r\n--- ../../libraries/unix/tests/user001.run/user001.stdout.normalised\t2018-06-05 15:18:37.243934191 +0000\r\n+++ ../../libraries/unix/tests/user001.run/user001.run.stdout.normalised\t2018-06-05 15:18:37.243934191 +0000\r\n@@ -6,6 +6,6 @@\r\n getEffectiveUserName: OK\r\n getGroupEntryForID: OK\r\n getGroupEntryForName: OK\r\n-getAllGroupEntries: OK\r\n+getAllGroupEntries: ERROR: getAllGroupEntries: does not exist (No such file or directory)\r\n getUserEntryForID: OK\r\n getAllUserEntries: OK\r\n*** unexpected failure for user001(normal)\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/15171Add HeapView functionality breaks validate (stage 0 ghc is 8.4.2)2019-07-07T18:13:56Zjrp2014Add HeapView functionality breaks validate (stage 0 ghc is 8.4.2)```
"/opt/ghc/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -this-unit-id mtl-2.2.2 -hide-all-packages -i -ilibraries/mtl/. -ilibraries/mtl/dist-boot/build -Ilibraries/mtl/dist...```
"/opt/ghc/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -this-unit-id mtl-2.2.2 -hide-all-packages -i -ilibraries/mtl/. -ilibraries/mtl/dist-boot/build -Ilibraries/mtl/dist-boot/build -ilibraries/mtl/dist-boot/build/./autogen -Ilibraries/mtl/dist-boot/build/./autogen -Ilibraries/mtl/. -optP-include -optPlibraries/mtl/dist-boot/build/./autogen/cabal_macros.h -package-id base-4.11.1.0 -package-id transformers-0.5.5.0 -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -XHaskell2010 -no-user-package-db -rtsopts -fno-warn-deprecated-flags -odir libraries/mtl/dist-boot/build -hidir libraries/mtl/dist-boot/build -stubdir libraries/mtl/dist-boot/build -c libraries/mtl/./Control/Monad/RWS/Lazy.hs -o libraries/mtl/dist-boot/build/Control/Monad/RWS/Lazy.o
libraries/ghc-heap/GHC/Exts/Heap.hs:119:48: error:
• Couldn't match expected type ‘ByteArray#’
with actual type ‘Array# b0’
• In the first argument of ‘sizeofByteArray#’, namely ‘dat’
In the first argument of ‘I#’, namely ‘(sizeofByteArray# dat)’
In the first argument of ‘div’, namely
‘(I# (sizeofByteArray# dat))’
• Relevant bindings include
dat :: Array# b0
(bound at libraries/ghc-heap/GHC/Exts/Heap.hs:115:18)
|
119 | let nelems = (I# (sizeofByteArray# dat)) `div` wORD_SIZE
| ^^^
libraries/ghc-heap/GHC/Exts/Heap.hs:121:47: error:
• Couldn't match expected type ‘ByteArray#’
with actual type ‘Array# b0’
• In the first argument of ‘indexWordArray#’, namely ‘dat’
In the first argument of ‘W#’, namely ‘(indexWordArray# dat i)’
In the expression: W# (indexWordArray# dat i)
• Relevant bindings include
dat :: Array# b0
(bound at libraries/ghc-heap/GHC/Exts/Heap.hs:115:18)
|
121 | rawWds = [W# (indexWordArray# dat i) | I# i <- [0.. end] ]
| ^^^
libraries/ghc-heap/GHC/Exts/Heap.hs:122:43: error:
• Couldn't match expected type ‘Array# a0’
with actual type ‘ByteArray#’
• In the first argument of ‘sizeofArray#’, namely ‘pointers’
In the first argument of ‘I#’, namely ‘(sizeofArray# pointers)’
In the expression: I# (sizeofArray# pointers)
|
122 | pelems = I# (sizeofArray# pointers)
| ^^^^^^^^
libraries/ghc-heap/GHC/Exts/Heap.hs:123:67: error:
• Couldn't match expected type ‘Array# Any’
with actual type ‘ByteArray#’
• In the fourth argument of ‘Array’, namely ‘pointers’
In the second argument of ‘($)’, namely
‘Array 0 (pelems - 1) pelems pointers’
In the expression: amap' Box $ Array 0 (pelems - 1) pelems pointers
|
123 | ptrList = amap' Box $ Array 0 (pelems - 1) pelems pointers
| ^^^^^^^^
libraries/ghc-heap/ghc.mk:3: recipe for target 'libraries/ghc-heap/dist-boot/build/GHC/Exts/Heap.o' failed
make[1]: *** [libraries/ghc-heap/dist-boot/build/GHC/Exts/Heap.o] Error 1
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | patrickdoc |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Add HeapView functionality breaks validate (stage 0 ghc is 8.4.2)","status":"New","operating_system":"","component":"Runtime System","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["patrickdoc"],"type":"Bug","description":"{{{\r\n\"/opt/ghc/bin/ghc\" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -this-unit-id mtl-2.2.2 -hide-all-packages -i -ilibraries/mtl/. -ilibraries/mtl/dist-boot/build -Ilibraries/mtl/dist-boot/build -ilibraries/mtl/dist-boot/build/./autogen -Ilibraries/mtl/dist-boot/build/./autogen -Ilibraries/mtl/. -optP-include -optPlibraries/mtl/dist-boot/build/./autogen/cabal_macros.h -package-id base-4.11.1.0 -package-id transformers-0.5.5.0 -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -XHaskell2010 -no-user-package-db -rtsopts -fno-warn-deprecated-flags -odir libraries/mtl/dist-boot/build -hidir libraries/mtl/dist-boot/build -stubdir libraries/mtl/dist-boot/build -c libraries/mtl/./Control/Monad/RWS/Lazy.hs -o libraries/mtl/dist-boot/build/Control/Monad/RWS/Lazy.o \r\n\r\nlibraries/ghc-heap/GHC/Exts/Heap.hs:119:48: error:\r\n • Couldn't match expected type ‘ByteArray#’\r\n with actual type ‘Array# b0’\r\n • In the first argument of ‘sizeofByteArray#’, namely ‘dat’\r\n In the first argument of ‘I#’, namely ‘(sizeofByteArray# dat)’\r\n In the first argument of ‘div’, namely\r\n ‘(I# (sizeofByteArray# dat))’\r\n • Relevant bindings include\r\n dat :: Array# b0\r\n (bound at libraries/ghc-heap/GHC/Exts/Heap.hs:115:18)\r\n |\r\n119 | let nelems = (I# (sizeofByteArray# dat)) `div` wORD_SIZE\r\n | ^^^\r\n\r\nlibraries/ghc-heap/GHC/Exts/Heap.hs:121:47: error:\r\n • Couldn't match expected type ‘ByteArray#’\r\n with actual type ‘Array# b0’\r\n • In the first argument of ‘indexWordArray#’, namely ‘dat’\r\n In the first argument of ‘W#’, namely ‘(indexWordArray# dat i)’\r\n In the expression: W# (indexWordArray# dat i)\r\n • Relevant bindings include\r\n dat :: Array# b0\r\n (bound at libraries/ghc-heap/GHC/Exts/Heap.hs:115:18)\r\n |\r\n121 | rawWds = [W# (indexWordArray# dat i) | I# i <- [0.. end] ]\r\n | ^^^\r\n\r\nlibraries/ghc-heap/GHC/Exts/Heap.hs:122:43: error:\r\n • Couldn't match expected type ‘Array# a0’\r\n with actual type ‘ByteArray#’\r\n • In the first argument of ‘sizeofArray#’, namely ‘pointers’\r\n In the first argument of ‘I#’, namely ‘(sizeofArray# pointers)’\r\n In the expression: I# (sizeofArray# pointers)\r\n |\r\n122 | pelems = I# (sizeofArray# pointers)\r\n | ^^^^^^^^\r\n\r\nlibraries/ghc-heap/GHC/Exts/Heap.hs:123:67: error:\r\n • Couldn't match expected type ‘Array# Any’\r\n with actual type ‘ByteArray#’\r\n • In the fourth argument of ‘Array’, namely ‘pointers’\r\n In the second argument of ‘($)’, namely\r\n ‘Array 0 (pelems - 1) pelems pointers’\r\n In the expression: amap' Box $ Array 0 (pelems - 1) pelems pointers\r\n |\r\n123 | ptrList = amap' Box $ Array 0 (pelems - 1) pelems pointers\r\n | ^^^^^^^^\r\nlibraries/ghc-heap/ghc.mk:3: recipe for target 'libraries/ghc-heap/dist-boot/build/GHC/Exts/Heap.o' failed\r\nmake[1]: *** [libraries/ghc-heap/dist-boot/build/GHC/Exts/Heap.o] Error 1\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15079GHC HEAD regression: cannot instantiate higher-rank kind2020-10-31T11:08:22ZRyan ScottGHC HEAD regression: cannot instantiate higher-rank kindThe following program typechecks on GHC 8.2.2 and 8.4.2:
```hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Void
inf...The following program typechecks on GHC 8.2.2 and 8.4.2:
```hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module Bug where
import Data.Kind
import Data.Void
infixl 4 :==
-- | Heterogeneous Leibnizian equality.
newtype (a :: j) :== (b :: k)
= HRefl { hsubst :: forall (c :: forall (i :: Type). i -> Type). c a -> c b }
newtype Coerce a = Coerce { uncoerce :: Starify a }
type family Starify (a :: k) :: Type where
Starify (a :: Type) = a
Starify _ = Void
coerce :: a :== b -> a -> b
coerce f = uncoerce . hsubst f . Coerce
```
But GHC HEAD rejects it:
```
$ ~/Software/ghc/inplace/bin/ghc-stage2 Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:21:34: error:
• Kind mismatch: cannot unify (c0 :: forall i. i -> *) with:
Coerce :: forall k. k -> *
Their kinds differ.
Expected type: a -> c0 * a
Actual type: Starify a -> Coerce a
• In the second argument of ‘(.)’, namely ‘Coerce’
In the second argument of ‘(.)’, namely ‘hsubst f . Coerce’
In the expression: uncoerce . hsubst f . Coerce
|
21 | coerce f = uncoerce . hsubst f . Coerce
| ^^^^^^
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC HEAD regression: cannot instantiate higher-rank kind","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.5","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program typechecks on GHC 8.2.2 and 8.4.2:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeInType #-}\r\n{-# LANGUAGE TypeOperators #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\nimport Data.Void\r\n\r\ninfixl 4 :==\r\n-- | Heterogeneous Leibnizian equality.\r\nnewtype (a :: j) :== (b :: k)\r\n = HRefl { hsubst :: forall (c :: forall (i :: Type). i -> Type). c a -> c b }\r\n\r\nnewtype Coerce a = Coerce { uncoerce :: Starify a }\r\ntype family Starify (a :: k) :: Type where\r\n Starify (a :: Type) = a\r\n Starify _ = Void\r\n\r\ncoerce :: a :== b -> a -> b\r\ncoerce f = uncoerce . hsubst f . Coerce\r\n}}}\r\n\r\nBut GHC HEAD rejects it:\r\n\r\n{{{\r\n$ ~/Software/ghc/inplace/bin/ghc-stage2 Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:21:34: error:\r\n • Kind mismatch: cannot unify (c0 :: forall i. i -> *) with:\r\n Coerce :: forall k. k -> *\r\n Their kinds differ.\r\n Expected type: a -> c0 * a\r\n Actual type: Starify a -> Coerce a\r\n • In the second argument of ‘(.)’, namely ‘Coerce’\r\n In the second argument of ‘(.)’, namely ‘hsubst f . Coerce’\r\n In the expression: uncoerce . hsubst f . Coerce\r\n |\r\n21 | coerce f = uncoerce . hsubst f . Coerce\r\n | ^^^^^^\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15063T3001-2 fails on i386 Linux2019-07-07T18:14:27ZBen GamariT3001-2 fails on i386 LinuxThe `T3001-2` testcase fails on i386/Linux:
```
Wrong exit code for T3001-2(prof_hb)(expected 0 , actual 134 )
Stderr ( T3001-2 ):
T3001-2: internal error: Invalid object in processHeapClosureForDead(): 7
(GHC version 8.5.20180419 f...The `T3001-2` testcase fails on i386/Linux:
```
Wrong exit code for T3001-2(prof_hb)(expected 0 , actual 134 )
Stderr ( T3001-2 ):
T3001-2: internal error: Invalid object in processHeapClosureForDead(): 7
(GHC version 8.5.20180419 for i386_unknown_linux)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Aborted
*** unexpected failure for T3001-2(prof_hb)
```
Closure type 7 is `CONSTR_NOCAF`, which is indeed invalid. Tracking this down will take some debugging.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Profiling |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"T3001-2 fails on i386 Linux","status":"New","operating_system":"","component":"Profiling","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The `T3001-2` testcase fails on i386/Linux:\r\n\r\n{{{\r\nWrong exit code for T3001-2(prof_hb)(expected 0 , actual 134 )\r\nStderr ( T3001-2 ):\r\nT3001-2: internal error: Invalid object in processHeapClosureForDead(): 7\r\n (GHC version 8.5.20180419 for i386_unknown_linux)\r\n Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\nAborted\r\n*** unexpected failure for T3001-2(prof_hb)\r\n}}}\r\n\r\nClosure type 7 is `CONSTR_NOCAF`, which is indeed invalid. Tracking this down will take some debugging.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1https://gitlab.haskell.org/ghc/ghc/-/issues/15062num009 is incredibly platform-sensitive2022-01-16T09:37:43ZBen Gamarinum009 is incredibly platform-sensitiveThe functions tested by `num009` are certainly worthwhile to test, but we really need to find a better way to test them. Currently the test seemingly fails in more places than it passes:
- Fails on Darwin (#2370)
- Fails on POWER8 (#136...The functions tested by `num009` are certainly worthwhile to test, but we really need to find a better way to test them. Currently the test seemingly fails in more places than it passes:
- Fails on Darwin (#2370)
- Fails on POWER8 (#13634)
- Fails on Win32 when in the `ghci` way (no ticket)
- Fails under i386 on CircleCI (e.g. https://circleci.com/gh/ghc/ghc/3666)
Perhaps we should instead test the output against the same evaluations performed by a C program. This would eliminate spurious failures due to platform or C library differences.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Test Suite |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"num009 is incredibly platform-sensitive","status":"New","operating_system":"","component":"Test Suite","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The functions tested by `num009` are certainly worthwhile to test, but we really need to find a better way to test them. Currently the test seemingly fails in more places than it passes:\r\n\r\n * Fails on Darwin (#2370)\r\n * Fails on POWER8 (#13634)\r\n * Fails on Win32 when in the `ghci` way (no ticket)\r\n * Fails under i386 on CircleCI (e.g. https://circleci.com/gh/ghc/ghc/3666)\r\n\r\nPerhaps we should instead test the output against the same evaluations performed by a C program. This would eliminate spurious failures due to platform or C library differences.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.1