GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:02:01Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/16015git notes logic breaks CircleCI validation of pull requests2019-07-07T18:02:01ZBen Gamarigit notes logic breaks CircleCI validation of pull requestsDue to missing credentials. David, can you have a look?
https://circleci.com/gh/ghc/ghc/12493
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version ...Due to missing credentials. David, can you have a look?
https://circleci.com/gh/ghc/ghc/12493
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | davide |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"git notes logic breaks CircleCI validation of pull requests","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["davide"],"type":"Bug","description":"Due to missing credentials. David, can you have a look?\r\n\r\nhttps://circleci.com/gh/ghc/ghc/12493","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15967can't build ghc on Mac with any level of dwarf for base library2019-07-07T18:02:14ZCarter Schonwaldcan't build ghc on Mac with any level of dwarf for base libraryi tried building base in 8.6.2 with -g1
and i get the following error pretty consitently from the system linker
```
ld: in /Users/carter/dev-checkouts/ghc-tree/ghc-8.6.2-checkout-build/libraries/base/dist-install/build/libHSbase-4.12.0....i tried building base in 8.6.2 with -g1
and i get the following error pretty consitently from the system linker
```
ld: in /Users/carter/dev-checkouts/ghc-tree/ghc-8.6.2-checkout-build/libraries/base/dist-install/build/libHSbase-4.12.0.0_p.a(Base.p_o), sectionForAddress(0x8066) address not in any section for architecture x86_64
```
if i do
```
GhcLibHcOpts += -g1
```
or higher in the build.mk file, i get this linker error at some point in building ghc or resulting executables .
I'm not sure if its \*just\* for profiled libs or every lib, but it looks like theres actually no way to handle the number of dwarf sections for large archives on OSX?!
or equivalently, we may need support for more parsimonious dwarf annotations if at all?
point being: if we can't support debug symbols for base on a tier 1 platform, either debug symbols working isn't part of our support SLA for tier 1 platforms, OR its a release blocker we've not had in our validate configuration matrix.8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15906Stable name allocation causes heap corruption when GC is triggered in the primop2019-07-07T18:02:30ZÖmer Sinan AğacanStable name allocation causes heap corruption when GC is triggered in the primopThe error is originally reported in #15241, and is caught by the test `memo001`
when run with `-debug` (which only happens in sanity way currently).
Here's the problem. mkStableName\# is defined like this:
```
stg_makeStableNamezh ( P_...The error is originally reported in #15241, and is caught by the test `memo001`
when run with `-debug` (which only happens in sanity way currently).
Here's the problem. mkStableName\# is defined like this:
```
stg_makeStableNamezh ( P_ obj )
{
W_ index, sn_obj;
(index) = ccall lookupStableName(obj "ptr");
/* Is there already a StableName for this heap object?
* stable_name_table is a pointer to an array of snEntry structs.
*/
if ( snEntry_sn_obj(W_[stable_name_table] + index*SIZEOF_snEntry) == NULL ) {
ALLOC_PRIM (SIZEOF_StgStableName); <------------ PROBLEM HERE ----------
sn_obj = Hp - SIZEOF_StgStableName + WDS(1);
SET_HDR(sn_obj, stg_STABLE_NAME_info, CCCS);
StgStableName_sn(sn_obj) = index;
snEntry_sn_obj(W_[stable_name_table] + index*SIZEOF_snEntry) = sn_obj;
} else {
sn_obj = snEntry_sn_obj(W_[stable_name_table] + index*SIZEOF_snEntry);
}
return (sn_obj);
}
```
There's a problem in the annotated line: if we allocate a `snEntry` in the
stable name table, but run out of heap to actually allocate the `StgStableName`
we call GC with incorrect `snEntry` contents. As a reminder, this is `snEntry`:
```
typedef struct {
StgPtr addr; // Haskell object when entry is in use, next free
// entry (NULL when this is the last free entry)
// otherwise. May be NULL temporarily during GC (when
// pointee dies).
StgPtr old; // Old Haskell object, used during GC
StgClosure *sn_obj; // The StableName object, or NULL when the entry is
// free
} snEntry;
```
In summary, `sn_obj == NULL` means the entry is free. When we trigger the GC
after allocating the `snEntry` but before allocating the `StgStableName`, we end
up calling the GC with `sn_obj == NULL` even though the `snEntry` is not
actually free. In particular, the `addr` field should be updated by
`gcStableNameTable`, but it's currently not because `gcStableNameTable` sees
`sn_obj` as NULL and skips the entry.
The is caught by memo001 when run with -debug.
I already have a fix and will submit a patch soon.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Stable name allocation causes heap corruption when GC is triggered in the primop","status":"New","operating_system":"","component":"Runtime System","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The error is originally reported in #15241, and is caught by the test `memo001`\r\nwhen run with `-debug` (which only happens in sanity way currently).\r\n\r\nHere's the problem. mkStableName# is defined like this:\r\n\r\n{{{\r\nstg_makeStableNamezh ( P_ obj )\r\n{\r\n W_ index, sn_obj;\r\n\r\n (index) = ccall lookupStableName(obj \"ptr\");\r\n\r\n /* Is there already a StableName for this heap object?\r\n * stable_name_table is a pointer to an array of snEntry structs.\r\n */\r\n if ( snEntry_sn_obj(W_[stable_name_table] + index*SIZEOF_snEntry) == NULL ) {\r\n ALLOC_PRIM (SIZEOF_StgStableName); <------------ PROBLEM HERE ----------\r\n sn_obj = Hp - SIZEOF_StgStableName + WDS(1);\r\n SET_HDR(sn_obj, stg_STABLE_NAME_info, CCCS);\r\n StgStableName_sn(sn_obj) = index;\r\n snEntry_sn_obj(W_[stable_name_table] + index*SIZEOF_snEntry) = sn_obj;\r\n } else {\r\n sn_obj = snEntry_sn_obj(W_[stable_name_table] + index*SIZEOF_snEntry);\r\n }\r\n\r\n return (sn_obj);\r\n}\r\n}}}\r\n\r\nThere's a problem in the annotated line: if we allocate a `snEntry` in the\r\nstable name table, but run out of heap to actually allocate the `StgStableName`\r\nwe call GC with incorrect `snEntry` contents. As a reminder, this is `snEntry`:\r\n\r\n{{{\r\ntypedef struct {\r\n StgPtr addr; // Haskell object when entry is in use, next free\r\n // entry (NULL when this is the last free entry)\r\n // otherwise. May be NULL temporarily during GC (when\r\n // pointee dies).\r\n\r\n StgPtr old; // Old Haskell object, used during GC\r\n\r\n StgClosure *sn_obj; // The StableName object, or NULL when the entry is\r\n // free\r\n} snEntry;\r\n}}}\r\n\r\nIn summary, `sn_obj == NULL` means the entry is free. When we trigger the GC\r\nafter allocating the `snEntry` but before allocating the `StgStableName`, we end\r\nup calling the GC with `sn_obj == NULL` even though the `snEntry` is not\r\nactually free. In particular, the `addr` field should be updated by\r\n`gcStableNameTable`, but it's currently not because `gcStableNameTable` sees\r\n`sn_obj` as NULL and skips the entry.\r\n\r\nThe is caught by memo001 when run with -debug.\r\n\r\nI already have a fix and will submit a patch soon.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15892Segmentation fault with ByteString2019-07-07T18:02:33Ztakano-akioSegmentation fault with ByteStringThe attached program consistently segfaults (within a few seconds) when compiled with ghc-8.6.1 or ghc-8.6.2. It runs forever (as expected) when compiled with ghc-8.4.
To reproduce:
```
ghc segfault.hs
```
then,
```
./segfault >/dev/...The attached program consistently segfaults (within a few seconds) when compiled with ghc-8.6.1 or ghc-8.6.2. It runs forever (as expected) when compiled with ghc-8.4.
To reproduce:
```
ghc segfault.hs
```
then,
```
./segfault >/dev/null
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.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":"Segmentation fault with ByteString and -O","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The attached program consistently segfaults (within a few seconds) when compiled with ghc-8.6.1 or ghc-8.6.2. It runs forever (as expected) when compiled with ghc-8.4.\r\n\r\nTo reproduce:\r\n\r\n{{{\r\nghc segfault.hs\r\n}}}\r\n\r\nthen,\r\n\r\n{{{\r\n./segfault >/dev/null\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15870No skolem info panic2019-07-07T18:02:38Zsheafsam.derbyshire@gmail.comNo skolem info panicI've been toying with some type-level lenses and running into some issues with kind unification, when I ran into a panic:
```
bug.hs:30:34: error:ghc.exe: panic! (the 'impossible' happened)
(GHC version 8.6.2 for x86_64-unknown-mingw3...I've been toying with some type-level lenses and running into some issues with kind unification, when I ran into a panic:
```
bug.hs:30:34: error:ghc.exe: panic! (the 'impossible' happened)
(GHC version 8.6.2 for x86_64-unknown-mingw32):
No skolem info:
[k_a1Hgj]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler\utils\Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler\\typecheck\\TcErrors.hs:2891:5 in ghc:TcErrors
```
Here's a boiled down version (with a bit of extraneous code left in for context, as it's so short):
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
data Optic a where
--Index :: Nat -> Optic a
--Name :: Symbol -> Optic a
(:.:) :: Optic a -> Optic b -> Optic a -- composition
class Gettable a (optic :: Optic a) where
type Get a (optic :: Optic a)
{-
some basic instances, e.g.
instance Gettable (a,b) (Index 0) where
type Get (a,b) (Index 0) = a
...
-}
instance forall a b (g1 :: Optic a) (g2 :: Optic b).
( Gettable a g1
, b ~ Get a g1
, Gettable b g2
) => Gettable a (g1 :.: g2) where
type Get a (g1 :.: g2) = Get a g2
```
The program I am actually trying to write has the instance declaration changed to
```hs
instance forall a b (g1 :: Optic a) (g2 :: Optic (Get a g1)).
( Gettable a g1
, b ~ Get a g1
, Gettable b g2
) => Gettable a (g1 :.: g2) where
type Get a (g1 :.: g2) = Get (Get a g1) g2
```
but GHC complains that it can't match kinds:
```
• Expected kind ‘Optic b’, but ‘g2’ has kind ‘Optic (Get a g1)’
• In the second argument of ‘Gettable’, namely ‘g2’
In the instance declaration for ‘Gettable a (g1 :.: g2)’
|
20 | , Gettable b g2
|
```
I don't know if there is a way around that, and I'd be interested to hear any advice.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.6.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"No skolem info panic","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I've been toying with some type-level lenses and running into some issues with kind unification, when I ran into a panic:\r\n\r\n\r\n{{{\r\nbug.hs:30:34: error:ghc.exe: panic! (the 'impossible' happened)\r\n (GHC version 8.6.2 for x86_64-unknown-mingw32):\r\n No skolem info:\r\n [k_a1Hgj]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler\\utils\\Outputable.hs:1160:37 in ghc:Outputable\r\n pprPanic, called at compiler\\\\typecheck\\\\TcErrors.hs:2891:5 in ghc:TcErrors\r\n}}}\r\n\r\nHere's a boiled down version (with a bit of extraneous code left in for context, as it's so short):\r\n{{{#!hs\r\n{-# LANGUAGE DataKinds #-}\r\n{-# LANGUAGE FlexibleInstances #-}\r\n{-# LANGUAGE GADTs #-}\r\n{-# LANGUAGE MultiParamTypeClasses #-}\r\n{-# LANGUAGE PolyKinds #-}\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE TypeOperators #-}\r\n\r\ndata Optic a where\r\n --Index :: Nat -> Optic a\r\n --Name :: Symbol -> Optic a\r\n (:.:) :: Optic a -> Optic b -> Optic a -- composition\r\n\r\nclass Gettable a (optic :: Optic a) where\r\n type Get a (optic :: Optic a)\r\n\r\n{-\r\nsome basic instances, e.g.\r\ninstance Gettable (a,b) (Index 0) where\r\n type Get (a,b) (Index 0) = a\r\n...\r\n-}\r\n\r\ninstance forall a b (g1 :: Optic a) (g2 :: Optic b).\r\n ( Gettable a g1\r\n , b ~ Get a g1\r\n , Gettable b g2\r\n ) => Gettable a (g1 :.: g2) where\r\n type Get a (g1 :.: g2) = Get a g2\r\n}}}\r\n\r\nThe program I am actually trying to write has the instance declaration changed to\r\n{{{#!hs\r\ninstance forall a b (g1 :: Optic a) (g2 :: Optic (Get a g1)).\r\n ( Gettable a g1\r\n , b ~ Get a g1\r\n , Gettable b g2\r\n ) => Gettable a (g1 :.: g2) where\r\n type Get a (g1 :.: g2) = Get (Get a g1) g2\r\n}}}\r\nbut GHC complains that it can't match kinds:\r\n\r\n{{{\r\n • Expected kind ‘Optic b’, but ‘g2’ has kind ‘Optic (Get a g1)’\r\n • In the second argument of ‘Gettable’, namely ‘g2’\r\n In the instance declaration for ‘Gettable a (g1 :.: g2)’\r\n |\r\n20 | , Gettable b g2\r\n |\r\n}}}\r\nI don't know if there is a way around that, and I'd be interested to hear any advice.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15404ghc-8.6 uninstallable on macos due to hard coded libgmp directory2019-07-07T18:05:04ZTrevor L. McDonellghc-8.6 uninstallable on macos due to hard coded libgmp directoryIt is very difficult to install the ghc-8.6.1 release candidates (both RC1 and RC2) on MacOS because several components attempt to link directly to `/usr/local/opt/gmp/lib/libgmp.10.dylib`. This is not a standard path.
See the offending...It is very difficult to install the ghc-8.6.1 release candidates (both RC1 and RC2) on MacOS because several components attempt to link directly to `/usr/local/opt/gmp/lib/libgmp.10.dylib`. This is not a standard path.
See the offending `LC_LOAD_DYLIB` command here:
```
$ jtool -l libraries/base/dist-install/build/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib
LC 00: LC_SEGMENT_64 Mem: 0x000000000-0x4e1000 __TEXT
Mem: 0x0000010b0-0x0004d12ba __TEXT.__text (Normal)
Mem: 0x0004d12ba-0x0004d1686 __TEXT.__stubs (Symbol Stubs)
Mem: 0x0004d1688-0x0004d1cee __TEXT.__stub_helper (Normal)
Mem: 0x0004d1cee-0x0004df75b __TEXT.__cstring (C-String Literals)
Mem: 0x0004df760-0x0004e0f40 __TEXT.__const
Mem: 0x0004e0f40-0x0004e1000 __TEXT.__unwind_info
LC 01: LC_SEGMENT_64 Mem: 0x0004e1000-0x5a7000 __DATA
Mem: 0x0004e1000-0x0004e30f0 __DATA.__got (Non-Lazy Symbol Ptrs)
Mem: 0x0004e30f0-0x0004e3100 __DATA.__nl_symbol_ptr (Non-Lazy Symbol Ptrs)
Mem: 0x0004e3100-0x0004e3610 __DATA.__la_symbol_ptr (Lazy Symbol Ptrs)
Mem: 0x0004e3610-0x0004e3618 __DATA.__mod_init_func (Module Init Function Ptrs)
Mem: 0x0004e3620-0x0004f4bc0 __DATA.__const
Mem: 0x0004f4bc0-0x0005a6920 __DATA.__data
Mem: 0x0005a6920-0x0005a6928 __DATA.__bss (Zero Fill)
LC 02: LC_SEGMENT_64 Mem: 0x0005a7000-0xb8c000 __LINKEDIT
LC 03: LC_ID_DYLIB @rpath/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib
LC 04: LC_DYLD_INFO
LC 05: LC_SYMTAB
Symbol table is at offset 0x6a5348 (6968136), 118090 entries
String table is at offset 0x873d78 (8863096), 3241616 bytes
LC 06: LC_DYSYMTAB
81438 local symbols at index 0
35948 external symbols at index 81438
704 undefined symbols at index 117386
No TOC
No modtab
1380 Indirect symbols at offset 0x8727e8
LC 07: LC_UUID UUID: B4C0C347-131F-317B-BA52-EE23F5C5CABA
LC 08: LC_VERSION_MIN_MACOSX Minimum OS X version: 10.12.0
LC 09: LC_SOURCE_VERSION Source Version: 0.0.0.0.0
LC 10: LC_LOAD_DYLIB /usr/lib/libiconv.2.dylib
LC 11: LC_LOAD_DYLIB @rpath/libHSinteger-gmp-1.0.2.0-ghc8.6.0.20180714.dylib
LC 12: LC_LOAD_DYLIB @rpath/libHSghc-prim-0.5.3-ghc8.6.0.20180714.dylib
LC 13: LC_LOAD_DYLIB /usr/local/opt/gmp/lib/libgmp.10.dylib
LC 14: LC_LOAD_DYLIB /usr/lib/libSystem.B.dylib
LC 15: LC_RPATH @loader_path/../integer-gmp-1.0.2.0
LC 16: LC_RPATH @loader_path/../ghc-prim-0.5.3
LC 17: LC_RPATH @loader_path/../rts
LC 18: LC_FUNCTION_STARTS Offset: 6876632, Size: 91504 (0x68edd8-0x6a5348) with 83924 functions
LC 19: LC_DATA_IN_CODE Offset: 6968136, Size: 0 (0x6a5348-0x6a5348)
```
The other offenders are `libHSbinary` and `libHSinteger-gmp`.
Without changing these load commands, you'll get the following error:
```
$ ./configure --prefix=...
$ make install
<snip>
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
Referenced from: ./libraries/base/dist-install/build/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib
Reason: image not found
make[1]: *** [install_packages] Abort trap: 6
make: *** [install] Error 2
```
I tried passing the `--with-gmp-libraries` option to `configure`, but that did not help.
I guess this is just a packaging problem, but figured you should be aware before the official release...
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | None |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghc-8.6 uninstallable on macos due to hard coded libgmp directory","status":"New","operating_system":"","component":"None","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"It is very difficult to install the ghc-8.6.1 release candidates (both RC1 and RC2) on MacOS because several components attempt to link directly to `/usr/local/opt/gmp/lib/libgmp.10.dylib`. This is not a standard path.\r\n\r\nSee the offending `LC_LOAD_DYLIB` command here:\r\n\r\n{{{\r\n$ jtool -l libraries/base/dist-install/build/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib\r\nLC 00: LC_SEGMENT_64 Mem: 0x000000000-0x4e1000 __TEXT\r\n Mem: 0x0000010b0-0x0004d12ba __TEXT.__text (Normal)\r\n Mem: 0x0004d12ba-0x0004d1686 __TEXT.__stubs (Symbol Stubs)\r\n Mem: 0x0004d1688-0x0004d1cee __TEXT.__stub_helper (Normal)\r\n Mem: 0x0004d1cee-0x0004df75b __TEXT.__cstring (C-String Literals)\r\n Mem: 0x0004df760-0x0004e0f40 __TEXT.__const\r\n Mem: 0x0004e0f40-0x0004e1000 __TEXT.__unwind_info\r\nLC 01: LC_SEGMENT_64 Mem: 0x0004e1000-0x5a7000 __DATA\r\n Mem: 0x0004e1000-0x0004e30f0 __DATA.__got (Non-Lazy Symbol Ptrs)\r\n Mem: 0x0004e30f0-0x0004e3100 __DATA.__nl_symbol_ptr (Non-Lazy Symbol Ptrs)\r\n Mem: 0x0004e3100-0x0004e3610 __DATA.__la_symbol_ptr (Lazy Symbol Ptrs)\r\n Mem: 0x0004e3610-0x0004e3618 __DATA.__mod_init_func (Module Init Function Ptrs)\r\n Mem: 0x0004e3620-0x0004f4bc0 __DATA.__const\r\n Mem: 0x0004f4bc0-0x0005a6920 __DATA.__data\r\n Mem: 0x0005a6920-0x0005a6928 __DATA.__bss (Zero Fill)\r\nLC 02: LC_SEGMENT_64 Mem: 0x0005a7000-0xb8c000 __LINKEDIT\r\nLC 03: LC_ID_DYLIB @rpath/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib\r\nLC 04: LC_DYLD_INFO\r\nLC 05: LC_SYMTAB\r\n Symbol table is at offset 0x6a5348 (6968136), 118090 entries\r\n String table is at offset 0x873d78 (8863096), 3241616 bytes\r\nLC 06: LC_DYSYMTAB\r\n 81438 local symbols at index 0\r\n 35948 external symbols at index 81438\r\n 704 undefined symbols at index 117386\r\n No TOC\r\n No modtab\r\n 1380 Indirect symbols at offset 0x8727e8\r\n\r\nLC 07: LC_UUID UUID: B4C0C347-131F-317B-BA52-EE23F5C5CABA\r\nLC 08: LC_VERSION_MIN_MACOSX Minimum OS X version: 10.12.0\r\nLC 09: LC_SOURCE_VERSION Source Version: 0.0.0.0.0\r\nLC 10: LC_LOAD_DYLIB /usr/lib/libiconv.2.dylib\r\nLC 11: LC_LOAD_DYLIB @rpath/libHSinteger-gmp-1.0.2.0-ghc8.6.0.20180714.dylib\r\nLC 12: LC_LOAD_DYLIB @rpath/libHSghc-prim-0.5.3-ghc8.6.0.20180714.dylib\r\nLC 13: LC_LOAD_DYLIB /usr/local/opt/gmp/lib/libgmp.10.dylib\r\nLC 14: LC_LOAD_DYLIB /usr/lib/libSystem.B.dylib\r\nLC 15: LC_RPATH @loader_path/../integer-gmp-1.0.2.0\r\nLC 16: LC_RPATH @loader_path/../ghc-prim-0.5.3\r\nLC 17: LC_RPATH @loader_path/../rts\r\nLC 18: LC_FUNCTION_STARTS Offset: 6876632, Size: 91504 (0x68edd8-0x6a5348) with 83924 functions\r\nLC 19: LC_DATA_IN_CODE Offset: 6968136, Size: 0 (0x6a5348-0x6a5348)\r\n}}}\r\n\r\nThe other offenders are `libHSbinary` and `libHSinteger-gmp`.\r\n\r\nWithout changing these load commands, you'll get the following error:\r\n\r\n{{{\r\n$ ./configure --prefix=...\r\n$ make install\r\n<snip>\r\ndyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib\r\n Referenced from: ./libraries/base/dist-install/build/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib\r\n Reason: image not found\r\nmake[1]: *** [install_packages] Abort trap: 6\r\nmake: *** [install] Error 2\r\n}}}\r\n\r\nI tried passing the `--with-gmp-libraries` option to `configure`, but that did not help.\r\n\r\nI guess this is just a packaging problem, but figured you should be aware before the official release...","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/17766got an error when profile memory using -hr2020-01-31T00:04:41ZXiaoninggot an error when profile memory using -hr# compile
```
ghc -O2 -w -rtsopts -prof Main
```
# run
```
./Main -tcount w45.log -identity 45 -order wire ./$1 +RTS -A4M -H1G -s -p -hr
```
# error
```
Main: internal error: Invalid object in isRetainer(): 64
(GHC version 8.0.2 fo...# compile
```
ghc -O2 -w -rtsopts -prof Main
```
# run
```
./Main -tcount w45.log -identity 45 -order wire ./$1 +RTS -A4M -H1G -s -p -hr
```
# error
```
Main: internal error: Invalid object in isRetainer(): 64
(GHC version 8.0.2 for x86_64_unknown_linux)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
# this run works (-hr => -h)
```
./Main -tcount w45.log -identity 45 -order wire ./$1 +RTS -A4M -H1G -s -p -h
```8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/16020Hadrian: correctly Install libffi shared object files2019-07-07T18:01:59ZdavideHadrian: correctly Install libffi shared object filesIn [D5423](https://phabricator.haskell.org/D5423) a hack to correctly install the libffi .so files is implemented. This is a quick and dirty solution to fix the hadrian build. Note \[Hadrian: install libffi hack\] from that patch and als...In [D5423](https://phabricator.haskell.org/D5423) a hack to correctly install the libffi .so files is implemented. This is a quick and dirty solution to fix the hadrian build. Note \[Hadrian: install libffi hack\] from that patch and also issue #15837 have more details, but ultimately hadrian should not have a special case for libffi.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------------- |
| Version | 8.6.2 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Build System (Hadrian) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Hadrian: correctly Install libffi shared object files","status":"New","operating_system":"","component":"Build System (Hadrian)","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"In Phab:D5423 a hack to correctly install the libffi .so files is implemented. This is a quick and dirty solution to fix the hadrian build. Note [Hadrian: install libffi hack] from that patch and also issue #15837 have more details, but ultimately hadrian should not have a special case for libffi.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3davidedavidehttps://gitlab.haskell.org/ghc/ghc/-/issues/16017ghc-8.6.1 and ghc-8.6.2 use a lot of memory2019-08-27T08:57:19ZJohn Kyghc-8.6.1 and ghc-8.6.2 use a lot of memoryCurrently GHC uses a lot of memory to build a relatively small module and causes my CI to fail due to there being a 4G memory limit.
The source code can be found here:
https://github.com/haskell-works/hw-json/tree/73368cee21dc72eedd529...Currently GHC uses a lot of memory to build a relatively small module and causes my CI to fail due to there being a 4G memory limit.
The source code can be found here:
https://github.com/haskell-works/hw-json/tree/73368cee21dc72eedd5291ba689f9abf10e7fcd2
The problem module is here:
https://github.com/haskell-works/hw-json/blob/73368cee21dc72eedd5291ba689f9abf10e7fcd2/test/HaskellWorks/Data/Json/Backend/Standard/Succinct/CursorSpec.hs
The build output follows:
```
cabal new-build --enable-tests --enable-benchmarks --project-file="cabal.project" -j${CABAL_THREADS:-4} all
Build profile: -w ghc-8.6.2 -O2
In order, the following will be built (use -v for more details):
- hw-json-0.9.0.1 (lib) (first run)
- hw-json-0.9.0.1 (test:hw-json-test) (first run)
- hw-json-0.9.0.1 (exe:hw-json) (first run)
- hw-json-0.9.0.1 (bench:bench) (first run)
Configuring library for hw-json-0.9.0.1..
Preprocessing library for hw-json-0.9.0.1..
Building library for hw-json-0.9.0.1..
[ 1 of 32] Compiling HaskellWorks.Data.Json.DecodeError ( src/HaskellWorks/Data/Json/DecodeError.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/DecodeError.o )
[ 2 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.MakeIndex ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/MakeIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/MakeIndex.o )
[ 3 of 32] Compiling HaskellWorks.Data.Json.Internal.Index ( src/HaskellWorks/Data/Json/Internal/Index.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Index.o )
[ 4 of 32] Compiling HaskellWorks.Data.Json.Internal.PartialIndex ( src/HaskellWorks/Data/Json/Internal/PartialIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/PartialIndex.o )
[ 5 of 32] Compiling HaskellWorks.Data.Json.Internal.Token.Types ( src/HaskellWorks/Data/Json/Internal/Token/Types.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Token/Types.o )
[ 6 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.Token.Tokenize ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/Token/Tokenize.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/Token/Tokenize.o )
[ 7 of 32] Compiling HaskellWorks.Data.Json.Internal.Token ( src/HaskellWorks/Data/Json/Internal/Token.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Token.o )
[ 8 of 32] Compiling HaskellWorks.Data.Json.Internal.Value ( src/HaskellWorks/Data/Json/Internal/Value.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Value.o )
[ 9 of 32] Compiling HaskellWorks.Data.Json.Internal.Word8 ( src/HaskellWorks/Data/Json/Internal/Word8.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Word8.o )
[10 of 32] Compiling HaskellWorks.Data.Json.Internal.Word64 ( src/HaskellWorks/Data/Json/Internal/Word64.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Word64.o )
[11 of 32] Compiling HaskellWorks.Data.Json.Internal.CharLike ( src/HaskellWorks/Data/Json/Internal/CharLike.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/CharLike.o )
[12 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.Blank ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/Blank.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/Blank.o )
[13 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.BlankedJson ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/BlankedJson.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/BlankedJson.o )
[14 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.ToInterestBits64 ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/ToInterestBits64.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/ToInterestBits64.o )
[15 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.ToBalancedParens64 ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/ToBalancedParens64.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/ToBalancedParens64.o )
[16 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.IbBp ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/IbBp.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/IbBp.o )
[17 of 32] Compiling HaskellWorks.Data.Json.Backend.Standard.SemiIndex ( src/HaskellWorks/Data/Json/Backend/Standard/SemiIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Standard/SemiIndex.o )
[18 of 32] Compiling HaskellWorks.Data.Json.Backend.Simple.SemiIndex ( src/HaskellWorks/Data/Json/Backend/Simple/SemiIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Simple/SemiIndex.o )
[19 of 32] Compiling HaskellWorks.Data.Json.LightJson ( src/HaskellWorks/Data/Json/LightJson.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/LightJson.o )
[20 of 32] Compiling HaskellWorks.Data.Json.PartialValue ( src/HaskellWorks/Data/Json/PartialValue.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/PartialValue.o )
[21 of 32] Compiling HaskellWorks.Data.Json.Type ( src/HaskellWorks/Data/Json/Type.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Type.o )
[22 of 32] Compiling HaskellWorks.Data.Json.Backend.Standard.Cursor ( src/HaskellWorks/Data/Json/Backend/Standard/Cursor.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Standard/Cursor.o )
[23 of 32] Compiling HaskellWorks.Data.Json.Cursor ( src/HaskellWorks/Data/Json/Cursor.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Cursor.o )
[24 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.Cursor.Token ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/Cursor/Token.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/Cursor/Token.o )
[25 of 32] Compiling HaskellWorks.Data.Json.Value ( src/HaskellWorks/Data/Json/Value.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Value.o )
[26 of 32] Compiling HaskellWorks.Data.Json.FromValue ( src/HaskellWorks/Data/Json/FromValue.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/FromValue.o )
[27 of 32] Compiling HaskellWorks.Data.Json.Backend.Standard.LoadCursor ( src/HaskellWorks/Data/Json/Backend/Standard/LoadCursor.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Standard/LoadCursor.o )
[28 of 32] Compiling HaskellWorks.Data.Json.LoadCursor ( src/HaskellWorks/Data/Json/LoadCursor.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/LoadCursor.o )
[29 of 32] Compiling HaskellWorks.Data.Json.Backend.Standard.Load ( src/HaskellWorks/Data/Json/Backend/Standard/Load.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Standard/Load.o )
[30 of 32] Compiling HaskellWorks.Data.Json.Load ( src/HaskellWorks/Data/Json/Load.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Load.o )
[31 of 32] Compiling HaskellWorks.Data.Json ( src/HaskellWorks/Data/Json.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json.o )
[32 of 32] Compiling Paths_hw_json ( /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/autogen/Paths_hw_json.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/Paths_hw_json.o )
Configuring test suite 'hw-json-test' for hw-json-0.9.0.1..
Configuring benchmark 'bench' for hw-json-0.9.0.1..
Configuring executable 'hw-json' for hw-json-0.9.0.1..
Preprocessing test suite 'hw-json-test' for hw-json-0.9.0.1..
Building test suite 'hw-json-test' for hw-json-0.9.0.1..
Preprocessing executable 'hw-json' for hw-json-0.9.0.1..
Preprocessing benchmark 'bench' for hw-json-0.9.0.1..
Building benchmark 'bench' for hw-json-0.9.0.1..
Building executable 'hw-json' for hw-json-0.9.0.1..
[ 1 of 11] Compiling HaskellWorks.Data.Json.Backend.Standard.Succinct.Cursor.InterestBitsSpec ( test/HaskellWorks/Data/Json/Backend/Standard/Succinct/Cursor/InterestBitsSpec.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/t/hw-json-test/opt/build/hw-json-test/hw-json-test-tmp/HaskellWorks/Data/Json/Backend/Standard/Succinct/Cursor/InterestBitsSpec.o )
[1 of 2] Compiling Main ( bench/Main.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/b/bench/opt/build/bench/bench-tmp/Main.o )
[1 of 7] Compiling App.Commands.Types ( app/App/Commands/Types.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Commands/Types.o )
[2 of 7] Compiling App.Lens ( app/App/Lens.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Lens.o )
[3 of 7] Compiling App.Commands.Demo ( app/App/Commands/Demo.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Commands/Demo.o )
[2 of 2] Compiling Paths_hw_json ( /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/b/bench/opt/build/bench/autogen/Paths_hw_json.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/b/bench/opt/build/bench/bench-tmp/Paths_hw_json.o )
Linking /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/b/bench/opt/build/bench/bench ...
[4 of 7] Compiling App.Commands.CreateIndex ( app/App/Commands/CreateIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Commands/CreateIndex.o )
[5 of 7] Compiling App.Commands ( app/App/Commands.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Commands.o )
[ 2 of 11] Compiling HaskellWorks.Data.Json.Backend.Standard.Succinct.CursorSpec ( test/HaskellWorks/Data/Json/Backend/Standard/Succinct/CursorSpec.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/t/hw-json-test/opt/build/hw-json-test/hw-json-test-tmp/HaskellWorks/Data/Json/Backend/Standard/Succinct/CursorSpec.o )
[6 of 7] Compiling Main ( app/Main.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/Main.o )
[7 of 7] Compiling Paths_hw_json ( /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/autogen/Paths_hw_json.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/Paths_hw_json.o )
Linking /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json ...
cabal: Failed to build test:hw-json-test from hw-json-0.9.0.1. The build
process was killed (i.e. SIGKILL). The typical reason for this is that there
is not enough memory available (e.g. the OS killed a process using lots of
memory).
Exited with code 1
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.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-8.6.1 and ghc-8.6.2 use a log of memory","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Currently GHC uses a lot of memory to build a relatively small module and causes my CI to fail due to there being a 4G memory limit.\r\n\r\nThe source code can be found here:\r\n\r\nhttps://github.com/haskell-works/hw-json/tree/73368cee21dc72eedd5291ba689f9abf10e7fcd2\r\n\r\nThe problem module is here:\r\n\r\nhttps://github.com/haskell-works/hw-json/blob/73368cee21dc72eedd5291ba689f9abf10e7fcd2/test/HaskellWorks/Data/Json/Backend/Standard/Succinct/CursorSpec.hs\r\n\r\nThe build output follows:\r\n\r\n{{{\r\ncabal new-build --enable-tests --enable-benchmarks --project-file=\"cabal.project\" -j${CABAL_THREADS:-4} all\r\nBuild profile: -w ghc-8.6.2 -O2\r\nIn order, the following will be built (use -v for more details):\r\n - hw-json-0.9.0.1 (lib) (first run)\r\n - hw-json-0.9.0.1 (test:hw-json-test) (first run)\r\n - hw-json-0.9.0.1 (exe:hw-json) (first run)\r\n - hw-json-0.9.0.1 (bench:bench) (first run)\r\nConfiguring library for hw-json-0.9.0.1..\r\nPreprocessing library for hw-json-0.9.0.1..\r\nBuilding library for hw-json-0.9.0.1..\r\n[ 1 of 32] Compiling HaskellWorks.Data.Json.DecodeError ( src/HaskellWorks/Data/Json/DecodeError.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/DecodeError.o )\r\n[ 2 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.MakeIndex ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/MakeIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/MakeIndex.o )\r\n[ 3 of 32] Compiling HaskellWorks.Data.Json.Internal.Index ( src/HaskellWorks/Data/Json/Internal/Index.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Index.o )\r\n[ 4 of 32] Compiling HaskellWorks.Data.Json.Internal.PartialIndex ( src/HaskellWorks/Data/Json/Internal/PartialIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/PartialIndex.o )\r\n[ 5 of 32] Compiling HaskellWorks.Data.Json.Internal.Token.Types ( src/HaskellWorks/Data/Json/Internal/Token/Types.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Token/Types.o )\r\n[ 6 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.Token.Tokenize ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/Token/Tokenize.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/Token/Tokenize.o )\r\n[ 7 of 32] Compiling HaskellWorks.Data.Json.Internal.Token ( src/HaskellWorks/Data/Json/Internal/Token.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Token.o )\r\n[ 8 of 32] Compiling HaskellWorks.Data.Json.Internal.Value ( src/HaskellWorks/Data/Json/Internal/Value.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Value.o )\r\n[ 9 of 32] Compiling HaskellWorks.Data.Json.Internal.Word8 ( src/HaskellWorks/Data/Json/Internal/Word8.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Word8.o )\r\n[10 of 32] Compiling HaskellWorks.Data.Json.Internal.Word64 ( src/HaskellWorks/Data/Json/Internal/Word64.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Word64.o )\r\n[11 of 32] Compiling HaskellWorks.Data.Json.Internal.CharLike ( src/HaskellWorks/Data/Json/Internal/CharLike.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/CharLike.o )\r\n[12 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.Blank ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/Blank.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/Blank.o )\r\n[13 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.BlankedJson ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/BlankedJson.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/BlankedJson.o )\r\n[14 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.ToInterestBits64 ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/ToInterestBits64.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/ToInterestBits64.o )\r\n[15 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.ToBalancedParens64 ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/ToBalancedParens64.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/ToBalancedParens64.o )\r\n[16 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.IbBp ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/IbBp.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/IbBp.o )\r\n[17 of 32] Compiling HaskellWorks.Data.Json.Backend.Standard.SemiIndex ( src/HaskellWorks/Data/Json/Backend/Standard/SemiIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Standard/SemiIndex.o )\r\n[18 of 32] Compiling HaskellWorks.Data.Json.Backend.Simple.SemiIndex ( src/HaskellWorks/Data/Json/Backend/Simple/SemiIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Simple/SemiIndex.o )\r\n[19 of 32] Compiling HaskellWorks.Data.Json.LightJson ( src/HaskellWorks/Data/Json/LightJson.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/LightJson.o )\r\n[20 of 32] Compiling HaskellWorks.Data.Json.PartialValue ( src/HaskellWorks/Data/Json/PartialValue.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/PartialValue.o )\r\n[21 of 32] Compiling HaskellWorks.Data.Json.Type ( src/HaskellWorks/Data/Json/Type.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Type.o )\r\n[22 of 32] Compiling HaskellWorks.Data.Json.Backend.Standard.Cursor ( src/HaskellWorks/Data/Json/Backend/Standard/Cursor.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Standard/Cursor.o )\r\n[23 of 32] Compiling HaskellWorks.Data.Json.Cursor ( src/HaskellWorks/Data/Json/Cursor.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Cursor.o )\r\n[24 of 32] Compiling HaskellWorks.Data.Json.Internal.Backend.Standard.Cursor.Token ( src/HaskellWorks/Data/Json/Internal/Backend/Standard/Cursor/Token.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Internal/Backend/Standard/Cursor/Token.o )\r\n[25 of 32] Compiling HaskellWorks.Data.Json.Value ( src/HaskellWorks/Data/Json/Value.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Value.o )\r\n[26 of 32] Compiling HaskellWorks.Data.Json.FromValue ( src/HaskellWorks/Data/Json/FromValue.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/FromValue.o )\r\n[27 of 32] Compiling HaskellWorks.Data.Json.Backend.Standard.LoadCursor ( src/HaskellWorks/Data/Json/Backend/Standard/LoadCursor.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Standard/LoadCursor.o )\r\n[28 of 32] Compiling HaskellWorks.Data.Json.LoadCursor ( src/HaskellWorks/Data/Json/LoadCursor.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/LoadCursor.o )\r\n[29 of 32] Compiling HaskellWorks.Data.Json.Backend.Standard.Load ( src/HaskellWorks/Data/Json/Backend/Standard/Load.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Backend/Standard/Load.o )\r\n[30 of 32] Compiling HaskellWorks.Data.Json.Load ( src/HaskellWorks/Data/Json/Load.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json/Load.o )\r\n[31 of 32] Compiling HaskellWorks.Data.Json ( src/HaskellWorks/Data/Json.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/HaskellWorks/Data/Json.o )\r\n[32 of 32] Compiling Paths_hw_json ( /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/autogen/Paths_hw_json.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/opt/build/Paths_hw_json.o )\r\nConfiguring test suite 'hw-json-test' for hw-json-0.9.0.1..\r\nConfiguring benchmark 'bench' for hw-json-0.9.0.1..\r\nConfiguring executable 'hw-json' for hw-json-0.9.0.1..\r\nPreprocessing test suite 'hw-json-test' for hw-json-0.9.0.1..\r\nBuilding test suite 'hw-json-test' for hw-json-0.9.0.1..\r\nPreprocessing executable 'hw-json' for hw-json-0.9.0.1..\r\nPreprocessing benchmark 'bench' for hw-json-0.9.0.1..\r\nBuilding benchmark 'bench' for hw-json-0.9.0.1..\r\nBuilding executable 'hw-json' for hw-json-0.9.0.1..\r\n[ 1 of 11] Compiling HaskellWorks.Data.Json.Backend.Standard.Succinct.Cursor.InterestBitsSpec ( test/HaskellWorks/Data/Json/Backend/Standard/Succinct/Cursor/InterestBitsSpec.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/t/hw-json-test/opt/build/hw-json-test/hw-json-test-tmp/HaskellWorks/Data/Json/Backend/Standard/Succinct/Cursor/InterestBitsSpec.o )\r\n[1 of 2] Compiling Main ( bench/Main.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/b/bench/opt/build/bench/bench-tmp/Main.o )\r\n[1 of 7] Compiling App.Commands.Types ( app/App/Commands/Types.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Commands/Types.o )\r\n[2 of 7] Compiling App.Lens ( app/App/Lens.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Lens.o )\r\n[3 of 7] Compiling App.Commands.Demo ( app/App/Commands/Demo.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Commands/Demo.o )\r\n[2 of 2] Compiling Paths_hw_json ( /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/b/bench/opt/build/bench/autogen/Paths_hw_json.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/b/bench/opt/build/bench/bench-tmp/Paths_hw_json.o )\r\nLinking /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/b/bench/opt/build/bench/bench ...\r\n[4 of 7] Compiling App.Commands.CreateIndex ( app/App/Commands/CreateIndex.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Commands/CreateIndex.o )\r\n[5 of 7] Compiling App.Commands ( app/App/Commands.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/App/Commands.o )\r\n[ 2 of 11] Compiling HaskellWorks.Data.Json.Backend.Standard.Succinct.CursorSpec ( test/HaskellWorks/Data/Json/Backend/Standard/Succinct/CursorSpec.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/t/hw-json-test/opt/build/hw-json-test/hw-json-test-tmp/HaskellWorks/Data/Json/Backend/Standard/Succinct/CursorSpec.o )\r\n[6 of 7] Compiling Main ( app/Main.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/Main.o )\r\n[7 of 7] Compiling Paths_hw_json ( /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/autogen/Paths_hw_json.hs, /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json-tmp/Paths_hw_json.o )\r\nLinking /root/project/dist-newstyle/build/x86_64-linux/ghc-8.6.2/hw-json-0.9.0.1/x/hw-json/opt/build/hw-json/hw-json ...\r\ncabal: Failed to build test:hw-json-test from hw-json-0.9.0.1. The build\r\nprocess was killed (i.e. SIGKILL). The typical reason for this is that there\r\nis not enough memory available (e.g. the OS killed a process using lots of\r\nmemory).\r\n\r\nExited with code 1\r\n}}}\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3Alp MestanogullariAlp Mestanogullarihttps://gitlab.haskell.org/ghc/ghc/-/issues/15923Skip performance tests if not in a git repo2019-07-07T18:02:26ZdavideSkip performance tests if not in a git repoAs of #12758 performance tests now compare to the results of the previous commit. Results are stored in git notes. If for some reason the rood directory is not a git repo, we have no results to compare to, nor can we save the new results...As of #12758 performance tests now compare to the results of the previous commit. Results are stored in git notes. If for some reason the rood directory is not a git repo, we have no results to compare to, nor can we save the new results to git notes. Hence we should skip all performance tests.
Such a use case was encountered in simonpj's workflow where he copies/syslinks the work tree without the .git directory before validating. An open question is can we allow performance testing while not in a git repo or by adjusting the workflow?
Tasks:
- When the ghc root directory is not a git repository, skip all performance tests.
- Update the [wiki page](https://ghc.haskell.org/trac/ghc/wiki/Performance/Tests).
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Test Suite |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | simonpj |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Skip performance tests if not in a git repo","status":"New","operating_system":"","component":"Test Suite","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":["git","notes","performance","tests"],"differentials":[],"test_case":"","architecture":"","cc":["simonpj"],"type":"Bug","description":"As of #12758 performance tests now compare to the results of the previous commit. Results are stored in git notes. If for some reason the rood directory is not a git repo, we have no results to compare to, nor can we save the new results to git notes. Hence we should skip all performance tests.\r\n\r\nSuch a use case was encountered in simonpj's workflow where he copies/syslinks the work tree without the .git directory before validating. An open question is can we allow performance testing while not in a git repo or by adjusting the workflow?\r\n\r\nTasks:\r\n* When the ghc root directory is not a git repository, skip all performance tests.\r\n* Update the [https://ghc.haskell.org/trac/ghc/wiki/Performance/Tests wiki page].","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3davidedavidehttps://gitlab.haskell.org/ghc/ghc/-/issues/15780ghc-8.4.4 failed to build on armv7 and aarch642019-07-07T18:03:02ZJens Petersenghc-8.4.4 failed to build on armv7 and aarch64ghc-8.4.4 is failing to build for me on Fedora ARM archs (both 32bit and 64bit).
https://koji.fedoraproject.org/koji/taskinfo?taskID=30284522
They both fail in the same way:
```
"inplace/bin/ghc-stage1" -static -H32m -O -Wall -Iinc...ghc-8.4.4 is failing to build for me on Fedora ARM archs (both 32bit and 64bit).
https://koji.fedoraproject.org/koji/taskinfo?taskID=30284522
They both fail in the same way:
```
"inplace/bin/ghc-stage1" -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -dcmm-lint -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/HeapStackCheck.cmm -o rts/dist/build/HeapStackCheck.o
"inplace/bin/ghc-stage1" -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -dcmm-lint -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/StgMiscClosures.cmm -o rts/dist/build/StgMiscClosures.o
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 8.4.4 for aarch64-unknown-linux):
padLiveArgs -- i > regNum ??
CallStack (from HasCallStack):
error, called at compiler/llvmGen/LlvmCodeGen/Base.hs:194:27 in ghc:LlvmCodeGen.Base
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
make[1]: *** [rts/ghc.mk:295: rts/dist/build/HeapStackCheck.o] Error 1
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.4 |
| 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-8.4.4 failed to build on armv7 and aarch64","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.4","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"ghc-8.4.4 is failing to build for me on Fedora ARM archs (both 32bit and 64bit).\r\n\r\nhttps://koji.fedoraproject.org/koji/taskinfo?taskID=30284522\r\n\r\nThey both fail in the same way:\r\n{{{\r\n\"inplace/bin/ghc-stage1\" -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -dcmm-lint -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/HeapStackCheck.cmm -o rts/dist/build/HeapStackCheck.o\r\n\"inplace/bin/ghc-stage1\" -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-unit-id rts -dcmm-lint -i -irts -irts/dist/build -Irts/dist/build -irts/dist/build/./autogen -Irts/dist/build/./autogen -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/StgMiscClosures.cmm -o rts/dist/build/StgMiscClosures.o\r\nghc-stage1: panic! (the 'impossible' happened)\r\n (GHC version 8.4.4 for aarch64-unknown-linux):\r\n\tpadLiveArgs -- i > regNum ??\r\nCallStack (from HasCallStack):\r\n error, called at compiler/llvmGen/LlvmCodeGen/Base.hs:194:27 in ghc:LlvmCodeGen.Base\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\nmake[1]: *** [rts/ghc.mk:295: rts/dist/build/HeapStackCheck.o] Error 1\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15105`typecheckModule` from GHC API crashes on MacOS for files with TH2019-07-07T18:14:15ZAlec Theriault`typecheckModule` from GHC API crashes on MacOS for files with THI believe this is the same issue that is causing manually built `haddock` and `doctest` to crash on MacOS when fed TH (originally reported https://github.com/haskell/haddock/issues/767 and https://github.com/sol/doctest/issues/199).
I'v...I believe this is the same issue that is causing manually built `haddock` and `doctest` to crash on MacOS when fed TH (originally reported https://github.com/haskell/haddock/issues/767 and https://github.com/sol/doctest/issues/199).
I've attached a minimal program that uses the GHC API and exhibits the same problem.
```
$ ghc-8.4.2 -package ghc -package containers -package ghc-paths Prog.hs
[1 of 1] Compiling Main ( Prog.hs, Prog.o )
Linking Prog ...
$ ./Prog Main-no-TH.hs -package template-haskell
$ ./Prog Main-TH.hs -package template-haskell
Prog:
lookupSymbol failed in relocateSection (RELOC_GOT)
/usr/local/lib/ghc-8.4.2/integer-gmp-1.0.2.0/HSinteger-gmp-1.0.2.0.o: unknown symbol `___gmp_rands'
Prog: Prog: unable to load package `integer-gmp-1.0.2.0'
```
In case it isn't clear, I do not expect `Main-TH.hs` to crash `Prog`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.4.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHC API |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"`typecheckModule` from GHC API crashes on MacOS for files with TH","status":"New","operating_system":"","component":"GHC API","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I believe this is the same issue that is causing manually built `haddock` and `doctest` to crash on MacOS when fed TH (originally reported https://github.com/haskell/haddock/issues/767 and https://github.com/sol/doctest/issues/199).\r\n\r\nI've attached a minimal program that uses the GHC API and exhibits the same problem.\r\n\r\n{{{\r\n$ ghc-8.4.2 -package ghc -package containers -package ghc-paths Prog.hs\r\n[1 of 1] Compiling Main ( Prog.hs, Prog.o )\r\nLinking Prog ...\r\n$ ./Prog Main-no-TH.hs -package template-haskell\r\n$ ./Prog Main-TH.hs -package template-haskell\r\nProg:\r\nlookupSymbol failed in relocateSection (RELOC_GOT)\r\n/usr/local/lib/ghc-8.4.2/integer-gmp-1.0.2.0/HSinteger-gmp-1.0.2.0.o: unknown symbol `___gmp_rands'\r\nProg: Prog: unable to load package `integer-gmp-1.0.2.0'\r\n}}}\r\n\r\nIn case it isn't clear, I do not expect `Main-TH.hs` to crash `Prog`.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/16029Inadequate absence analysis2019-07-07T18:01:57ZSimon Peyton JonesInadequate absence analysisConsider
```
data S = MkS Int Int
g1 :: S -> Int -> Int
g1 (MkS x y) 0 = 0
g1 (MkS x y) n = g1 (MkS y x) (n-1)
```
With GHC 8.6 we get
```
$wg1 :: S -> GHC.Prim.Int# -> GHC.Prim.Int#
[Str=<S,1*H><S,1*U>]
$wg1 = \ (w_s2oH :: S)
...Consider
```
data S = MkS Int Int
g1 :: S -> Int -> Int
g1 (MkS x y) 0 = 0
g1 (MkS x y) n = g1 (MkS y x) (n-1)
```
With GHC 8.6 we get
```
$wg1 :: S -> GHC.Prim.Int# -> GHC.Prim.Int#
[Str=<S,1*H><S,1*U>]
$wg1 = \ (w_s2oH :: S)
(ww_s2oL :: GHC.Prim.Int#) ->
case w_s2oH of { MkS x_s2pz y_s2pA ->
case ww_s2oL of ds_X2nb {
__DEFAULT ->
Foo.$wg1 (Foo.MkS y_s2pA x_s2pz) (GHC.Prim.-# ds_X2nb 1#);
0# -> 0# }}
g1 :: S -> Int -> Int
[Str=<S,1*H><S(S),1*U(1*U)>m]
g1 = \ (w_s2oH :: S) (w1_s2oI :: Int) ->
case w_s2oH of w2_X2pG { MkS ipv_s2p2 ipv1_s2p3 ->
case w1_s2oI of { GHC.Types.I# ww1_s2oL ->
case Foo.$wg1 w2_X2pG ww1_s2oL of ww2_s2oP { __DEFAULT ->
GHC.Types.I# ww2_s2oP }}}
```
What terrible code! We evaluate the S argument in the wrapper,
and box and unbox it every time around the loop, even though it is never ultimately used.
Here's what happens if the arguments are banged:
```
data T = MkT !Int !Int
g2 :: T -> Int -> Int
g2 (MkT x y) 0 = 0
g2 (MkT x y) n = g2 (MkT y x) (n-1)
```
We get
```
$wg2 GHC.Prim.Int# -> GHC.Prim.Int# -> GHC.Prim.Int# -> GHC.Prim.Int#
[Str=<L,1*U><L,1*U><S,1*U>]
Foo.$wg2 = \ (ww_s2ow :: GHC.Prim.Int#)
(ww1_s2ox :: GHC.Prim.Int#)
(ww2_s2oB :: GHC.Prim.Int#) ->
case ww2_s2oB of ds_X2n0 {
__DEFAULT -> Foo.$wg2 ww1_s2ox ww_s2ow (GHC.Prim.-# ds_X2n0 1#);
0# -> 0# }
g2 :: T -> Int -> Int
[Str=<S(SS),1*U(1*U,1*U)><S(S),1*U(1*U)>m ]
g2 = \ (w_s2os :: T) (w1_s2ot :: Int) ->
case w_s2os of { MkT ww1_s2ow ww2_s2ox ->
case w1_s2ot of { GHC.Types.I# ww4_s2oB ->
case Foo.$wg2 ww1_s2ow ww2_s2ox ww4_s2oB of ww5_s2oF {
__DEFAULT -> GHC.Types.I# ww5_s2oF }}}
```
Still terrible. We pass the two components around the loop before discarding them
at the end.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.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":"Inadequate absence analysis","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Consider\r\n{{{\r\ndata S = MkS Int Int\r\ng1 :: S -> Int -> Int\r\ng1 (MkS x y) 0 = 0\r\ng1 (MkS x y) n = g1 (MkS y x) (n-1)\r\n}}}\r\nWith GHC 8.6 we get\r\n{{{\r\n$wg1 :: S -> GHC.Prim.Int# -> GHC.Prim.Int#\r\n[Str=<S,1*H><S,1*U>]\r\n$wg1 = \\ (w_s2oH :: S)\r\n (ww_s2oL :: GHC.Prim.Int#) ->\r\n case w_s2oH of { MkS x_s2pz y_s2pA ->\r\n case ww_s2oL of ds_X2nb {\r\n __DEFAULT ->\r\n Foo.$wg1 (Foo.MkS y_s2pA x_s2pz) (GHC.Prim.-# ds_X2nb 1#);\r\n 0# -> 0# }}\r\n\r\ng1 :: S -> Int -> Int\r\n[Str=<S,1*H><S(S),1*U(1*U)>m]\r\ng1 = \\ (w_s2oH :: S) (w1_s2oI :: Int) ->\r\n case w_s2oH of w2_X2pG { MkS ipv_s2p2 ipv1_s2p3 ->\r\n case w1_s2oI of { GHC.Types.I# ww1_s2oL ->\r\n case Foo.$wg1 w2_X2pG ww1_s2oL of ww2_s2oP { __DEFAULT ->\r\n GHC.Types.I# ww2_s2oP }}}\r\n}}}\r\nWhat terrible code! We evaluate the S argument in the wrapper,\r\nand box and unbox it every time around the loop, even though it is never ultimately used.\r\n\r\nHere's what happens if the arguments are banged:\r\n{{{\r\ndata T = MkT !Int !Int\r\ng2 :: T -> Int -> Int\r\ng2 (MkT x y) 0 = 0\r\ng2 (MkT x y) n = g2 (MkT y x) (n-1)\r\n}}}\r\nWe get\r\n{{{\r\n$wg2 GHC.Prim.Int# -> GHC.Prim.Int# -> GHC.Prim.Int# -> GHC.Prim.Int#\r\n[Str=<L,1*U><L,1*U><S,1*U>]\r\nFoo.$wg2 = \\ (ww_s2ow :: GHC.Prim.Int#)\r\n (ww1_s2ox :: GHC.Prim.Int#)\r\n (ww2_s2oB :: GHC.Prim.Int#) ->\r\n case ww2_s2oB of ds_X2n0 {\r\n __DEFAULT -> Foo.$wg2 ww1_s2ox ww_s2ow (GHC.Prim.-# ds_X2n0 1#);\r\n 0# -> 0# }\r\n\r\ng2 :: T -> Int -> Int\r\n[Str=<S(SS),1*U(1*U,1*U)><S(S),1*U(1*U)>m ]\r\ng2 = \\ (w_s2os :: T) (w1_s2ot :: Int) ->\r\n case w_s2os of { MkT ww1_s2ow ww2_s2ox ->\r\n case w1_s2ot of { GHC.Types.I# ww4_s2oB ->\r\n case Foo.$wg2 ww1_s2ow ww2_s2ox ww4_s2oB of ww5_s2oF {\r\n __DEFAULT -> GHC.Types.I# ww5_s2oF }}}\r\n}}}\r\nStill terrible. We pass the two components around the loop before discarding them\r\nat the end.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/16027Cannot use DefaultSignatures for TypeFamiles2019-07-07T18:01:58ZJohn EricsonCannot use DefaultSignatures for TypeFamilesI'm surprised there wasn't a ticket for this. Maybe I just couldn't find it.
In short, I want to do something like:
```
class Monad m => MyMonad m where
type AssociatedMonad m :: Type -> Type
default type AssociatedMonad m :: (...I'm surprised there wasn't a ticket for this. Maybe I just couldn't find it.
In short, I want to do something like:
```
class Monad m => MyMonad m where
type AssociatedMonad m :: Type -> Type
default type AssociatedMonad m :: (m ~ t m', MonadTrans t, MyMonad m') => Type -> Type
type AssociatedMonad (t m') = t (AssociatedMonad m')
fun :: Foo -> m ()
default fun :: (m ~ t m', MonadTrans t, MyMonad m') => Foo -> m ()
fun = lift . fun
```
The syntax is a bit weird, but I hope in the process of implementing constrained type families the syntax properly analogous to the term-level would shake itself out.
The use-case, like the normal method original, is to assist with monad transformer boilerplate. `MonadTrans` wouldn't be enough, but `MFunctor` from mmorph might be depending on the method using the associated type.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.6.2 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Cannot use DefaultSignatures for TypeFamiles","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"I'm surprised there wasn't a ticket for this. Maybe I just couldn't find it.\r\n\r\nIn short, I want to do something like:\r\n{{{\r\nclass Monad m => MyMonad m where\r\n type AssociatedMonad m :: Type -> Type\r\n default type AssociatedMonad m :: (m ~ t m', MonadTrans t, MyMonad m') => Type -> Type\r\n type AssociatedMonad (t m') = t (AssociatedMonad m')\r\n\r\n fun :: Foo -> m ()\r\n default fun :: (m ~ t m', MonadTrans t, MyMonad m') => Foo -> m ()\r\n fun = lift . fun\r\n}}}\r\n\r\nThe syntax is a bit weird, but I hope in the process of implementing constrained type families the syntax properly analogous to the term-level would shake itself out.\r\n\r\nThe use-case, like the normal method original, is to assist with monad transformer boilerplate. {{{MonadTrans}}} wouldn't be enough, but {{{MFunctor}}} from mmorph might be depending on the method using the associated type.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/16024Kind Signatures on data instances2019-07-07T18:01:59ZAndrew MartinKind Signatures on data instancesThere's a comment in `compiler/typecheck/TcInstDcls.hs` that reads:
> The "header" is the part other than the data constructors themselves
> e.g. `data instance D [a] :: * -> * = ...`
> Here the "header" is the bit before the "=" sign...There's a comment in `compiler/typecheck/TcInstDcls.hs` that reads:
> The "header" is the part other than the data constructors themselves
> e.g. `data instance D [a] :: * -> * = ...`
> Here the "header" is the bit before the "=" sign
What's weird is that you cannot actually compile code that this example suggests is valid. Consider this:
```
{-# language TypeFamilies #-}
module BadSig where
data family Bar a :: *
data instance Bar Int :: * = Bool
```
It fails on GHC 8.6.2 with:
```
bad_sig.hs:6:28: error:
parse error on input ‘=’
Perhaps you need a 'let' in a 'do' block?
e.g. 'let x = 5' instead of 'x = 5'
|
6 | data instance Bar Int :: * = Bool
| ^
```
Oddly, GHC will accept the instance if the body is missing:
```
{-# language TypeFamilies #-}
module BadSig where
data family Bar a :: *
data instance Bar Int :: *
```
It is not clear to me whether or not this one should be accepted, but that is beside the point. The first example should certainly be accepted. It should also be accepted with `TYPE 'LiftedRep` instead of `*`, but it fails with the same parser error when given that kind signature as well.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.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":"Kind Signatures on data instances","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"There's a comment in `compiler/typecheck/TcInstDcls.hs` that reads:\r\n\r\n> The \"header\" is the part other than the data constructors themselves\r\n\r\n> e.g. `data instance D [a] :: * -> * = ...`\r\n\r\n> Here the \"header\" is the bit before the \"=\" sign\r\n\r\nWhat's weird is that you cannot actually compile code that this example suggests is valid. Consider this:\r\n\r\n{{{\r\n{-# language TypeFamilies #-}\r\n \r\nmodule BadSig where\r\n\r\ndata family Bar a :: *\r\ndata instance Bar Int :: * = Bool\r\n}}}\r\n\r\nIt fails on GHC 8.6.2 with:\r\n\r\n{{{\r\nbad_sig.hs:6:28: error:\r\n parse error on input ‘=’\r\n Perhaps you need a 'let' in a 'do' block?\r\n e.g. 'let x = 5' instead of 'x = 5'\r\n |\r\n6 | data instance Bar Int :: * = Bool\r\n | ^\r\n}}}\r\n\r\nOddly, GHC will accept the instance if the body is missing:\r\n\r\n{{{\r\n{-# language TypeFamilies #-}\r\n \r\nmodule BadSig where\r\n\r\ndata family Bar a :: *\r\ndata instance Bar Int :: *\r\n}}}\r\n\r\nIt is not clear to me whether or not this one should be accepted, but that is beside the point. The first example should certainly be accepted. It should also be accepted with `TYPE 'LiftedRep` instead of `*`, but it fails with the same parser error when given that kind signature as well.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/16021Hadrian: remove/refactor package specific hacks2019-07-07T18:01:59ZdavideHadrian: remove/refactor package specific hacksHadrian implements a number of package specific hacks (e.g. see #16020). Such hacks should be discussed in this ticket and ideally removed or refactored.
Hacks:
- libffi (#16020)
<details><summary>Trac metadata</summary>
| Trac field...Hadrian implements a number of package specific hacks (e.g. see #16020). Such hacks should be discussed in this ticket and ideally removed or refactored.
Hacks:
- libffi (#16020)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.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":"Hadrian: remove/refactor package specific hacks","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Hadrian implements a number of package specific hacks (e.g. see #16020). Such hacks should be discussed in this ticket and ideally removed or refactored.\r\n\r\nHacks:\r\n* libffi (#16020)","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3David EichmannDavid Eichmannhttps://gitlab.haskell.org/ghc/ghc/-/issues/16011GHCi leaks memory even with -fno-it.2019-07-31T14:05:28ZAndreas KlebingerGHCi leaks memory even with -fno-it.GHCi leaks are not exactly new, but this one is especially easy to trigger/reproduce.
The memory allocated by f never gets freed.
```
PS E:\binary-perf> ..\ghc-8.6.1\bin\ghci.exe -fno-it
GHCi, version 8.6.1: http://www.haskell.org/ghc/...GHCi leaks are not exactly new, but this one is especially easy to trigger/reproduce.
The memory allocated by f never gets freed.
```
PS E:\binary-perf> ..\ghc-8.6.1\bin\ghci.exe -fno-it
GHCi, version 8.6.1: http://www.haskell.org/ghc/ :? for help
Prelude> f = [1 .. 20000000] :: [Int]
Prelude> length f
20000000
Prelude> f = [1 .. 20000001] :: [Int]
Prelude> length f
20000001
Prelude> f = [1 .. 20000002] :: [Int]
Prelude> length f
20000002
Prelude> f = [1 .. 20000000] :: [Int]
Prelude> length f
20000000
Prelude>
```
Or using head and even simpler:
```
PS E:\binary-perf> ..\ghc_commonAsm\inplace\bin\ghci.exe -fno-it
GHCi, version 8.7.20181207: http://www.haskell.org/ghc/ :? for help
Loaded package environment from E:\binary-perf\.ghc.environment.x86_64-mingw32-8.7.20181207
Prelude> f = replicate 2000000 False
Prelude> length f
2000000
Prelude> f = replicate 2000000 False
Prelude> length f
2000000
Prelude> f = replicate 2000000 False
Prelude> length f
2000000
Prelude> f = replicate 2000000 False
Prelude> length f
```
GHC just keeps using more and more memory when I repeat this.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHCi leaks memory even with -fno-it.","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"GHCi leaks are not exactly new, but this one is especially easy to trigger/reproduce.\r\n\r\nThe memory allocated by f never gets freed.\r\n{{{\r\nPS E:\\binary-perf> ..\\ghc-8.6.1\\bin\\ghci.exe -fno-it\r\nGHCi, version 8.6.1: http://www.haskell.org/ghc/ :? for help\r\nPrelude> f = [1 .. 20000000] :: [Int]\r\nPrelude> length f\r\n20000000\r\nPrelude> f = [1 .. 20000001] :: [Int]\r\nPrelude> length f\r\n20000001\r\nPrelude> f = [1 .. 20000002] :: [Int]\r\nPrelude> length f\r\n20000002\r\nPrelude> f = [1 .. 20000000] :: [Int]\r\nPrelude> length f\r\n20000000\r\nPrelude>\r\n}}}\r\n\r\nOr using head and even simpler:\r\n\r\n{{{\r\nPS E:\\binary-perf> ..\\ghc_commonAsm\\inplace\\bin\\ghci.exe -fno-it\r\nGHCi, version 8.7.20181207: http://www.haskell.org/ghc/ :? for help\r\nLoaded package environment from E:\\binary-perf\\.ghc.environment.x86_64-mingw32-8.7.20181207\r\nPrelude> f = replicate 2000000 False\r\nPrelude> length f\r\n2000000\r\nPrelude> f = replicate 2000000 False\r\nPrelude> length f\r\n2000000\r\nPrelude> f = replicate 2000000 False\r\nPrelude> length f\r\n2000000\r\nPrelude> f = replicate 2000000 False\r\nPrelude> length f\r\n}}}\r\n\r\nGHC just keeps using more and more memory when I repeat this.\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/16004Vector performance regression in GHC 8.62019-07-07T18:02:04ZGuillaume BouchardVector performance regression in GHC 8.6Hello.
With the following code, I can observe a performance regression between ghc 8.4 and 8.6:
```haskell
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import qualified Data.Vector.Unboxed.Mutable as Vector
import qualified D...Hello.
With the following code, I can observe a performance regression between ghc 8.4 and 8.6:
```haskell
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import qualified Data.Vector.Unboxed.Mutable as Vector
import qualified Data.Vector.Unboxed as VectorU
import Data.Foldable (for_)
main :: IO ()
main = do
let n = 1000
let vUnmutable :: VectorU.Vector Double = VectorU.generate (n * n) (\i -> fromIntegral i)
v :: Vector.IOVector Double <- VectorU.unsafeThaw vUnmutable
for_ [0..(n - 1)] $ \k -> do
for_ [0..(n - 1)] $ \i -> do
for_ [0..(n - 1)] $ \j -> do
a <- Vector.unsafeRead v (i * n + k)
b <- Vector.unsafeRead v (k * n + j)
c <- Vector.unsafeRead v (i * n + j)
Vector.unsafeWrite v (i * n + j) (min (a + b) c)
```
Built with `-O2` and with / without `-fllvm`. I'm using `vector-0.12.0.1`. Here are the timing results:
GHC 8.2.2
> no llvm: 1.7s
> llvm: 1.0s
GHC 8.4.4
> no llvm: 1.6s
> llvm: 0.9s
GHC 8.6.2
> no llvm: 4.8s
> llvm: 4.3s
I'm using the following bash + nix script to gather theses timings:
```bash
nix-shell -p 'haskell.packages.ghc822.ghcWithPackages(p: [p.vector])' --run "ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp; time ./FloydBench"
nix-shell -p 'haskell.packages.ghc822.ghcWithPackages(p: [p.vector])' -p llvm_39 --run "ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp -fllvm; time ./FloydBench"
nix-shell -p 'haskell.packages.ghc844.ghcWithPackages(p: [p.vector])' --run "ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp; time ./FloydBench"
nix-shell -p 'haskell.packages.ghc844.ghcWithPackages(p: [p.vector])' -p llvm_5 --run "ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp -fllvm; time ./FloydBench"
nix-shell -p 'haskell.packages.ghc862.ghcWithPackages(p: [p.vector])' --run "ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp; time ./FloydBench"
nix-shell -p 'haskell.packages.ghc862.ghcWithPackages(p: [p.vector])' -p llvm_6 --run "ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp -fllvm; time ./FloydBench"
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.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":"Vector performance regression in GHC 8.6","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Hello.\r\n\r\nWith the following code, I can observe a performance regression between ghc 8.4 and 8.6:\r\n\r\n\r\n{{{#!haskell\r\n{-# LANGUAGE ScopedTypeVariables #-}\r\nmodule Main where\r\nimport qualified Data.Vector.Unboxed.Mutable as Vector\r\nimport qualified Data.Vector.Unboxed as VectorU\r\n\r\nimport Data.Foldable (for_)\r\n\r\nmain :: IO ()\r\nmain = do\r\n let n = 1000\r\n\r\n let vUnmutable :: VectorU.Vector Double = VectorU.generate (n * n) (\\i -> fromIntegral i)\r\n v :: Vector.IOVector Double <- VectorU.unsafeThaw vUnmutable\r\n\r\n for_ [0..(n - 1)] $ \\k -> do\r\n for_ [0..(n - 1)] $ \\i -> do\r\n for_ [0..(n - 1)] $ \\j -> do\r\n a <- Vector.unsafeRead v (i * n + k)\r\n b <- Vector.unsafeRead v (k * n + j)\r\n c <- Vector.unsafeRead v (i * n + j)\r\n Vector.unsafeWrite v (i * n + j) (min (a + b) c)\r\n}}}\r\n\r\nBuilt with `-O2` and with / without `-fllvm`. I'm using `vector-0.12.0.1`. Here are the timing results:\r\n\r\nGHC 8.2.2\r\n no llvm: 1.7s\r\n llvm: 1.0s\r\nGHC 8.4.4\r\n no llvm: 1.6s\r\n llvm: 0.9s\r\nGHC 8.6.2\r\n no llvm: 4.8s\r\n llvm: 4.3s\r\n\r\nI'm using the following bash + nix script to gather theses timings:\r\n\r\n{{{#!bash\r\nnix-shell -p 'haskell.packages.ghc822.ghcWithPackages(p: [p.vector])' --run \"ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp; time ./FloydBench\"\r\nnix-shell -p 'haskell.packages.ghc822.ghcWithPackages(p: [p.vector])' -p llvm_39 --run \"ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp -fllvm; time ./FloydBench\"\r\nnix-shell -p 'haskell.packages.ghc844.ghcWithPackages(p: [p.vector])' --run \"ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp; time ./FloydBench\"\r\nnix-shell -p 'haskell.packages.ghc844.ghcWithPackages(p: [p.vector])' -p llvm_5 --run \"ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp -fllvm; time ./FloydBench\"\r\nnix-shell -p 'haskell.packages.ghc862.ghcWithPackages(p: [p.vector])' --run \"ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp; time ./FloydBench\"\r\nnix-shell -p 'haskell.packages.ghc862.ghcWithPackages(p: [p.vector])' -p llvm_6 --run \"ghc-pkg list | grep vector; ghc -O2 FloydBench.hs -Wall -fforce-recomp -fllvm; time ./FloydBench\"\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/16000Don't suggest Rank2Types and RankNTypes, only the latter2019-07-07T18:02:05ZchessaiDon't suggest Rank2Types and RankNTypes, only the latterCurrently (as of GHC 8.6.2), error messages that suggest RankNTypes also suggest Rank2Types, but Rank2Types are deprecated.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| --------------------...Currently (as of GHC 8.6.2), error messages that suggest RankNTypes also suggest Rank2Types, but Rank2Types are deprecated.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.6.2 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Parser) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Don't suggest Rank2Types and RankNTypes, only the latter","status":"New","operating_system":"","component":"Compiler (Parser)","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"Currently (as of GHC 8.6.2), error messages that suggest RankNTypes also suggest Rank2Types, but Rank2Types are deprecated. ","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15998GHC.Event.Thread.eventManager has a lot of indirections2019-07-07T18:02:06ZchessaiGHC.Event.Thread.eventManager has a lot of indirectionsCurrent `eventManager`:
```hs
eventManager :: IORef (IOArray Int (Maybe (ThreadId, EventManager)))
eventManager = unsafePerformIO $ do
...
```
That's a lot of indirections just to grab your thread's event manager.
Consider the followi...Current `eventManager`:
```hs
eventManager :: IORef (IOArray Int (Maybe (ThreadId, EventManager)))
eventManager = unsafePerformIO $ do
...
```
That's a lot of indirections just to grab your thread's event manager.
Consider the following, which I believe would improve the performance of this:
```hs
data UnliftedIORef :: TYPE 'UnliftedRep -> Type where
UnliftedIORef :: MutVar# RealWorld a -> UnliftedIORef a
eventManager :: UnliftedIORef (MutableArray# RealWorld Things)
data Things = Things !ThreadId !EventManager
```
I think the Maybe can be eliminated. I'm unsure. What makes me think it can be is the following snippet:
```hs
getSystemEventManager :: IO (Maybe EventManager)
getSystemEventManager = do
t <- myThreadId
(cap, _) <- threadCapability t
eventManagerArray <- readIORef eventManager
mmgr <- readIOArray eventManagerArray cap
return $ fmap snd mmgr
getSystemEventManager_ :: IO EventManager
getSystemEventManager_ = do
Just mgr <- getSystemEventManager
return mgr
{-# INLINE getSystemEventManager_ #-}
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.6.2 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC.Event.Thread.eventManager has a lot of indirections","status":"New","operating_system":"","component":"libraries/base","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"Current `eventManager`:\r\n\r\n{{{#!hs\r\neventManager :: IORef (IOArray Int (Maybe (ThreadId, EventManager)))\r\neventManager = unsafePerformIO $ do\r\n...\r\n}}}\r\n\r\nThat's a lot of indirections just to grab your thread's event manager.\r\n\r\nConsider the following, which I believe would improve the performance of this:\r\n\r\n{{{#!hs\r\ndata UnliftedIORef :: TYPE 'UnliftedRep -> Type where\r\n UnliftedIORef :: MutVar# RealWorld a -> UnliftedIORef a\r\n\r\neventManager :: UnliftedIORef (MutableArray# RealWorld Things)\r\n\r\ndata Things = Things !ThreadId !EventManager\r\n}}}\r\n\r\nI think the Maybe can be eliminated. I'm unsure. What makes me think it can be is the following snippet:\r\n\r\n{{{#!hs\r\ngetSystemEventManager :: IO (Maybe EventManager)\r\ngetSystemEventManager = do\r\n t <- myThreadId\r\n (cap, _) <- threadCapability t\r\n eventManagerArray <- readIORef eventManager\r\n mmgr <- readIOArray eventManagerArray cap\r\n return $ fmap snd mmgr\r\n\r\ngetSystemEventManager_ :: IO EventManager\r\ngetSystemEventManager_ = do\r\n Just mgr <- getSystemEventManager\r\n return mgr\r\n{-# INLINE getSystemEventManager_ #-}\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3