GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:32:19Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/11061GHC 7.10.3 RC1: build broken on OS X2019-07-07T18:32:19ZPeter Trommlerptrommler@acm.orgGHC 7.10.3 RC1: build broken on OS XRichard reported on ghc-devs:
> ```
> checking for readelf... no
> configure: error: cannot find readelf in your PATH
> ```
OS X uses Mach-O not ELF. So `readelf` does not work on Mach-O binaries.
<details><summary>Trac metadata</summ...Richard reported on ghc-devs:
> ```
> checking for readelf... no
> configure: error: cannot find readelf in your PATH
> ```
OS X uses Mach-O not ELF. So `readelf` does not work on Mach-O binaries.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.10.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC 7.10.3 RC1: build broken on OS X","status":"New","operating_system":"","component":"Build System","related":[],"milestone":"7.10.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.10.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Richard reported on ghc-devs:\r\n> {{{\r\n> checking for readelf... no\r\n> configure: error: cannot find readelf in your PATH\r\n> }}}\r\n\r\nOS X uses Mach-O not ELF. So `readelf` does not work on Mach-O binaries.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.3https://gitlab.haskell.org/ghc/ghc/-/issues/10826[Security] Safe Haskell can be bypassed via annotations2019-07-07T18:33:42Zspinda[Security] Safe Haskell can be bypassed via annotations```
module Test (hook) where
import System.IO.Unsafe
{-# ANN hook (unsafePerformIO (putStrLn "Woops.")) #-}
hook = undefined
```
```
➜ Test ghc -fpackage-trust -XSafe Test_simple.hs
[1 of 1] Compiling Test_simple ( Test_simple....```
module Test (hook) where
import System.IO.Unsafe
{-# ANN hook (unsafePerformIO (putStrLn "Woops.")) #-}
hook = undefined
```
```
➜ Test ghc -fpackage-trust -XSafe Test_simple.hs
[1 of 1] Compiling Test_simple ( Test_simple.hs, Test_simple.o ) [flags changed]
Woops.
Test_simple.hs:4:1:
System.IO.Unsafe: Can't be safely imported!
The module itself isn't safe.
```
GHC ultimately rejects the program due to the `System.IO.Unsafe` import, but this check doesn't occur until GHC has compiled and run the annotation expression, allowing arbitrary IO operations via `unsafePerformIO`.
The solution is probably to move the import check from the end of renaming/typechecking to the start.7.10.3kanetwkanetwhttps://gitlab.haskell.org/ghc/ghc/-/issues/10489Panic in TcEvidence due to wrong role2023-06-16T21:25:26ZRichard Eisenbergrae@richarde.devPanic in TcEvidence due to wrong roleThis single line tickles it:
```
convert d = let d' = case d of '0' -> '!' in d'
```
produces
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.11.20150604 for x86_64-apple-darwin):
ASSERT failed!
file compiler/typecheck...This single line tickles it:
```
convert d = let d' = case d of '0' -> '!' in d'
```
produces
```
ghc: panic! (the 'impossible' happened)
(GHC version 7.11.20150604 for x86_64-apple-darwin):
ASSERT failed!
file compiler/typecheck/TcEvidence.hs line 600 Sym cobox_af8M
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
The failing assertion is about roles. Will look into this tomorrow.
Labeling this "highest" because it's a very silly regression.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.11 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Panic in TcEvidence due to wrong role","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.11","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This single line tickles it:\r\n\r\n{{{\r\nconvert d = let d' = case d of '0' -> '!' in d'\r\n}}}\r\n\r\nproduces\r\n\r\n{{{\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.11.20150604 for x86_64-apple-darwin):\r\n\tASSERT failed!\r\n file compiler/typecheck/TcEvidence.hs line 600 Sym cobox_af8M\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\nThe failing assertion is about roles. Will look into this tomorrow.\r\n\r\nLabeling this \"highest\" because it's a very silly regression.","type_of_failure":"OtherFailure","blocking":[]} -->7.10.3https://gitlab.haskell.org/ghc/ghc/-/issues/7830Error: operand out of range2019-07-07T18:47:54ZerikdError: operand out of rangeCompiling on linux-powerpc and linux-powerpc64 I get:
```
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Werror -Wall \
-H64m -O0 -package-name time-1.4.0.2 -hide-all-packages -i -ilibraries/time/. \
...Compiling on linux-powerpc and linux-powerpc64 I get:
```
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Werror -Wall \
-H64m -O0 -package-name time-1.4.0.2 -hide-all-packages -i -ilibraries/time/. \
-ilibraries/time/dist-install/build -ilibraries/time/dist-install/build/autogen \
-Ilibraries/time/dist-install/build -Ilibraries/time/dist-install/build/autogen \
-Ilibraries/time/include -optP-DLANGUAGE_Rank2Types -optP \
DLANGUAGE_DeriveDataTypeable -optP-DLANGUAGE_StandaloneDeriving -optP-include \
-optPlibraries/time/dist-install/build/autogen/cabal_macros.h -package base-4.7.0.0 \
-package deepseq-1.3.0.2 -package old-locale-1.0.0.5 -Wall -XHaskell2010 -XRank2Types \
-XDeriveDataTypeable -XStandaloneDeriving -XCPP -O2 -O -dcore-lint \
-fno-warndeprecated-flags -no-user-package-db -rtsopts -fno-warn-unused-do-bind \
-fno-warn-deprecations -fno-warn-unused-imports -fno-warn-identities -odir \
libraries/time/dist-install/build -hidir libraries/time/dist-install/build -stubdir \
libraries/time/dist-install/build -dynamic-too -c libraries/time/./Data/Time/Format.hs \
-o libraries/time/dist-install/build/Data/Time/Format.o -dyno \
libraries/time/dist-install/build/Data/Time/Format.dyn_o
/tmp/ghc2806_0/ghc2806_1.s: Assembler messages:
/tmp/ghc2806_0/ghc2806_1.s:51766:0:
Error: operand out of range (0x000000000000adf8 is not between 0xffffffffffff8000 and 0x0000000000007fff)
/tmp/ghc2806_0/ghc2806_1.s:51798:0:
Error: operand out of range (0x000000000000ad90 is not between 0xffffffffffff8000 and 0x0000000000007fff)
/tmp/ghc2806_0/ghc2806_1.s:51830:0:
Error: operand out of range (0x000000000000ad28 is not between 0xffffffffffff8000 and 0x0000000000007fff)
/tmp/ghc2806_0/ghc2806_1.s:51908:0:
Error: operand out of range (0x000000000000ac1c is not between 0xffffffffffff8000 and 0x0000000000007fff)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.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":"Error: operand out of range","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.7","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Compiling on linux-powerpc and linux-powerpc64 I get:\r\n\r\n{{{\r\n\"inplace/bin/ghc-stage1\" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -Werror -Wall \\\r\n -H64m -O0 -package-name time-1.4.0.2 -hide-all-packages -i -ilibraries/time/. \\\r\n -ilibraries/time/dist-install/build -ilibraries/time/dist-install/build/autogen \\\r\n -Ilibraries/time/dist-install/build -Ilibraries/time/dist-install/build/autogen \\\r\n -Ilibraries/time/include -optP-DLANGUAGE_Rank2Types -optP \\\r\n DLANGUAGE_DeriveDataTypeable -optP-DLANGUAGE_StandaloneDeriving -optP-include \\\r\n -optPlibraries/time/dist-install/build/autogen/cabal_macros.h -package base-4.7.0.0 \\\r\n -package deepseq-1.3.0.2 -package old-locale-1.0.0.5 -Wall -XHaskell2010 -XRank2Types \\\r\n -XDeriveDataTypeable -XStandaloneDeriving -XCPP -O2 -O -dcore-lint \\\r\n -fno-warndeprecated-flags -no-user-package-db -rtsopts -fno-warn-unused-do-bind \\\r\n -fno-warn-deprecations -fno-warn-unused-imports -fno-warn-identities -odir \\\r\n libraries/time/dist-install/build -hidir libraries/time/dist-install/build -stubdir \\ \r\n libraries/time/dist-install/build -dynamic-too -c libraries/time/./Data/Time/Format.hs \\\r\n -o libraries/time/dist-install/build/Data/Time/Format.o -dyno \\\r\n libraries/time/dist-install/build/Data/Time/Format.dyn_o\r\n/tmp/ghc2806_0/ghc2806_1.s: Assembler messages:\r\n\r\n/tmp/ghc2806_0/ghc2806_1.s:51766:0:\r\n Error: operand out of range (0x000000000000adf8 is not between 0xffffffffffff8000 and 0x0000000000007fff)\r\n\r\n/tmp/ghc2806_0/ghc2806_1.s:51798:0:\r\n Error: operand out of range (0x000000000000ad90 is not between 0xffffffffffff8000 and 0x0000000000007fff)\r\n\r\n/tmp/ghc2806_0/ghc2806_1.s:51830:0:\r\n Error: operand out of range (0x000000000000ad28 is not between 0xffffffffffff8000 and 0x0000000000007fff)\r\n\r\n/tmp/ghc2806_0/ghc2806_1.s:51908:0:\r\n Error: operand out of range (0x000000000000ac1c is not between 0xffffffffffff8000 and 0x0000000000007fff)\r\n}}}\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.10.3Peter Trommlerptrommler@acm.orgPeter Trommlerptrommler@acm.org