GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T19:17:40Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/637Ctrl-Break handler doesn't work in forked threads in "-threaded" RTS2019-07-07T19:17:40Zbulatz@HotPOP.comCtrl-Break handler doesn't work in forked threads in "-threaded" RTSThe following program demonstrates bug in 6.4.1 (6.4.0 was ok).
if you compile it with "-threaded", run and press Ctrl-Break, you will
see message "main.EXE: \<stdin\>: hGetLine: end of file" and program
blocks (because forked thread is ...The following program demonstrates bug in 6.4.1 (6.4.0 was ok).
if you compile it with "-threaded", run and press Ctrl-Break, you will
see message "main.EXE: \<stdin\>: hGetLine: end of file" and program
blocks (because forked thread is dead). the problem is that installed
ctrl-break handler don't called in forked threads
if you compile program without "-threaded" or with 6.4.0, it works as
expected - pressing Ctrl-Break runs my handler so you will see
"Break! main.EXE: thread killed" message
```
import Control.Concurrent
import Control.Exception
import GHC.ConsoleHandler
handleCtrlBreak action = do
myThread <- myThreadId
let onBreak event = do
putStrLn " ^Break!"
killThread myThread
bracket (installHandler$ Catch onBreak) (installHandler) $ \oldHandler -> do
action
main = do
handleCtrlBreak $ do
x <- newEmptyMVar
forkIO$ do a <- getLine
print a
putMVar x ()
return ()
takeMVar x
return ()
```6.6.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/800GHC 6.5 enforces "-x c" option in the Cc phase making it impossibble to compi...2019-07-07T19:16:51Zkyra@veernet.ruGHC 6.5 enforces "-x c" option in the Cc phase making it impossibble to compile C++ files with ghc driverGHC 6.4.x enforces "-x c" option ONLY for HCc phase. This makes possible to use GHC driver to compile C++ files.
GHC 6.5 enforces "-x c" option ALSO for Cc phase. Now ANY file compiled with "-x c" option is treated as "c" file, regardle...GHC 6.4.x enforces "-x c" option ONLY for HCc phase. This makes possible to use GHC driver to compile C++ files.
GHC 6.5 enforces "-x c" option ALSO for Cc phase. Now ANY file compiled with "-x c" option is treated as "c" file, regardless of extension.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 6.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Unknown |
| Architecture | Unknown |
</details>
<!-- {"blocked_by":[],"summary":"GHC 6.5 enforces \"-x c\" option in the Cc phase making it impossibble to compile C++ files with ghc driver","status":"New","operating_system":"Unknown","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"6.5","keywords":[],"differentials":[],"test_case":"","architecture":"Unknown","cc":[""],"type":"Bug","description":"GHC 6.4.x enforces \"-x c\" option ONLY for HCc phase. This makes possible to use GHC driver to compile C++ files.\r\n\r\nGHC 6.5 enforces \"-x c\" option ALSO for Cc phase. Now ANY file compiled with \"-x c\" option is treated as \"c\" file, regardless of extension.","type_of_failure":"OtherFailure","blocking":[]} -->6.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>https://gitlab.haskell.org/ghc/ghc/-/issues/898GHC compiles against Apple's readline, giving error2019-07-07T19:16:23ZdoaitseGHC compiles against Apple's readline, giving errorrl_reset_terminal returns void in Apple's readline, giving the following:
```
../compiler/ghc-inplace -H16m -O -istage2/utils -istage2/basicTypes -istage2/types -istage2/hsSyn -istage2/prelude -istage2/rename -istage2/typecheck ...rl_reset_terminal returns void in Apple's readline, giving the following:
```
../compiler/ghc-inplace -H16m -O -istage2/utils -istage2/basicTypes -istage2/types -istage2/hsSyn -istage2/prelude -istage2/rename -istage2/typecheck -istage2/deSugar -istage2/coreSyn -istage2/specialise -istage2/simplCore -istage2/stranal -istage2/stgSyn -istage2/simplStg -istage2/codeGen -istage2/main -istage2/profiling -istage2/parser -istage2/cprAnalysis -istage2/ndpFlatten -istage2/iface -istage2/cmm -istage2/nativeGen -istage2/ghci -Istage2 -DGHCI -DBREAKPOINT -package template-haskell -threaded -package readline -DUSE_READLINE -cpp -fglasgow-exts -fno-generics -Rghc-timing -I. -Iparser -package unix -package Cabal -package regex-compat -ignore-package lang -recomp -Rghc-timing -H16M '-#include "cutils.h"' -package-name ghc-6.5 -fgenerics -fno-cse -c ghci/InteractiveUI.hs -o stage2/ghci/InteractiveUI.o -ohi stage2/ghci/InteractiveUI.hi
/tmp/ghc28340_0/ghc28340_0.hc: In function 'slM3_ret':
/tmp/ghc28340_0/ghc28340_0.hc:43149:0:
error: void value not ignored as it ought to be
/tmp/ghc28340_0/ghc28340_0.hc: In function 'slLX_ret':
/tmp/ghc28340_0/ghc28340_0.hc:43181:0:
error: void value not ignored as it ought to be
<<ghc: 779741800 bytes, 1303 GCs, 18829642/33857204 avg/max bytes residency (8 samples), 88M in use, 0.01 INIT (0.00 elapsed), 2.75 MUT (12.86 elapsed), 1.97 GC (2.10 elapsed) :ghc>>
make[2]: *** [stage2/ghci/InteractiveUI.o] Error 1
make[1]: *** [stage2] Error 2
make: *** [bootstrap2] Error 2
```
Also, configure was run with
```
./configure --with-readline-includes=/opt/local/include/ --with-readline-libraries=/opt/local/lib
```
so it should not have been using this readline at all.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 6.5 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC compiles against Apple's readline, giving error","status":"New","operating_system":"","component":"Build System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"6.5","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"rl_reset_terminal returns void in Apple's readline, giving the following:\r\n\r\n{{{\r\n../compiler/ghc-inplace -H16m -O -istage2/utils -istage2/basicTypes -istage2/types -istage2/hsSyn -istage2/prelude -istage2/rename -istage2/typecheck -istage2/deSugar -istage2/coreSyn -istage2/specialise -istage2/simplCore -istage2/stranal -istage2/stgSyn -istage2/simplStg -istage2/codeGen -istage2/main -istage2/profiling -istage2/parser -istage2/cprAnalysis -istage2/ndpFlatten -istage2/iface -istage2/cmm -istage2/nativeGen -istage2/ghci -Istage2 -DGHCI -DBREAKPOINT -package template-haskell -threaded -package readline -DUSE_READLINE -cpp -fglasgow-exts -fno-generics -Rghc-timing -I. -Iparser -package unix -package Cabal -package regex-compat -ignore-package lang -recomp -Rghc-timing -H16M '-#include \"cutils.h\"' -package-name ghc-6.5 -fgenerics -fno-cse -c ghci/InteractiveUI.hs -o stage2/ghci/InteractiveUI.o -ohi stage2/ghci/InteractiveUI.hi\r\n/tmp/ghc28340_0/ghc28340_0.hc: In function 'slM3_ret':\r\n\r\n/tmp/ghc28340_0/ghc28340_0.hc:43149:0:\r\n error: void value not ignored as it ought to be\r\n/tmp/ghc28340_0/ghc28340_0.hc: In function 'slLX_ret':\r\n\r\n/tmp/ghc28340_0/ghc28340_0.hc:43181:0:\r\n error: void value not ignored as it ought to be\r\n<<ghc: 779741800 bytes, 1303 GCs, 18829642/33857204 avg/max bytes residency (8 samples), 88M in use, 0.01 INIT (0.00 elapsed), 2.75 MUT (12.86 elapsed), 1.97 GC (2.10 elapsed) :ghc>>\r\nmake[2]: *** [stage2/ghci/InteractiveUI.o] Error 1\r\nmake[1]: *** [stage2] Error 2\r\nmake: *** [bootstrap2] Error 2\r\n}}}\r\n\r\nAlso, configure was run with\r\n{{{\r\n./configure --with-readline-includes=/opt/local/include/ --with-readline-libraries=/opt/local/lib\r\n}}}\r\nso it should not have been using this readline at all.","type_of_failure":"OtherFailure","blocking":[]} -->6.6.1thorkilnaurthorkilnaurhttps://gitlab.haskell.org/ghc/ghc/-/issues/1013interpretBCO: unknown or unimplemented opcode 643562019-07-07T19:15:52ZdonsinterpretBCO: unknown or unimplemented opcode 64356Code recently posted to the mailing list elicits a runtime error in the GHCi bytecode interpreter.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version ...Code recently posted to the mailing list elicits a runtime error in the GHCi bytecode interpreter.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 6.6 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Unknown |
| Architecture | Unknown |
</details>
<!-- {"blocked_by":[],"summary":"interpretBCO: unknown or unimplemented opcode 64356","status":"New","operating_system":"Unknown","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"6.6","keywords":[],"differentials":[],"test_case":"","architecture":"Unknown","cc":[""],"type":"Bug","description":"Code recently posted to the mailing list elicits a runtime error in the GHCi bytecode interpreter.","type_of_failure":"OtherFailure","blocking":[]} -->6.6.1Simon MarlowSimon Marlow