GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:02:25Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/15925Production quality bindists for hadrian2019-07-07T18:02:25ZAlp MestanogullariProduction quality bindists for hadrianThe bindists currently produced by hadrian are largely untested, especially on other platforms than linux. Moreover, we had not made a clear decision on what to do with respect to the relocatable GHCs that hadrian produces and wrapper sc...The bindists currently produced by hadrian are largely untested, especially on other platforms than linux. Moreover, we had not made a clear decision on what to do with respect to the relocatable GHCs that hadrian produces and wrapper scripts.
We realized that everyone would be happy if:
- the bindists follow the in-tree structure of `<build root>/stage1`, with `bin` containing the actual programs for most cases, etc. No wrapper script just yet. This way we can just unpack the archive and call `bin/ghc`. We still perhaps need to generate a script for ghci, but that's not really a wrapper, it's just a special case of `ghc` really.
- `./configure && make install` would systematically generate wrapper scripts and install everything the way we do in our current bindists.
I will look into getting this to work soon and will use this ticket to report progress.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------------------- |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System (Hadrian) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | angerman, hvr, snowleopard |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Production quality bindists for hadrian","status":"New","operating_system":"","component":"Build System (Hadrian)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["angerman","hvr","snowleopard"],"type":"Bug","description":"The bindists currently produced by hadrian are largely untested, especially on other platforms than linux. Moreover, we had not made a clear decision on what to do with respect to the relocatable GHCs that hadrian produces and wrapper scripts.\r\n\r\nWe realized that everyone would be happy if:\r\n\r\n- the bindists follow the in-tree structure of `<build root>/stage1`, with `bin` containing the actual programs for most cases, etc. No wrapper script just yet. This way we can just unpack the archive and call `bin/ghc`. We still perhaps need to generate a script for ghci, but that's not really a wrapper, it's just a special case of `ghc` really.\r\n- `./configure && make install` would systematically generate wrapper scripts and install everything the way we do in our current bindists.\r\n\r\nI will look into getting this to work soon and will use this ticket to report progress.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/15924Do not save performance test results if worktree is dirty2019-07-07T18:02:26ZdavideDo not save performance test results if worktree is dirtyThe test driver will automatically save performance results to git notes. Notes are attached to commits, but if the working tree is dirty, performance characteristics my be affected and the saved results will not be valid.
- Only save p...The test driver will automatically save performance results to git notes. Notes are attached to commits, but if the working tree is dirty, performance characteristics my be affected and the saved results will not be valid.
- Only save performance test results if work tree is dirty.
- Bonus: don't save to a git note if we have 0 results.
- Update wiki page.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Test Suite |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Do not save performance test results if work tree is dirty","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":[""],"type":"Bug","description":"The test driver will automatically save performance results to git notes. Notes are attached to commits, but if the working tree is dirty, performance characteristics my be affected and the saved results will not be valid.\r\n\r\n* Only save performance test results if work tree is dirty.\r\n* Bonus: don't save to a git note if we have 0 results.\r\n* Update wiki page.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1davidedavidehttps://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/15922Can't make a `binary-dist` on MacOS with Hadrian2019-07-07T18:02:26ZAlec TheriaultCan't make a `binary-dist` on MacOS with HadrianSteps to reproduce on a Mac:
```
$ ./hadrian/build.sh -c -j "binary-dist"
<snip>
Error when running Shake build system:
at src/Main.hs:58:30-42:
* Depends on: binary-dist
* Raised the exception:
user error (Development.Shake.cmd, syst...Steps to reproduce on a Mac:
```
$ ./hadrian/build.sh -c -j "binary-dist"
<snip>
Error when running Shake build system:
at src/Main.hs:58:30-42:
* Depends on: binary-dist
* Raised the exception:
user error (Development.Shake.cmd, system command failed
Command: cp -r _D5316/stage1/lib/x86_64-darwin-ghc-8.7.20181119/rts-1.0/include _D5316/bindist/ghc-8.7.20181119-x86_64-apple-darwin
Exit code: 1
Stderr:
cp: _D5316/stage1/lib/x86_64-darwin-ghc-8.7.20181119/rts-1.0/include: No such file or directory
)
```
There is an `_D5316/stage1/lib/x86_64-osx-ghc-8.7.20181119/rts-1.0/include` folder though (note the `darwin`/`osx` difference)...
At a glance, I think this is a case of Cabal having a different naming convention then Hadrian's `HostOs` (I'm pretty sure that the folders in `lib` are created by Cabal using its internal convention).
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------------- |
| Version | 8.6.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System (Hadrian) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Can't make a `binary-dist` on MacOS with Hadrian","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":"Bug","description":"Steps to reproduce on a Mac:\r\n\r\n{{{\r\n$ ./hadrian/build.sh -c -j \"binary-dist\"\r\n<snip>\r\nError when running Shake build system:\r\n at src/Main.hs:58:30-42:\r\n* Depends on: binary-dist\r\n* Raised the exception:\r\nuser error (Development.Shake.cmd, system command failed\r\nCommand: cp -r _D5316/stage1/lib/x86_64-darwin-ghc-8.7.20181119/rts-1.0/include _D5316/bindist/ghc-8.7.20181119-x86_64-apple-darwin\r\nExit code: 1\r\nStderr:\r\ncp: _D5316/stage1/lib/x86_64-darwin-ghc-8.7.20181119/rts-1.0/include: No such file or directory\r\n)\r\n}}}\r\n\r\nThere is an `_D5316/stage1/lib/x86_64-osx-ghc-8.7.20181119/rts-1.0/include` folder though (note the `darwin`/`osx` difference)...\r\n\r\nAt a glance, I think this is a case of Cabal having a different naming convention then Hadrian's `HostOs` (I'm pretty sure that the folders in `lib` are created by Cabal using its internal convention).","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/15921Data.List.maximumBy uses counter-intuitive ordering2020-10-27T22:29:26ZMarten WijnjaData.List.maximumBy uses counter-intuitive ordering```hs
Data.List.maximumBy (Data.Ord.comparing snd) [(0, 1), (3, 2), (2, 2), (1, 1)]
```
What do you expect the outcome to be?
All Haskell-programmers I know that I asked this question, would answer, based on their intuition, `(3, 2)`. H...```hs
Data.List.maximumBy (Data.Ord.comparing snd) [(0, 1), (3, 2), (2, 2), (1, 1)]
```
What do you expect the outcome to be?
All Haskell-programmers I know that I asked this question, would answer, based on their intuition, `(3, 2)`. However, this is not the behaviour that `Data.List.maximumBy` currently has: Instead, `(2, 2)` (the *last* occurrence of a 'maximum' element) is kept.
Furthermore, this behaviour is different from the one used by `Data.List.minimumBy`. I would therefore like to request:
- If its behaviour is unintentionally different from `minimumBy`, alter the implementation to match it.
- If its behaviour is intentionally the opposite, this should be specified in the documentation.
<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":"Foldable.maximumBy uses counter-intuitive ordering","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":["List","maximumBy","minimumBy"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{#!hs\r\nData.List.maximumBy (Data.Ord.comparing snd) [(0, 1), (3, 2), (2, 2), (1, 1)]\r\n}}}\r\nWhat do you expect the outcome to be?\r\nAll Haskell-programmers I know that I asked this question, would answer, based on their intuition, `(3, 2)`. However, this is not the behaviour that `Data.List.maximumBy` currently has: Instead, `(2, 2)` (the ''last'' occurrence of a 'maximum' element) is kept.\r\n\r\nFurthermore, this behaviour is different from the one used by `Data.List.minimumBy`. I would therefore like to request:\r\n\r\n- If its behaviour is unintentionally different from `minimumBy`, alter the implementation to match it.\r\n- If its behaviour is intentionally the opposite, this should be specified in the documentation.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15920Implement a flag which disables safe Haskell2019-07-07T18:02:27ZMatthew PickeringImplement a flag which disables safe HaskellWhen adding a plugin to a module, it marks the module as unsafe. If I automatically run a plugin on every module I build then all the modules are therefore marked unsafe.
This means that libraries start failing to compile as the safety ...When adding a plugin to a module, it marks the module as unsafe. If I automatically run a plugin on every module I build then all the modules are therefore marked unsafe.
This means that libraries start failing to compile as the safety properties change. However, I don't care about safe haskell and want to turn off this error but there appears to be no way to do so.
<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":"Implement a flag which disables safe Haskell","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":"When adding a plugin to a module, it marks the module as unsafe. If I automatically run a plugin on every module I build then all the modules are therefore marked unsafe.\r\n\r\nThis means that libraries start failing to compile as the safety properties change. However, I don't care about safe haskell and want to turn off this error but there appears to be no way to do so.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/15919Deprecate split objects2022-11-29T08:49:16ZBen GamariDeprecate split objectsFor several reasons (see below) we now generally recommend users use split sections instead of split objects.
Reasons:
- SplitSections is quite a bit simpler
- SplitSections may produce smaller binaries
- SplitSections requires fewer a...For several reasons (see below) we now generally recommend users use split sections instead of split objects.
Reasons:
- SplitSections is quite a bit simpler
- SplitSections may produce smaller binaries
- SplitSections requires fewer assembler invocations, potentially improving compilation time (see #11285, #15051)
- SplitSections is the approach used by most C compilers, meaning we may avoid edge cases that SplitObjects may turn up
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Deprecate split objects","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"For several reasons (see below) we now generally recommend users use split sections instead of split objects.\r\n\r\nReasons:\r\n * SplitSections is quite a bit simpler\r\n * SplitSections may produce smaller binaries\r\n * SplitSections requires fewer assembler invocations, potentially improving compilation time (see #11285, #15051)\r\n * SplitSections is the approach used by most C compilers, meaning we may avoid edge cases that SplitObjects may turn up\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.10.1https://gitlab.haskell.org/ghc/ghc/-/issues/15918mkCastTy sometimes drops insoluble (Type ~ Constraint) coercions2023-06-07T22:28:36ZIcelandjackmkCastTy sometimes drops insoluble (Type ~ Constraint) coercions**EDIT: See [ticket:15918\#comment:164033](https://gitlab.haskell.org//ghc/ghc/issues/15918#note_164033) for the real cause and [ticket:15918\#comment:169361](https://gitlab.haskell.org//ghc/ghc/issues/15918#note_169361) for the current ...**EDIT: See [ticket:15918\#comment:164033](https://gitlab.haskell.org//ghc/ghc/issues/15918#note_164033) for the real cause and [ticket:15918\#comment:169361](https://gitlab.haskell.org//ghc/ghc/issues/15918#note_169361) for the current plan.**
See also:
- TyCoRep `Note [Respecting definitional equality]` and its supporting `Note [Non-trivial definitional equality]`
- #11715 Constraint vs \*
- #15799
- #13650
TL;DR: there's a bug in here, that we don't know how to solve. But it's not biting us, and once we solve #11715 that may point the way.
---------------------------
Minimized from https://gist.github.com/Icelandjack/683bd4b79027695ffc31632645c9d58b, I don't expect `Build []` to kind check but ti shouldn't crash.
```hs
{-# Language PolyKinds #-}
{-# Language TypeFamilies #-}
{-# Language ConstraintKinds #-}
{-# Language FlexibleContexts #-}
{-# Language QuantifiedConstraints #-}
{-# Language UndecidableInstances #-}
import Data.Kind
class Rev f where
rev :: f a
instance (forall xx. cls xx => Rev xx) => Rev (Build cls) where
rev = undefined
data Build :: ((k -> Type) -> Constraint) -> (k -> Type)
uu = rev :: Build [] a
```
gives a panic
```
$ ./ghc-stage2 --interactive -ignore-dot-ghci ~/hs/711_bug.hs
GHCi, version 8.7.20181029: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( ~/hs/711_bug.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181029 for x86_64-unknown-linux):
ASSERT failed!
irred_a1zW :: [(xx_a1zV[sk:3] |> Sym {co_a1zu})]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/utils/Outputable.hs:1219:5 in ghc:Outputable
assertPprPanic, called at compiler/typecheck/TcType.hs:1826:53 in ghc:TcType
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
```⊥https://gitlab.haskell.org/ghc/ghc/-/issues/15917GHC seems to re-read source of module to produce fancy error msgs2024-02-20T20:54:05ZHeimdellGHC seems to re-read source of module to produce fancy error msgsI had a module with unused name `txFees` in it. I started compilation and in the same time edited code by renaming `txFees` -\> `_txFees`.
I got the following message:
```
warning: [-Wunused-matches]
Defined but not used: ‘...I had a module with unused name `txFees` in it. I started compilation and in the same time edited code by renaming `txFees` -\> `_txFees`.
I got the following message:
```
warning: [-Wunused-matches]
Defined but not used: ‘txFees’
|
40 | } _txFees
| ^^^^^^
<no location info>: error:
Failing due to -Werror.
```
The screenshot is in the attachment. Notice that message part is about old code (`txFees`), and preview is about new code (`_txFees`).
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | lowest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | @int-index |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC seems to re-read source of module to produce fancy error msgs","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.2","keywords":["re-reading"],"differentials":[],"test_case":"","architecture":"","cc":["@int-index"],"type":"Bug","description":"I had a module with unused name `txFees` in it. I started compilation and in the same time edited code by renaming `txFees` -> `_txFees`.\r\n\r\nI got the following message:\r\n\r\n{{{\r\n warning: [-Wunused-matches]\r\n Defined but not used: ‘txFees’\r\n |\r\n 40 | } _txFees\r\n | ^^^^^^\r\n \r\n <no location info>: error: \r\n Failing due to -Werror.\r\n}}}\r\n\r\nThe screenshot is in the attachment. Notice that message part is about old code (`txFees`), and preview is about new code (`_txFees`).","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15916GHC doesn't build on powerpc64 architecture on systems other than GNU / Linux2019-07-07T18:02:28ZpkubajGHC doesn't build on powerpc64 architecture on systems other than GNU / LinuxI'd like to bootstrap GHC for FreeBSD/powerpc64, but GHC seems to be supported only on Linux for powerpc64 architecture.
Relevant code:
https://github.com/ghc/ghc/blob/1c2c2d3dfd4c36884b22163872feb87122b4528d/rts/StgCRun.c\#L875
https:/...I'd like to bootstrap GHC for FreeBSD/powerpc64, but GHC seems to be supported only on Linux for powerpc64 architecture.
Relevant code:
https://github.com/ghc/ghc/blob/1c2c2d3dfd4c36884b22163872feb87122b4528d/rts/StgCRun.c\#L875
https://github.com/ghc/ghc/blob/1c2c2d3dfd4c36884b22163872feb87122b4528d/rts/StgCRunAsm.S\#L112
<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 doesn't build on powerpc64 architecture on systems other than GNU / Linux","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"Research needed","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I'd like to bootstrap GHC for FreeBSD/powerpc64, but GHC seems to be supported only on Linux for powerpc64 architecture.\r\n\r\nRelevant code:\r\nhttps://github.com/ghc/ghc/blob/1c2c2d3dfd4c36884b22163872feb87122b4528d/rts/StgCRun.c#L875\r\nhttps://github.com/ghc/ghc/blob/1c2c2d3dfd4c36884b22163872feb87122b4528d/rts/StgCRunAsm.S#L112","type_of_failure":"OtherFailure","blocking":[]} -->8.10.1Peter Trommlerptrommler@acm.orgPeter Trommlerptrommler@acm.orghttps://gitlab.haskell.org/ghc/ghc/-/issues/15915Add CI for integer-simple2019-07-07T18:02:28ZBen GamariAdd CI for integer-simpleWe should make sure that the `integer-simple` build gets tested occasionally. It is apparently currently broken.We should make sure that the `integer-simple` build gets tested occasionally. It is apparently currently broken.8.8.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/15914haddock-library-1.7.0 fails to build on ppc64 BE2019-07-27T14:54:23ZJens Petersenhaddock-library-1.7.0 fails to build on ppc64 BEI was trying to build ghc-8.6.2 for Fedora 28 and it failed on ppc64 (Bigendian) with:
```
utils/haddock/haddock-library/src/Documentation/Haddock/Types.hs:99:25: error:
• GHC internal error: ‘TableRow’ is not in scope during type c...I was trying to build ghc-8.6.2 for Fedora 28 and it failed on ppc64 (Bigendian) with:
```
utils/haddock/haddock-library/src/Documentation/Haddock/Types.hs:99:25: error:
• GHC internal error: ‘TableRow’ is not in scope during type checking, but it passed the renamer
tcl_env of environment: [aIy :-> Type variable ‘id’ = id :: k,
rHO :-> ATcTyCon Table :: k -> *,
rHP :-> APromotionErr RecDataConPE]
• In the type ‘[TableRow id]’
In the definition of data constructor ‘Table’
In the data declaration for ‘Table’
|
99 | { tableHeaderRows :: [TableRow id]
| ^^^^^^^^
utils/haddock/dist/build/haddock/autogen/Paths_haddock.hs:41:22: error:
• Couldn't match type ‘a’ with ‘String’
Expected type: IO a
Actual type: IO String
• In the first argument of ‘catchIO’, namely
‘(getEnv "haddock_libdir")’
In the expression:
catchIO (getEnv "haddock_libdir") (\ _ -> return libdir)
In an equation for ‘getLibDir’:
getLibDir
= catchIO (getEnv "haddock_libdir") (\ _ -> return libdir)
|
41 | getLibDir = catchIO (getEnv "haddock_libdir") (\_ -> return libdir)
| ^^^^^^^^^^^^^^^^^^^^^^^
make[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Documentation/Haddock/Types.dyn_o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Paths_haddock.dyn_o] Error 1
utils/haddock/haddock-api/src/Haddock/Syb.hs:22:1: warning: [-Wunused-top-binds]
Defined but not used: ‘isType’
|
22 | isType _ = isJust $ eqT @a @b
| ^^^^^^
utils/haddock/haddock-api/src/Haddock/Syb.hs:38:1: warning: [-Wunused-top-binds]
Defined but not used: ‘everythingBut’
|
38 | everythingBut k f x = let (v, stop) = f x
| ^^^^^^^^^^^^^
utils/haddock/haddock-api/src/Haddock/Syb.hs:60:21: warning: [-Wunused-matches]
Defined but not used: ‘s’
|
60 | everythingWithState s k f x =
| ^
utils/haddock/haddock-api/src/Haddock/Syb.hs:75:1: warning: [-Wunused-top-binds]
Defined but not used: ‘everywhereBut’
|
75 | everywhereBut q f x
| ^^^^^^^^^^^^^
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.6.2 for powerpc64-unknown-linux):
urk! lookup local fingerprint
$fShowTokenType
[]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/iface/MkIface.hs:524:37 in ghc:MkIface
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
make[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Haddock/Backends/Hyperlinker/Types.dyn_o] Error 1
make: *** [Makefile:127: all] Error 2
```
https://koji.fedoraproject.org/koji/taskinfo?taskID=30919315 (the log files are only preserved for 2 weeks)
<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":"haddock-library-1.7.0 fails to build on ppc64 BE","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":"I was trying to build ghc-8.6.2 for Fedora 28 and it failed on ppc64 (Bigendian) with:\r\n\r\n{{{\r\nutils/haddock/haddock-library/src/Documentation/Haddock/Types.hs:99:25: error:\r\n • GHC internal error: ‘TableRow’ is not in scope during type checking, but it passed the renamer\r\n tcl_env of environment: [aIy :-> Type variable ‘id’ = id :: k,\r\n rHO :-> ATcTyCon Table :: k -> *,\r\n rHP :-> APromotionErr RecDataConPE]\r\n • In the type ‘[TableRow id]’\r\n In the definition of data constructor ‘Table’\r\n In the data declaration for ‘Table’\r\n |\r\n99 | { tableHeaderRows :: [TableRow id]\r\n | ^^^^^^^^\r\nutils/haddock/dist/build/haddock/autogen/Paths_haddock.hs:41:22: error:\r\n • Couldn't match type ‘a’ with ‘String’\r\n Expected type: IO a\r\n Actual type: IO String\r\n • In the first argument of ‘catchIO’, namely\r\n ‘(getEnv \"haddock_libdir\")’\r\n In the expression:\r\n catchIO (getEnv \"haddock_libdir\") (\\ _ -> return libdir)\r\n In an equation for ‘getLibDir’:\r\n getLibDir\r\n = catchIO (getEnv \"haddock_libdir\") (\\ _ -> return libdir)\r\n |\r\n41 | getLibDir = catchIO (getEnv \"haddock_libdir\") (\\_ -> return libdir)\r\n | ^^^^^^^^^^^^^^^^^^^^^^^\r\nmake[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Documentation/Haddock/Types.dyn_o] Error 1\r\nmake[1]: *** Waiting for unfinished jobs....\r\nmake[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Paths_haddock.dyn_o] Error 1\r\nutils/haddock/haddock-api/src/Haddock/Syb.hs:22:1: warning: [-Wunused-top-binds]\r\n Defined but not used: ‘isType’\r\n |\r\n22 | isType _ = isJust $ eqT @a @b\r\n | ^^^^^^\r\nutils/haddock/haddock-api/src/Haddock/Syb.hs:38:1: warning: [-Wunused-top-binds]\r\n Defined but not used: ‘everythingBut’\r\n |\r\n38 | everythingBut k f x = let (v, stop) = f x\r\n | ^^^^^^^^^^^^^\r\nutils/haddock/haddock-api/src/Haddock/Syb.hs:60:21: warning: [-Wunused-matches]\r\n Defined but not used: ‘s’\r\n |\r\n60 | everythingWithState s k f x =\r\n | ^\r\nutils/haddock/haddock-api/src/Haddock/Syb.hs:75:1: warning: [-Wunused-top-binds]\r\n Defined but not used: ‘everywhereBut’\r\n |\r\n75 | everywhereBut q f x\r\n | ^^^^^^^^^^^^^\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.6.2 for powerpc64-unknown-linux):\r\n\turk! lookup local fingerprint\r\n $fShowTokenType\r\n []\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/iface/MkIface.hs:524:37 in ghc:MkIface\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\nmake[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Haddock/Backends/Hyperlinker/Types.dyn_o] Error 1\r\nmake: *** [Makefile:127: all] Error 2\r\n}}}\r\n\r\nhttps://koji.fedoraproject.org/koji/taskinfo?taskID=30919315 (the log files are only preserved for 2 weeks)","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15913ghc-8.6 fails to build on unregisterised: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ und...2021-06-08T13:00:17ZJens Petersenghc-8.6 fails to build on unregisterised: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?ghc-8.6 fails to build on s390x (likely any unregisterised build with ghc 8.2 or 8.4) apparently due to some mix up of include files between stage0 and stage1 compilers.
```
"/usr/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -H32m -O ...ghc-8.6 fails to build on s390x (likely any unregisterised build with ghc 8.2 or 8.4) apparently due to some mix up of include files between stage0 and stage1 compilers.
```
"/usr/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -package-db libraries/bootstrapping.conf -this-unit-id ghc-8.6.2 -hide-all-packages -i -icompiler/backpack -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/stage1/build -Icompiler/stage1/build -icompiler/stage1/build/./autogen -Icompiler/stage1/build/./autogen -Icompiler/. -Icompiler/parser -Icompiler/utils -Icompiler/stage1 -Icompiler/stage1/build/. -Icompiler/stage1/build/parser -Icompiler/stage1/build/utils -Icompiler/stage1/build/stage1 -optP-include -optPcompiler/stage1/build/./autogen/cabal_macros.h -package-id array-0.5.2.0 -package-id base-4.10.1.0 -package-id binary-0.8.6.0 -package-id bytestring-0.10.8.2 -package-id containers-0.5.10.2 -package-id deepseq-1.4.3.0 -package-id directory-1.3.0.2 -package-id filepath-1.4.1.2 -package-id ghc-boot-8.6.2 -package-id ghc-boot-th-8.6.2 -package-id ghc-heap-8.6.2 -package-id ghci-8.6.2 -package-id hpc-0.6.0.3 -package-id process-1.6.1.0 -package-id template-haskell-2.14.0.0 -package-id terminfo-0.4.1.2 -package-id time-1.8.0.2 -package-id transformers-0.5.5.0 -package-id unix-2.7.2.2 -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -Wnoncanonical-monoid-instances -this-unit-id ghc -XHaskell2010 -XNoImplicitPrelude -DNO_REGS -DNOSMP -optc-DNOSMP -DSTAGE=1 -Rghc-timing -Wcpp-undef -no-user-package-db -rtsopts -odir compiler/stage1/build -hidir compiler/stage1/build -stubdir compiler/stage1/build -c compiler/utils/Binary.hs -o compiler/stage1/build/Binary.o
/tmp/ghc24ef_0/ghc_3.hc: In function ‘cNqW_entry’:
/tmp/ghc24ef_0/ghc_3.hc:50988:61: error:
error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
|
50988 | ((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
| ^
/tmp/ghc24ef_0/ghc_3.hc:50988:61: error:
note: each undeclared identifier is reported only once for each function it appears in
|
50988 | ((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
| ^
/tmp/ghc24ef_0/ghc_3.hc: In function ‘cNra_entry’:
/tmp/ghc24ef_0/ghc_3.hc:51045:61: error:
error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
|
51045 | ((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
| ^
/tmp/ghc24ef_0/ghc_3.hc: In function ‘sHDG_entry’:
/tmp/ghc24ef_0/ghc_3.hc:56499:61: error:
error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
|
56499 | ((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
| ^
/tmp/ghc24ef_0/ghc_3.hc: In function ‘cO9A_entry’:
/tmp/ghc24ef_0/ghc_3.hc:56819:61: error:
error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
|
56819 | ((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
| ^
/tmp/ghc24ef_0/ghc_3.hc: In function ‘cOa5_entry’:
/tmp/ghc24ef_0/ghc_3.hc:56907:61: error:
error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stg_MUT_ARR_PTRS_FROZEN_DIRTY_info
|
56907 | ((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;
| ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
<<ghc: 5594223368 bytes, 548 GCs, 37786228/65761936 avg/max bytes residency (14 samples), 177M in use, 0.001 INIT (0.001 elapsed), 6.007 MUT (6.639 elapsed), 2.510 GC (2.514 elapsed) :ghc>>
make[1]: *** [compiler/ghc.mk:446: compiler/stage1/build/Binary.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:125: all] Error 2
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------- |
| Version | 8.6.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System (make) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghc-8.6.2 fails to build on s390x (unregisterised): ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?","status":"New","operating_system":"","component":"Build System (make)","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"ghc-8.6 fails to build on s390x (likely any unregisterised build with ghc 8.2 or 8.4) apparently due to some mix up of include files between stage0 and stage1 compilers.\r\n\r\n{{{\r\n\"/usr/bin/ghc\" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -package-db libraries/bootstrapping.conf -this-unit-id ghc-8.6.2 -hide-all-packages -i -icompiler/backpack -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/stage1/build -Icompiler/stage1/build -icompiler/stage1/build/./autogen -Icompiler/stage1/build/./autogen -Icompiler/. -Icompiler/parser -Icompiler/utils -Icompiler/stage1 -Icompiler/stage1/build/. -Icompiler/stage1/build/parser -Icompiler/stage1/build/utils -Icompiler/stage1/build/stage1 -optP-include -optPcompiler/stage1/build/./autogen/cabal_macros.h -package-id array-0.5.2.0 -package-id base-4.10.1.0 -package-id binary-0.8.6.0 -package-id bytestring-0.10.8.2 -package-id containers-0.5.10.2 -package-id deepseq-1.4.3.0 -package-id directory-1.3.0.2 -package-id filepath-1.4.1.2 -package-id ghc-boot-8.6.2 -package-id ghc-boot-th-8.6.2 -package-id ghc-heap-8.6.2 -package-id ghci-8.6.2 -package-id hpc-0.6.0.3 -package-id process-1.6.1.0 -package-id template-haskell-2.14.0.0 -package-id terminfo-0.4.1.2 -package-id time-1.8.0.2 -package-id transformers-0.5.5.0 -package-id unix-2.7.2.2 -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -Wnoncanonical-monoid-instances -this-unit-id ghc -XHaskell2010 -XNoImplicitPrelude -DNO_REGS -DNOSMP -optc-DNOSMP -DSTAGE=1 -Rghc-timing -Wcpp-undef -no-user-package-db -rtsopts -odir compiler/stage1/build -hidir compiler/stage1/build -stubdir compiler/stage1/build -c compiler/utils/Binary.hs -o compiler/stage1/build/Binary.o \r\n/tmp/ghc24ef_0/ghc_3.hc: In function ‘cNqW_entry’:\r\n/tmp/ghc24ef_0/ghc_3.hc:50988:61: error:\r\n error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?\r\n ((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n stg_MUT_ARR_PTRS_FROZEN_DIRTY_info\r\n |\r\n50988 | ((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n | ^\r\n/tmp/ghc24ef_0/ghc_3.hc:50988:61: error:\r\n note: each undeclared identifier is reported only once for each function it appears in\r\n |\r\n50988 | ((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n | ^\r\n/tmp/ghc24ef_0/ghc_3.hc: In function ‘cNra_entry’:\r\n/tmp/ghc24ef_0/ghc_3.hc:51045:61: error:\r\n error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?\r\n ((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n stg_MUT_ARR_PTRS_FROZEN_DIRTY_info\r\n |\r\n51045 | ((struct {W_ x;} __attribute__((packed))*) _sHcZ)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n | ^\r\n/tmp/ghc24ef_0/ghc_3.hc: In function ‘sHDG_entry’:\r\n/tmp/ghc24ef_0/ghc_3.hc:56499:61: error:\r\n error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?\r\n ((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n stg_MUT_ARR_PTRS_FROZEN_DIRTY_info\r\n |\r\n56499 | ((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n | ^\r\n/tmp/ghc24ef_0/ghc_3.hc: In function ‘cO9A_entry’:\r\n/tmp/ghc24ef_0/ghc_3.hc:56819:61: error:\r\n error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?\r\n ((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n stg_MUT_ARR_PTRS_FROZEN_DIRTY_info\r\n |\r\n56819 | ((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n | ^\r\n/tmp/ghc24ef_0/ghc_3.hc: In function ‘cOa5_entry’:\r\n/tmp/ghc24ef_0/ghc_3.hc:56907:61: error:\r\n error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?\r\n ((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n stg_MUT_ARR_PTRS_FROZEN_DIRTY_info\r\n |\r\n56907 | ((struct {W_ x;} __attribute__((packed))*) _sHDE)->x = (W_)&stg_MUT_ARR_PTRS_FROZEN0_info;\r\n | ^\r\n`gcc' failed in phase `C Compiler'. (Exit code: 1)\r\n<<ghc: 5594223368 bytes, 548 GCs, 37786228/65761936 avg/max bytes residency (14 samples), 177M in use, 0.001 INIT (0.001 elapsed), 6.007 MUT (6.639 elapsed), 2.510 GC (2.514 elapsed) :ghc>>\r\nmake[1]: *** [compiler/ghc.mk:446: compiler/stage1/build/Binary.o] Error 1\r\nmake[1]: *** Waiting for unfinished jobs....\r\nmake: *** [Makefile:125: all] Error 2\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->9.0.1https://gitlab.haskell.org/ghc/ghc/-/issues/15912Output hadrian build data for cabal-helper tool support2020-01-05T18:00:44ZdavideOutput hadrian build data for cabal-helper tool supportAs a step in the direction of adding tool support for ghc development we can output some meta data from Hadrian to better support the cabal-helper tool. Proposed changes:
1. Add a \<ghc-root\>/cabal.helper file that points to the 3 stag...As a step in the direction of adding tool support for ghc development we can output some meta data from Hadrian to better support the cabal-helper tool. Proposed changes:
1. Add a \<ghc-root\>/cabal.helper file that points to the 3 stage build directories under the default Hadrian build dir: _build.
1. Add a "--cabal-helper" command line option to Hadrian that enables this output.
1. Output \<build-root\>/stage\<x\>/build.helper in JSON format containing per package:
- .cabal file path relative to \<ghc-root\> (achieved by prefixing paths with $PROJECTDIR) e.g $PROJECTDIR/libraries/binary/binary.cabal
- source path e.g. $PROJECTDIR/libraries/binary/binary.cabal
- Build "dist directory", which is the directory containing the setup-config file generated by cabal on build. this is a relative path e.g. libraries/binary/setup-config
\#\# TODO
- decide on the naming of files
\#\# Implementation
- See:
\* Packages.ghcPackages
\* Hadrian.Package.pkgCabalFile
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------------- |
| Version | 8.6.2 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System (Hadrian) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | DanielG |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Output hadrian build data for cabal-helper tool support","status":"New","operating_system":"","component":"Build System (Hadrian)","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":["cabal-helper","hadrian","support","tool"],"differentials":[],"test_case":"","architecture":"","cc":["DanielG"],"type":"FeatureRequest","description":"As a step in the direction of adding tool support for ghc development we can output some meta data from Hadrian to better support the cabal-helper tool. Proposed changes:\r\n\r\n1. Add a <ghc-root>/cabal.helper file that points to the 3 stage build directories under the default Hadrian build dir: _build.\r\n2. Add a \"--cabal-helper\" command line option to Hadrian that enables this output.\r\n3. Output <build-root>/stage<x>/build.helper in JSON format containing per package:\r\n * .cabal file path relative to <ghc-root> (achieved by prefixing paths with $PROJECTDIR) e.g $PROJECTDIR/libraries/binary/binary.cabal\r\n * source path e.g. $PROJECTDIR/libraries/binary/binary.cabal\r\n * Build \"dist directory\", which is the directory containing the setup-config file generated by cabal on build. this is a relative path e.g. libraries/binary/setup-config\r\n\r\n## TODO\r\n\r\n* decide on the naming of files\r\n\r\n## Implementation\r\n\r\n* See:\r\n * Packages.ghcPackages\r\n * Hadrian.Package.pkgCabalFile","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15911internal error: evacuate(static): strange closure type -1275332472019-07-07T18:02:29Zbfraikininternal error: evacuate(static): strange closure type -127533247internal error: evacuate(static): strange closure type -127533247
(GHC version 8.4.4 for x86_64_apple_darwin)
> Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Abort trap: 6
<details><summary>Trac metadata</s...internal error: evacuate(static): strange closure type -127533247
(GHC version 8.4.4 for x86_64_apple_darwin)
> Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Abort trap: 6
<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":"internal error: evacuate(static): strange closure type -127533247","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":"internal error: evacuate(static): strange closure type -127533247\r\n (GHC version 8.4.4 for x86_64_apple_darwin)\r\n Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\nAbort trap: 6","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15910GHC missreports import as redundant.2019-07-07T18:02:29ZAndreas KlebingerGHC missreports import as redundant.In the following code GHC claims the first import is redundant.
```
import Data.Map (Map)
import qualified Data.Map as M
type MT = Map
```
```
test.hs:5:1: warning: [-Wunused-imports]
The qualified import of `Data.Map' is redunda...In the following code GHC claims the first import is redundant.
```
import Data.Map (Map)
import qualified Data.Map as M
type MT = Map
```
```
test.hs:5:1: warning: [-Wunused-imports]
The qualified import of `Data.Map' is redundant
except perhaps to import instances from `Data.Map'
To import instances alone, use: import Data.Map()
|
5 | import qualified Data.Map as M
```
Reproduceable on 8.4 and HEAD at least.
<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 missreports import as redundant.","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":"In the following code GHC claims the first import is redundant.\r\n\r\n{{{\r\nimport Data.Map (Map)\r\n\r\nimport qualified Data.Map as M\r\n\r\ntype MT = Map\r\n}}}\r\n\r\n\r\n{{{\r\ntest.hs:5:1: warning: [-Wunused-imports]\r\n The qualified import of `Data.Map' is redundant\r\n except perhaps to import instances from `Data.Map'\r\n To import instances alone, use: import Data.Map()\r\n |\r\n5 | import qualified Data.Map as M\r\n}}}\r\n\r\n\r\nReproduceable on 8.4 and HEAD at least.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15909prepareAlts does not take into account equalities which are in scope2019-07-07T18:02:29ZMatthew PickeringprepareAlts does not take into account equalities which are in scopeIf we consider this program submitted for our consideration by Andres we see some surprising behaviour.
https://gist.github.com/kosmikus/237946a2335600690208a4a36efef988
```
{-# LANGUAGE TypeOperators, GADTs, FlexibleContexts, DataKind...If we consider this program submitted for our consideration by Andres we see some surprising behaviour.
https://gist.github.com/kosmikus/237946a2335600690208a4a36efef988
```
{-# LANGUAGE TypeOperators, GADTs, FlexibleContexts, DataKinds, RankNTypes, PolyKinds, TypeFamilies, MultiParamTypeClasses, UndecidableInstances, UndecidableSuperClasses, FlexibleInstances, ConstraintKinds, TypeApplications, EmptyCase, ScopedTypeVariables, PartialTypeSignatures, TemplateHaskell #-}
module Partition where
import Data.Coerce
import Data.Kind
import Data.Proxy
data NP (f :: k -> Type) (xs :: [k]) where
Nil :: NP f '[]
(:*) :: f x -> NP f xs -> NP f (x : xs)
infixr 5 :*
strictToPair :: forall f a b . NP f '[a, b] -> (f a, f b)
strictToPair np =
case np of
(fx :* fxs) ->
case (fxs {- :: NP f '[b] -}) of
(fy :* fys) ->
(fx, fy)
```
Both pattern matches are exhaustive so we don't need to generate any failure cases when pattern matching.
Notice in the generated core that we have a match on `Partition.Nil` even though the match will never
be reached.
```
Partition.strictToPair
:: forall k (f :: k -> *) (a :: k) (b :: k).
Partition.NP f '[a, b] -> (f a, f b)
[GblId, Arity=1, Str=<S,1*U>m, Unf=OtherCon []]
Partition.strictToPair
= \ (@ k_a1gV)
(@ (f_a1gW :: k_a1gV -> *))
(@ (a_a1gX :: k_a1gV))
(@ (b_a1gY :: k_a1gV))
(np_s1yz [Occ=Once!] :: Partition.NP f_a1gW '[a_a1gX, b_a1gY]) ->
case np_s1yz of
{ Partition.:* @ x_a1h2 @ xs_a1h3 co_a1h4 fx_s1yB [Occ=Once]
fxs_s1yC [Occ=Once!] ->
case fxs_s1yC of {
Partition.Nil _ [Occ=Dead, Dmd=<B,A>] ->
Partition.strictToPair1 @ k_a1gV @ a_a1gX @ f_a1gW @ b_a1gY;
Partition.:* @ x1_a1h7 @ xs1_a1h8 co1_a1h9 fy_s1yE [Occ=Once]
_ [Occ=Dead] ->
(fx_s1yB
`cast` (<f_a1gW>_R (Nth:1 (Sym co_a1h4))
:: (f_a1gW x_a1h2 :: *) ~R# (f_a1gW a_a1gX :: *)),
fy_s1yE
`cast` (<f_a1gW>_R (Nth:1 (Sym co1_a1h9 ; Nth:2 (Sym co_a1h4)))
:: (f_a1gW x1_a1h7 :: *) ~R# (f_a1gW b_a1gY :: *)))
}
}
```
This is because in `prepareAlts` are try to inspect the type of `fxs` which looks like a type variable, however it has since been refined by the pattern match on `np` above. Adding the explicit type signature to `fxs` makes `prepareAlts` treat it correctly.
<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":"prepareAlts does not take into account equalities which are in scope","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":"If we consider this program submitted for our consideration by Andres we see some surprising behaviour.\r\n\r\nhttps://gist.github.com/kosmikus/237946a2335600690208a4a36efef988\r\n\r\n{{{\r\n{-# LANGUAGE TypeOperators, GADTs, FlexibleContexts, DataKinds, RankNTypes, PolyKinds, TypeFamilies, MultiParamTypeClasses, UndecidableInstances, UndecidableSuperClasses, FlexibleInstances, ConstraintKinds, TypeApplications, EmptyCase, ScopedTypeVariables, PartialTypeSignatures, TemplateHaskell #-}\r\nmodule Partition where\r\n\r\nimport Data.Coerce\r\nimport Data.Kind\r\nimport Data.Proxy\r\n\r\ndata NP (f :: k -> Type) (xs :: [k]) where\r\n Nil :: NP f '[]\r\n (:*) :: f x -> NP f xs -> NP f (x : xs)\r\n\r\ninfixr 5 :*\r\n\r\nstrictToPair :: forall f a b . NP f '[a, b] -> (f a, f b)\r\nstrictToPair np =\r\n case np of\r\n (fx :* fxs) ->\r\n case (fxs {- :: NP f '[b] -}) of\r\n (fy :* fys) ->\r\n (fx, fy)\r\n}}}\r\n\r\nBoth pattern matches are exhaustive so we don't need to generate any failure cases when pattern matching. \r\n\r\nNotice in the generated core that we have a match on `Partition.Nil` even though the match will never\r\nbe reached. \r\n\r\n\r\n{{{\r\n Partition.strictToPair \r\n :: forall k (f :: k -> *) (a :: k) (b :: k). \r\n Partition.NP f '[a, b] -> (f a, f b) \r\n [GblId, Arity=1, Str=<S,1*U>m, Unf=OtherCon []] \r\n Partition.strictToPair \r\n = \\ (@ k_a1gV) \r\n (@ (f_a1gW :: k_a1gV -> *)) \r\n (@ (a_a1gX :: k_a1gV)) \r\n (@ (b_a1gY :: k_a1gV)) \r\n (np_s1yz [Occ=Once!] :: Partition.NP f_a1gW '[a_a1gX, b_a1gY]) -> \r\n case np_s1yz of \r\n { Partition.:* @ x_a1h2 @ xs_a1h3 co_a1h4 fx_s1yB [Occ=Once] \r\n fxs_s1yC [Occ=Once!] -> \r\n case fxs_s1yC of { \r\n Partition.Nil _ [Occ=Dead, Dmd=<B,A>] -> \r\n Partition.strictToPair1 @ k_a1gV @ a_a1gX @ f_a1gW @ b_a1gY; \r\n Partition.:* @ x1_a1h7 @ xs1_a1h8 co1_a1h9 fy_s1yE [Occ=Once] \r\n _ [Occ=Dead] -> \r\n (fx_s1yB \r\n `cast` (<f_a1gW>_R (Nth:1 (Sym co_a1h4)) \r\n :: (f_a1gW x_a1h2 :: *) ~R# (f_a1gW a_a1gX :: *)), \r\n fy_s1yE \r\n `cast` (<f_a1gW>_R (Nth:1 (Sym co1_a1h9 ; Nth:2 (Sym co_a1h4))) \r\n :: (f_a1gW x1_a1h7 :: *) ~R# (f_a1gW b_a1gY :: *))) \r\n } \r\n } \r\n}}}\r\n\r\nThis is because in `prepareAlts` are try to inspect the type of `fxs` which looks like a type variable, however it has since been refined by the pattern match on `np` above. Adding the explicit type signature to `fxs` makes `prepareAlts` treat it correctly. ","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15908Hadrian: Spurious build failure on fresh build2021-05-11T10:02:44ZGabor GreifHadrian: Spurious build failure on fresh buildOn a freshly checked-out (Windows10 64)ghc tree I was building with hadrian (`hadrian/build.bat -j`). It aborted here:
```
\| Run Ghc CompileHs Stage1: libraries/pretty/src/Text/PrettyPrint/Annotated.hs =\> _build/stage1/libraries/prett...On a freshly checked-out (Windows10 64)ghc tree I was building with hadrian (`hadrian/build.bat -j`). It aborted here:
```
\| Run Ghc CompileHs Stage1: libraries/pretty/src/Text/PrettyPrint/Annotated.hs =\> _build/stage1/libraries/pretty/build/Text/PrettyPrint/Annotated.o
\| Run Ar Pack Stage1: _build/stage1/libraries/stm/build/Control/Concurrent/STM.p_o (and 9 more) =\> _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a
C:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe: creating _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a
C:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe: unable to rename '_build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a'; reason: File exists
shakeArgsWith 0.001s 0%
Function shake 0.317s 0%
Database read 0.468s 0%
With database 0.013s 0%
Running rules 3492.921s 99% =========================
Total 3493.720s 100%
Error when running Shake build system:
- _build/stage1/lib/package.conf.d/stm-2.5.0.0.conf
- _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a
user error (Development.Shake.cmd, system command failed
Command: C:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe q _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a \@C:\\Users\\ggreif\\AppData\\Local\\Temp\\extA08E
Exit code: 1
Stderr:
C:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe: creating _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a
C:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe: unable to rename '_build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a'; reason: File exists
)
```
Can this be a concurrency problem, while renaming archives?
Anyway it healed after restarting Hadrian.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------------- |
| Version | 8.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System (Hadrian) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Hadrian: Spurious build failure on fresh build","status":"New","operating_system":"","component":"Build System (Hadrian)","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"On a freshly checked-out (Windows10 64)ghc tree I was building with hadrian (`hadrian/build.bat -j`). It aborted here:\r\n\r\n| Run Ghc CompileHs Stage1: libraries/pretty/src/Text/PrettyPrint/Annotated.hs => _build/stage1/libraries/pretty/build/Text/PrettyPrint/Annotated.o\r\n| Run Ar Pack Stage1: _build/stage1/libraries/stm/build/Control/Concurrent/STM.p_o (and 9 more) => _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a\r\nC:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe: creating _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a\r\nC:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe: unable to rename '_build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a'; reason: File exists\r\nshakeArgsWith 0.001s 0%\r\nFunction shake 0.317s 0%\r\nDatabase read 0.468s 0%\r\nWith database 0.013s 0%\r\nRunning rules 3492.921s 99% =========================\r\nTotal 3493.720s 100%\r\nError when running Shake build system:\r\n* _build/stage1/lib/package.conf.d/stm-2.5.0.0.conf\r\n* _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a\r\nuser error (Development.Shake.cmd, system command failed\r\nCommand: C:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe q _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a @C:\\Users\\ggreif\\AppData\\Local\\Temp\\extA08E\r\nExit code: 1\r\nStderr:\r\nC:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe: creating _build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a\r\nC:/Users/ggreif/ghc/inplace/mingw/bin/ar.exe: unable to rename '_build/stage1/libraries/stm/build/libHSstm-2.5.0.0_p.a'; reason: File exists\r\n)\r\n\r\nCan this be a concurrency problem, while renaming archives?\r\n\r\nAnyway it healed after restarting Hadrian.\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->Make removalhttps://gitlab.haskell.org/ghc/ghc/-/issues/15907memo001 causes compile time panic with fails with -O -dannot-lint2019-07-07T18:02:30ZÖmer Sinan Ağacanmemo001 causes compile time panic with fails with -O -dannot-lint```
$ cd libraries/base/tests; ghc-stage2 memo001.hs -O -dannot-lint
[1 of 2] Compiling Memo1 ( Memo1.lhs, Memo1.o ) [Optimisation flags changed]
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181116 for x...```
$ cd libraries/base/tests; ghc-stage2 memo001.hs -O -dannot-lint
[1 of 2] Compiling Memo1 ( Memo1.lhs, Memo1.o ) [Optimisation flags changed]
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181116 for x86_64-unknown-linux):
idInfo
val_a3pf
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/basicTypes/Var.hs:567:34 in ghc:Var
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.7 |
| 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":"memo001 causes compile time panic with fails with -O -dannot-lint","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\n$ cd libraries/base/tests; ghc-stage2 memo001.hs -O -dannot-lint\r\n[1 of 2] Compiling Memo1 ( Memo1.lhs, Memo1.o ) [Optimisation flags changed]\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.7.20181116 for x86_64-unknown-linux):\r\n idInfo\r\n val_a3pf\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/basicTypes/Var.hs:567:34 in ghc:Var\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->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.3