GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:55:00Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/5495simple program fails with -shared on mac2019-07-07T18:55:00Zmwottonsimple program fails with -shared on mac```
sleipnir ➜ ~ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.2.1
sleipnir ➜ ~ ghc --make foo.hs -shared
[1 of 1] Compiling Main ( foo.hs, foo.o )
Linking foo ...
collect2: ld terminated with s...```
sleipnir ➜ ~ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.2.1
sleipnir ➜ ~ ghc --make foo.hs -shared
[1 of 1] Compiling Main ( foo.hs, foo.o )
Linking foo ...
collect2: ld terminated with signal 11 [Segmentation fault]
sleipnir ➜ ~ cat foo.hs
main = putStrLn "hi"
```
This happened on both of the two systems I tried it on. Package installed from
http://www.haskell.org/ghc/dist/7.2.1/GHC-7.2.1-x86_64.pkg8.0.1https://gitlab.haskell.org/ghc/ghc/-/issues/5448GHC stuck in infinite loop compiling with optimizations2023-04-01T12:19:19ZronwalfGHC stuck in infinite loop compiling with optimizationsGHC gets stuck compiling the attached program.
Removing 'deriving Eq' from the last line restores GHC's ability to terminate.
Is this the same as the [inliner loop bug](http://haskell.org/ghc/docs/6.12.2/html/users_guide/bugs.html)? Who...GHC gets stuck compiling the attached program.
Removing 'deriving Eq' from the last line restores GHC's ability to terminate.
Is this the same as the [inliner loop bug](http://haskell.org/ghc/docs/6.12.2/html/users_guide/bugs.html)? Who knows.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.0.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | MacOS X |
| Architecture | x86_64 (amd64) |
</details>
<!-- {"blocked_by":[],"summary":"GHC stuck in infinite loop compiling with optimizations","status":"New","operating_system":"MacOS X","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.0.3","keywords":[],"differentials":[],"test_case":"","architecture":"x86_64 (amd64)","cc":[""],"type":"Bug","description":"GHC gets stuck compiling the attached program. \r\nRemoving 'deriving Eq' from the last line restores GHC's ability to terminate.\r\n\r\nIs this the same as the [http://haskell.org/ghc/docs/6.12.2/html/users_guide/bugs.html inliner loop bug]? Who knows.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/5400GHC loops on compiling with optimizations2023-04-01T12:16:23ZnoschinlGHC loops on compiling with optimizationsWhen compiling the snippet below with optimizations enabled (i.e. `ghc -O test.hs`), GHC does not seem to terminate. This happens with at least 7.0.3 and 7.0.4. Without optimizations, it builds fine.
```
data A = A Int
class C a where ...When compiling the snippet below with optimizations enabled (i.e. `ghc -O test.hs`), GHC does not seem to terminate. This happens with at least 7.0.3 and 7.0.4. Without optimizations, it builds fine.
```
data A = A Int
class C a where
fromHsk :: C a => a -> Int
instance C Int where
fromHsk = fromHsk
instance C A where
fromHsk (A s) = fromHsk s
main = undefined
```
When building this example with GHC 6.12.4, it fails with a complaint about the bogus type constraints in the declaration of fromHsk:
```
test.hs:3:0:
All of the type variables in the constraint `C a'
are already in scope (at least one must be universally quantified here)
(Use -XFlexibleContexts to lift this restriction)
When checking the class method: fromHsk :: (C a) => a -> Int
In the class declaration for `C'
```
After removing these unneeded constraint (i.e. changing the declaration of `fromHsk` to `fromHsk :: a -> Int`, the snippet above builds even with GHC 7.0.4 and optimizations.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.0.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 loops on compiling with optimizations","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.0.4","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"When compiling the snippet below with optimizations enabled (i.e. `ghc -O test.hs`), GHC does not seem to terminate. This happens with at least 7.0.3 and 7.0.4. Without optimizations, it builds fine.\r\n\r\n{{{\r\ndata A = A Int\r\n\r\nclass C a where \r\n fromHsk :: C a => a -> Int\r\n\r\ninstance C Int where \r\n fromHsk = fromHsk\r\n\r\ninstance C A where \r\n fromHsk (A s) = fromHsk s\r\n\r\nmain = undefined\r\n\r\n}}}\r\n\r\nWhen building this example with GHC 6.12.4, it fails with a complaint about the bogus type constraints in the declaration of fromHsk:\r\n\r\n{{{\r\ntest.hs:3:0:\r\n All of the type variables in the constraint `C a'\r\n are already in scope (at least one must be universally quantified here)\r\n (Use -XFlexibleContexts to lift this restriction)\r\n When checking the class method: fromHsk :: (C a) => a -> Int\r\n In the class declaration for `C'\r\n}}}\r\n\r\nAfter removing these unneeded constraint (i.e. changing the declaration of `fromHsk` to `fromHsk :: a -> Int`, the snippet above builds even with GHC 7.0.4 and optimizations.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/5320check_overlap panic (7.1 regression)2019-07-07T18:55:54Zmikhail.vorozhtsovcheck_overlap panic (7.1 regression)The attached program is rightfully rejected by GHC 7.0.4 (with `"Could not deduce (HMapClass f l) ..."`) but makes GHC HEAD panic:
```
$ ghc-7.3.20110713 Overlap.hs
[1 of 1] Compiling Overlap ( Overlap.hs, Overlap.o )
ghc: pan...The attached program is rightfully rejected by GHC 7.0.4 (with `"Could not deduce (HMapClass f l) ..."`) but makes GHC HEAD panic:
```
$ ghc-7.3.20110713 Overlap.hs
[1 of 1] Compiling Overlap ( Overlap.hs, Overlap.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.3.20110713 for x86_64-unknown-linux):
check_overlap
main:Overlap.HDropClass{tc raS}
main:Overlap.PZero{tc raZ}
(main:Overlap.HMap{tc raN} f{tv adi} [sk] l{tv adk} [sk])
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```
Both versions are built with the devel2 BuildFlavour.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"check_overlap panic (7.1 regression)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The attached program is rightfully rejected by GHC 7.0.4 (with {{{\"Could not deduce (HMapClass f l) ...\"}}}) but makes GHC HEAD panic:\r\n{{{\r\n$ ghc-7.3.20110713 Overlap.hs \r\n[1 of 1] Compiling Overlap ( Overlap.hs, Overlap.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.3.20110713 for x86_64-unknown-linux):\r\n\tcheck_overlap\r\n main:Overlap.HDropClass{tc raS}\r\n main:Overlap.PZero{tc raZ}\r\n (main:Overlap.HMap{tc raN} f{tv adi} [sk] l{tv adk} [sk])\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n}}}\r\nBoth versions are built with the devel2 BuildFlavour.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.0.1Simon Peyton JonesSimon Peyton Jones