GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2022-02-23T20:12:43Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/21095Fix for enabling external interpreter if we don't have internal interpreter d...2022-02-23T20:12:43ZMatthew PickeringFix for enabling external interpreter if we don't have internal interpreter does nothing (#16331)If you inspect the logic in `GHC.Driver.Pipeline` there is this snippet.
```
-- #16331 - when no "internal interpreter" is available but we
-- need to process some TemplateHaskell or QuasiQuotes, we automatic...If you inspect the logic in `GHC.Driver.Pipeline` there is this snippet.
```
-- #16331 - when no "internal interpreter" is available but we
-- need to process some TemplateHaskell or QuasiQuotes, we automatically
-- turn on -fexternal-interpreter.
dflags2 = if not internalInterpreter
then gopt_set dflags1 Opt_ExternalInterpreter
else dflags1
```
but then if you look at the definition of `internalInterpreter`
```
internalInterpreter = not (gopt Opt_ExternalInterpreter lcl_dflags)
```
So we only enable this extension if it is already set.Matthew PickeringMatthew Pickeringhttps://gitlab.haskell.org/ghc/ghc/-/issues/20955Make iserv work with WinIO2023-03-06T17:24:41ZBen GamariMake iserv work with WinIOCurrently quite a large fraction of the testsuite fails on Windows when run with WinIO. See !6390.Currently quite a large fraction of the testsuite fails on Windows when run with WinIO. See !6390.Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/20794iserv-proxy is not tested on CI (and can't be), should it even be in the tree?2022-05-09T13:19:45ZMatthew Pickeringiserv-proxy is not tested on CI (and can't be), should it even be in the tree?`iserv-proxy` depends on `network` and so is never built or tested.
Why is this package in the GHC tree at all? It seems that it should be moved out and maintained externally by users of this feature.`iserv-proxy` depends on `network` and so is never built or tested.
Why is this package in the GHC tree at all? It seems that it should be moved out and maintained externally by users of this feature.https://gitlab.haskell.org/ghc/ghc/-/issues/19299GHCi crashes with external interpreter and user defined prompt function2021-04-29T13:28:29ZRoland SennGHCi crashes with external interpreter and user defined prompt function## Summary
GHCi crashes in `:set prompt-function` after switching `on` or `off` the
external interpreter.
## Steps to reproduce
#### 1. Switch off external-interpreter
~~~~
$ ghci Test.hs -fexternal-interpreter
GHCi, version 8.10.2: ...## Summary
GHCi crashes in `:set prompt-function` after switching `on` or `off` the
external interpreter.
## Steps to reproduce
#### 1. Switch off external-interpreter
~~~~
$ ghci Test.hs -fexternal-interpreter
GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Test ( Test.hs, interpreted )
Ok, one module loaded.
*Test> :set prompt-function myprompt
ghc: this operation requires -fno-external-interpreter
*Test> :set -fno-external-interpreter
*Test> :set prompt-function myprompt
ghc-iserv: {handle: <file descriptor: 23>}: GHCi.Message.remoteCall: end of file
Speicherzugriffsfehler
~~~~
*Speicherzugriffsfehler* is the German word for *access violation*.
#### 2. Switch on external-interpreter
~~~~
$ ghci Test.hs
GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Test ( Test.hs, interpreted )
Ok, one module loaded.
*Test> :set prompt-function myprompt
*Test 2_: :set -fexternal-interpreter
*Test 3_: :set prompt-function myprompt
ghc: ghc-iserv terminated (-11)
Leaving GHCi.
~~~~
The contents of `Test.hs` is:
~~~~
import Data.List (intersperse)
myprompt :: [String] -> Int -> IO String
myprompt mod_names stmt_nr =
return $ concat (intersperse " " mod_names) ++ " " ++ show stmt_nr ++ "_: "
~~~~
## Expected behavior
* GHCi should not crash, `ghc-iserv` should not terminate.
* Don't allow the use of `:set -fexternal-interpreter`
or `:set -fno-external-interpreter` in the middle of a GHCi session.
Both flags should be *command-line only*.
## Environment
* GHC version used: 8.10.2
Optional:
* Operating System: Debian GNU/Linux 10
* System Architecture: x86-64Roland SennRoland Sennhttps://gitlab.haskell.org/ghc/ghc/-/issues/18226External TH interpreter crashes with ghc: ghc-iserv terminated (-6)2020-05-24T21:49:00ZisovectorExternal TH interpreter crashes with ghc: ghc-iserv terminated (-6)## Summary
The options to profile Template Haskell seem to crash with `ghc: ghc-iserv terminated (-6)`
## Steps to reproduce
The following program crashes for me:
```haskell
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -pgmi /...## Summary
The options to profile Template Haskell seem to crash with `ghc: ghc-iserv terminated (-6)`
## Steps to reproduce
The following program crashes for me:
```haskell
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -pgmi /home/sandy/.stack/programs/x86_64-linux/ghc-tinfo6-8.8.2/lib/ghc-8.8.2/bin/ghc-iserv-prof -fexternal-interpreter -opti+RTS -opti-p #-}
module ListPresentation where
blah = $([e| undefined |])
```
Note that I'm running this via stack, thus the janky `-pgmi` option. I'm compiling with the following flags: `--enable-library-profiling --enable-profiling --ghc-options -fprof-auto --ghc-options -fprof-cafs`.
Result:
```
ghc-iserv-prof: internal error: PAP object entered!
(GHC version 8.8.2 for x86_64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
/home/sandy/prj/algebra-checkers/src/ListPresentation.hs:8:8: error:
• Exception when trying to run compile-time code:
ghc: ghc-iserv terminated (-6)
Code: [| undefined |]
• In the untyped splice: $([| undefined |])
|
8 | blah = $([e| undefined |])
| ^^^^^^^^^^^^^^^^^^^
```
## Expected behavior
I expect the splice to work properly, and for me to get a profile dump.
## Environment
* GHC version used: 8.8.2, and I'm also seeing it on 8.6.5https://gitlab.haskell.org/ghc/ghc/-/issues/17669-fexternal-interpreter does not load recompiled code with -fobject-code2021-08-04T00:22:59ZRob Rix-fexternal-interpreter does not load recompiled code with -fobject-code## Summary
When running `ghci` with both `-fexternal-interpreter` and `-fobject-code`, changes are recompiled, but the recompiled object files are not loaded.
## Steps to reproduce
1. Make a haskell file, `test.hs`, containing at leas...## Summary
When running `ghci` with both `-fexternal-interpreter` and `-fobject-code`, changes are recompiled, but the recompiled object files are not loaded.
## Steps to reproduce
1. Make a haskell file, `test.hs`, containing at least `main = pure ()`.
2. Run `ghci -fexternal-interpreter -fobject-code test.hs`.
3. In `ghci`, run `:main`. Observe that nothing is output.
4. Edit the file to change main to e.g. `main = putStrLn "hello, world"`.
5. Reload (`:r`). Observe that it recompiles the object file.
6. Run `:main`. Observe that nothing is output.
## Expected behavior
It should have run the new code. This scales up to more complex examples; it is specifically running the previously-compiled code. This can be explored further by switching between `-fobject-code` and `-fbyte-code` in `ghci` on the fly while touching source files; only after touching the module, reloading with `-fbyte-code` to generate bytecode, running, touching the module again, and reloading with `-fobject-code` will it start picking up the changes.
## Environment
* GHC version used: 8.8.1
Optional:
* Operating System: macOS 10.15.2
* System Architecture: x86-64https://gitlab.haskell.org/ghc/ghc/-/issues/16392In ghci, revertCAFs should be executed in the external interpreter when neces...2020-11-22T21:49:46ZTrịnh Tuấn PhươngIn ghci, revertCAFs should be executed in the external interpreter when necessaryI believe this bug was discovered and reported earlier here, https://mail.haskell.org/pipermail/ghc-devs/2018-June/015842.html. I stumbled upon this while tracking down a problem with ghci.
To describe the problem, we call revertCAFs wh...I believe this bug was discovered and reported earlier here, https://mail.haskell.org/pipermail/ghc-devs/2018-June/015842.html. I stumbled upon this while tracking down a problem with ghci.
To describe the problem, we call revertCAFs whenever we load modules in ghci so that they can be re-evaluated. This however, doesn't work as intended when use with `-fexternal-interpreter` because the CAFs of loaded modules actually live in the external interpreter process instead while `revertCAFs` only work for CAFs in the ghci process.
To fix this, we should call revertCAFs in the external interpreter when it's used.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 8.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | afarmer, watashi |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"In ghci, revertCAFs should be executed in the external interpreter when necessary","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["afarmer","watashi"],"type":"Bug","description":"I believe this bug was discovered and reported earlier here, https://mail.haskell.org/pipermail/ghc-devs/2018-June/015842.html. I stumbled upon this while tracking down a problem with ghci.\r\n\r\nTo describe the problem, we call revertCAFs whenever we load modules in ghci so that they can be re-evaluated. This however, doesn't work as intended when use with `-fexternal-interpreter` because the CAFs of loaded modules actually live in the external interpreter process instead while `revertCAFs` only work for CAFs in the ghci process.\r\n\r\nTo fix this, we should call revertCAFs in the external interpreter when it's used.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->Trịnh Tuấn PhươngTrịnh Tuấn Phươnghttps://gitlab.haskell.org/ghc/ghc/-/issues/16256-fexternal-interpreter slow for profiling with template haskell2020-05-12T16:08:54ZGuillaume Bouchard-fexternal-interpreter slow for profiling with template haskellI'm trying to build the following program (in `Foo.hs`) with profiling enabled:
```haskell
{-# LANGUAGE TemplateHaskell #-}
main = print $([| 10 |])
```
With the "alternate object file suffix" method, I have correct build time:
```
$ ...I'm trying to build the following program (in `Foo.hs`) with profiling enabled:
```haskell
{-# LANGUAGE TemplateHaskell #-}
main = print $([| 10 |])
```
With the "alternate object file suffix" method, I have correct build time:
```
$ time ghc -prof -osuf o_p Foo.hs
[1 of 1] Compiling Main ( Foo.hs, Foo.o_p )
Linking Foo ...
real 0m1.698s
user 0m1.518s
sys 0m0.184s
```
However with `-fexternal-interpreter`, times are abysmally slow:
```
$ time ghc -prof -fexternal-interpreter -osuf "p_o" Foo.hs
[1 of 1] Compiling Main ( Foo.hs, Foo.p_o )
Linking Foo ...
real 0m26.077s
user 0m1.531s
sys 0m0.190s
```
I'm using `ghc-8.6.3` on nixos.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.3 |
| 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":"-fexternal-interpreter slow for profiling with template haskell","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I'm trying to build the following program (in `Foo.hs`) with profiling enabled:\r\n\r\n{{{#!haskell\r\n{-# LANGUAGE TemplateHaskell #-}\r\nmain = print $([| 10 |])\r\n}}}\r\n\r\nWith the \"alternate object file suffix\" method, I have correct build time:\r\n\r\n{{{\r\n$ time ghc -prof -osuf o_p Foo.hs\r\n[1 of 1] Compiling Main ( Foo.hs, Foo.o_p )\r\nLinking Foo ...\r\n\r\nreal\t0m1.698s\r\nuser\t0m1.518s\r\nsys\t0m0.184s\r\n}}}\r\n\r\nHowever with `-fexternal-interpreter`, times are abysmally slow:\r\n\r\n{{{\r\n$ time ghc -prof -fexternal-interpreter -osuf \"p_o\" Foo.hs\r\n[1 of 1] Compiling Main ( Foo.hs, Foo.p_o )\r\nLinking Foo ...\r\n\r\nreal\t0m26.077s\r\nuser\t0m1.531s\r\nsys\t0m0.190s\r\n}}}\r\n\r\nI'm using `ghc-8.6.3` on nixos.\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/15644Test Suite Unexpected failure for ghci062(ghci-ext)2021-09-07T15:56:11ZJulian LevistonTest Suite Unexpected failure for ghci062(ghci-ext)Testing on MacOS X 10.13.6 MacBook (Retina, 12-inch, 2017) 1.4GHz i7 1 processor, 2 cores
git sha is d36b1ffac9960db70043aaab43c931ce217912ba
Ran `cd ghc/testsuite/tests/ghci` then `make test THREADS=2`
The erroring output is as follo...Testing on MacOS X 10.13.6 MacBook (Retina, 12-inch, 2017) 1.4GHz i7 1 processor, 2 cores
git sha is d36b1ffac9960db70043aaab43c931ce217912ba
Ran `cd ghc/testsuite/tests/ghci` then `make test THREADS=2`
The erroring output is as follows (snipped):
```shell
=====> ghci063(ghci) 99 of 271 [0, 1, 2]
cd "scripts/ghci063.run" && HC="/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2" HC_OPTS="-dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output " "/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2" --interactive -v0 -ignore-dot-ghci -fno-ghci-history +RTS -I0.1 -RTS -fghci-leak-check -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output < ghci063.script
=====> ghci062(ghci-ext) 99 of 271 [0, 1, 2]
cd "scripts/ghci062.run" && HC="/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2" HC_OPTS="-dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output " "/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2" --interactive -v0 -ignore-dot-ghci -fno-ghci-history -fexternal-interpreter +RTS -I0.1 -RTS -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output < ghci062.script
Actual stderr output differs from expected:
diff -uw "/dev/null" "scripts/ghci063.run/ghci063.run.stderr.normalised"
--- /dev/null 2018-09-12 23:13:35.000000000 +1000
+++ scripts/ghci063.run/ghci063.run.stderr.normalised 2018-09-12 23:13:39.000000000 +1000
@@ -0,0 +1,2 @@
+
+B.hs:1:1: parse error on input ‘***’
*** unexpected failure for ghci063(ghci)
=====> T2452(ghci) 100 of 271 [0, 2, 2]
cd "scripts/T2452.run" && HC="/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2" HC_OPTS="-dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output " "/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2" --interactive -v0 -ignore-dot-ghci -fno-ghci-history +RTS -I0.1 -RTS -fghci-leak-check -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output < T2452.script
Wrong exit code for ghci062(ghci-ext)(expected 0 , actual 1 )
Stderr ( ghci062 ):
ghc-iserv.bin:
lookupSymbol failed in relocateSection (RELOC_GOT)
/Users/julianleviston/code/haskell/ghc/libraries/integer-gmp/dist-install/build/HSinteger-gmp-1.0.2.0.o: unknown symbol `___gmp_rands'
ghc-stage2: unable to load package `integer-gmp-1.0.2.0'
*** unexpected failure for ghci062(ghci-ext)
```
Note, two errors occurred but I've created an error report for ghci063 in another ticket (#15643)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | |
| 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":"Test Suite Unexpected failure for ghci062(ghci-ext)","status":"New","operating_system":"","component":"Test Suite","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Testing on MacOS X 10.13.6 MacBook (Retina, 12-inch, 2017) 1.4GHz i7 1 processor, 2 cores\r\n\r\ngit sha is d36b1ffac9960db70043aaab43c931ce217912ba\r\n\r\nRan `cd ghc/testsuite/tests/ghci` then `make test THREADS=2`\r\n\r\nThe erroring output is as follows (snipped):\r\n\r\n{{{#!shell\r\n=====> ghci063(ghci) 99 of 271 [0, 1, 2]\r\ncd \"scripts/ghci063.run\" && HC=\"/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2\" HC_OPTS=\"-dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output \" \"/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2\" --interactive -v0 -ignore-dot-ghci -fno-ghci-history +RTS -I0.1 -RTS -fghci-leak-check -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output < ghci063.script\r\n=====> ghci062(ghci-ext) 99 of 271 [0, 1, 2]\r\ncd \"scripts/ghci062.run\" && HC=\"/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2\" HC_OPTS=\"-dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output \" \"/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2\" --interactive -v0 -ignore-dot-ghci -fno-ghci-history -fexternal-interpreter +RTS -I0.1 -RTS -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output < ghci062.script\r\nActual stderr output differs from expected:\r\ndiff -uw \"/dev/null\" \"scripts/ghci063.run/ghci063.run.stderr.normalised\"\r\n--- /dev/null\t2018-09-12 23:13:35.000000000 +1000\r\n+++ scripts/ghci063.run/ghci063.run.stderr.normalised\t2018-09-12 23:13:39.000000000 +1000\r\n@@ -0,0 +1,2 @@\r\n+\r\n+B.hs:1:1: parse error on input ‘***’\r\n*** unexpected failure for ghci063(ghci)\r\n=====> T2452(ghci) 100 of 271 [0, 2, 2]\r\ncd \"scripts/T2452.run\" && HC=\"/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2\" HC_OPTS=\"-dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output \" \"/Users/julianleviston/code/haskell/ghc/inplace/test spaces/ghc-stage2\" --interactive -v0 -ignore-dot-ghci -fno-ghci-history +RTS -I0.1 -RTS -fghci-leak-check -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output < T2452.script\r\nWrong exit code for ghci062(ghci-ext)(expected 0 , actual 1 )\r\nStderr ( ghci062 ):\r\nghc-iserv.bin: \r\nlookupSymbol failed in relocateSection (RELOC_GOT)\r\n/Users/julianleviston/code/haskell/ghc/libraries/integer-gmp/dist-install/build/HSinteger-gmp-1.0.2.0.o: unknown symbol `___gmp_rands'\r\nghc-stage2: unable to load package `integer-gmp-1.0.2.0'\r\n*** unexpected failure for ghci062(ghci-ext)\r\n}}}\r\n\r\nNote, two errors occurred but I've created an error report for ghci063 in another ticket (#15643)","type_of_failure":"OtherFailure","blocking":[]} -->9.2.1https://gitlab.haskell.org/ghc/ghc/-/issues/15481TH fails to recover from reifyFixity with -fexternal-interpreter2019-07-07T18:04:32ZRyan ScottTH fails to recover from reifyFixity with -fexternal-interpreter(Originally reported at https://github.com/glguy/th-abstraction/issues/53.)
If you compile the following program:
```hs
{-# LANGUAGE TemplateHaskell #-}
module Bug where
import Language.Haskell.TH
main :: IO ()
main = putStrLn $(reco...(Originally reported at https://github.com/glguy/th-abstraction/issues/53.)
If you compile the following program:
```hs
{-# LANGUAGE TemplateHaskell #-}
module Bug where
import Language.Haskell.TH
main :: IO ()
main = putStrLn $(recover (stringE "reifyFixity failed")
(do foo <- newName "foo"
_ <- reifyFixity foo
stringE "reifyFixity successful"))
```
It will work fine without the use of `-fexternal-interpreter`. However, using `-fexternal-interpreter` will result in an error:
```
$ /opt/ghc/8.4.3/bin/ghc Bug.hs -fforce-recomp
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
$ /opt/ghc/8.4.3/bin/ghc Bug.hs -fforce-recomp -fexternal-interpreter
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:7:19: error:
• The exact Name ‘foo_a3MT’ is not in scope
Probable cause: you used a unique Template Haskell name (NameU),
perhaps via newName, but did not bind it
If that's it, then -ddump-splices might be useful
• In the untyped splice:
$(recover
(stringE "reifyFixity failed")
(do foo <- newName "foo"
_ <- reifyFixity foo
stringE "reifyFixity successful"))
|
7 | main = putStrLn $(recover (stringE "reifyFixity failed")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
Bug.hs:7:19: error:
• The exact Name ‘foo_a3MT’ is not in scope
Probable cause: you used a unique Template Haskell name (NameU),
perhaps via newName, but did not bind it
If that's it, then -ddump-splices might be useful
• In the untyped splice:
$(recover
(stringE "reifyFixity failed")
(do foo <- newName "foo"
_ <- reifyFixity foo
stringE "reifyFixity successful"))
|
7 | main = putStrLn $(recover (stringE "reifyFixity failed")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Template Haskell |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"TH fails to recover from reifyFixity with -fexternal-interpreter","status":"New","operating_system":"","component":"Template Haskell","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":["RemoteGHCi"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"(Originally reported at https://github.com/glguy/th-abstraction/issues/53.)\r\n\r\nIf you compile the following program:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE TemplateHaskell #-}\r\nmodule Bug where\r\n\r\nimport Language.Haskell.TH\r\n\r\nmain :: IO ()\r\nmain = putStrLn $(recover (stringE \"reifyFixity failed\")\r\n (do foo <- newName \"foo\"\r\n _ <- reifyFixity foo\r\n stringE \"reifyFixity successful\"))\r\n}}}\r\n\r\nIt will work fine without the use of `-fexternal-interpreter`. However, using `-fexternal-interpreter` will result in an error:\r\n\r\n{{{\r\n$ /opt/ghc/8.4.3/bin/ghc Bug.hs -fforce-recomp\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n$ /opt/ghc/8.4.3/bin/ghc Bug.hs -fforce-recomp -fexternal-interpreter\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\n\r\nBug.hs:7:19: error:\r\n • The exact Name ‘foo_a3MT’ is not in scope\r\n Probable cause: you used a unique Template Haskell name (NameU), \r\n perhaps via newName, but did not bind it\r\n If that's it, then -ddump-splices might be useful\r\n • In the untyped splice:\r\n $(recover\r\n (stringE \"reifyFixity failed\")\r\n (do foo <- newName \"foo\"\r\n _ <- reifyFixity foo\r\n stringE \"reifyFixity successful\"))\r\n |\r\n7 | main = putStrLn $(recover (stringE \"reifyFixity failed\")\r\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...\r\n\r\nBug.hs:7:19: error:\r\n • The exact Name ‘foo_a3MT’ is not in scope\r\n Probable cause: you used a unique Template Haskell name (NameU), \r\n perhaps via newName, but did not bind it\r\n If that's it, then -ddump-splices might be useful\r\n • In the untyped splice:\r\n $(recover\r\n (stringE \"reifyFixity failed\")\r\n (do foo <- newName \"foo\"\r\n _ <- reifyFixity foo\r\n stringE \"reifyFixity successful\"))\r\n |\r\n7 | main = putStrLn $(recover (stringE \"reifyFixity failed\")\r\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.2Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/15262GHC and iserv cannot agree on what an Integer is; insanity ensues2020-06-19T14:35:19ZhowtonotwinGHC and iserv cannot agree on what an Integer is; insanity ensuesTested off `ghc-8.6.1-alpha1`, running on macOS 10.13.5.
1. Compile a GHC that uses `integer-gmp`.
2. Compile a GHC that uses `integer-simple`.
3. Make `Main.hs`:
> ```haskell
> {-# LANGUAGE TemplateHaskell #-}
...Tested off `ghc-8.6.1-alpha1`, running on macOS 10.13.5.
1. Compile a GHC that uses `integer-gmp`.
2. Compile a GHC that uses `integer-simple`.
3. Make `Main.hs`:
> ```haskell
> {-# LANGUAGE TemplateHaskell #-}
> main = print $([e| 0 |])
> ```
4. Try to compile the file with `integer-gmp` `ghc` and `integer-simple` `ghc-iserv`.
* Expected behavior: (compiles fine and executable prints `0`) or (outputs to-the-point error message)
* Actual:
```none
[1 of 1] Compiling Main ( Main.hs, Main.o )
Main.hs:2:14: error:
• Exception when trying to run compile-time code:
ghc: ghc-iserv terminated (-11)
Code: [| 0 |]
• In the untyped splice: $([| 0 |])
|
2 | main = print $([e| 0 |])
| ^^^^^^^^^^^
```
4. Try to compile the file with `integer-simple` `ghc` and `integer-gmp` `ghc-iserv`.
* Expected behavior: (compiles fine and executable prints `0`) or (outputs to-the-point error message)
* Actual:
```none
[1 of 1] Compiling Main ( Main.hs, Main.o )
Main.hs:2:14: error:
• Exception when trying to run compile-time code:
heap overflow
Code: [| 0 |]
• In the untyped splice: $([| 0 |])
|
2 | main = print $([e| 0 |])
| ^^^^^^^^^^^
```
For more fun, replace the `0` with a `1`. `gmp` `ghc` + `simple` `iserv` continues to explode. This is better than `simple` `ghc` + `gmp` `iserv`:
```bash
$ ./Main
283468057265
$ ./Main
283468057265
$ $simple_ghc -fexternal-interpreter -pgmi=$gmp_iserv Main.hs # again
# ...
$ ./Main
283468057105
```
Absolutely delicious. There is a similar situation for fractional literals.
It would be nice if there were at least a warning for situations like this.9.0.1John EricsonJohn Ericsonhttps://gitlab.haskell.org/ghc/ghc/-/issues/14574Template Haskell Uniq ~ Int leads to external interpreter cross compilation t...2019-07-07T18:16:27ZLuite StegemanTemplate Haskell Uniq ~ Int leads to external interpreter cross compilation trouble64 bit GHC has 64 bit Unique values, but they don't fit in a `template-haskell` `NameU` when cross-compiling to a 32 bit target.
In theory we can support Template Haskell in this situation with `-fexternal-interpreter` (and the earlier ...64 bit GHC has 64 bit Unique values, but they don't fit in a `template-haskell` `NameU` when cross-compiling to a 32 bit target.
In theory we can support Template Haskell in this situation with `-fexternal-interpreter` (and the earlier GHCJS implementation), but when the target cannot represent GHC's uniques in an `Int`, things go wrong:
from `Language.Haskell.TH.Syntax`:
```hs
type Uniq = Int
```
I think we can fix this for now by changing the synonym to `type Uniq = Int64` (or even `type Uniq = Integer`), making the `template-haskell` `Uniq` at least as big as the GHC `Unique` in practice. This requires a change in `DsMeta`.
the uses of `Int` below should really be changed to `Uniq`
```hs
data NameFlavour
= NameS -- ^ An unqualified name; dynamically bound
| NameQ ModName -- ^ A qualified name; dynamically bound
| NameU !Int -- ^ A unique local name
| NameL !Int -- ^ Local name bound outside of the TH AST
| NameG NameSpace PkgName ModName -- ^ Global name bound outside of the TH AST:
-- An original name (occurrences only, not binders)
-- Need the namespace too to be sure which
-- thing we are naming
deriving ( Data, Eq, Ord, Show, Generic )
```
```hs
-- Global variable to generate unique symbols
counter :: IORef Int
{-# NOINLINE counter #-}
counter = unsafePerformIO (newIORef 0)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.3 |
| 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":"Template Haskell Uniq ~ Int leads to external interpreter cross compilation trouble","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"64 bit GHC has 64 bit Unique values, but they don't fit in a `template-haskell` `NameU` when cross-compiling to a 32 bit target.\r\n\r\nIn theory we can support Template Haskell in this situation with `-fexternal-interpreter` (and the earlier GHCJS implementation), but when the target cannot represent GHC's uniques in an `Int`, things go wrong:\r\n\r\nfrom `Language.Haskell.TH.Syntax`:\r\n{{{#!hs\r\ntype Uniq = Int\r\n}}}\r\n\r\nI think we can fix this for now by changing the synonym to `type Uniq = Int64` (or even `type Uniq = Integer`), making the `template-haskell` `Uniq` at least as big as the GHC `Unique` in practice. This requires a change in `DsMeta`.\r\n\r\nthe uses of `Int` below should really be changed to `Uniq`\r\n\r\n{{{#!hs\r\ndata NameFlavour\r\n = NameS -- ^ An unqualified name; dynamically bound\r\n | NameQ ModName -- ^ A qualified name; dynamically bound\r\n | NameU !Int -- ^ A unique local name\r\n | NameL !Int -- ^ Local name bound outside of the TH AST\r\n | NameG NameSpace PkgName ModName -- ^ Global name bound outside of the TH AST:\r\n -- An original name (occurrences only, not binders)\r\n -- Need the namespace too to be sure which\r\n -- thing we are naming\r\n deriving ( Data, Eq, Ord, Show, Generic )\r\n}}}\r\n\r\n{{{#!hs\r\n-- Global variable to generate unique symbols\r\ncounter :: IORef Int\r\n{-# NOINLINE counter #-}\r\ncounter = unsafePerformIO (newIORef 0)\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/14291Tests tend to fail in the ext-interp way when split sections is enabled2023-11-21T16:09:39ZBen GamariTests tend to fail in the ext-interp way when split sections is enabledOne issue I've noticed while working on #13716 is that most (if not all) of the tests runs in the `ext-interp` way fail when run with a compiler built with `SplitSections=YES`.
```
$ git clone git://git.haskell.org/ghc
$ cd ghc
$ git su...One issue I've noticed while working on #13716 is that most (if not all) of the tests runs in the `ext-interp` way fail when run with a compiler built with `SplitSections=YES`.
```
$ git clone git://git.haskell.org/ghc
$ cd ghc
$ git submodule update --init
$ mk/get-win32-tarballs.sh download all
$ ./boot
$ ./configure
$ make sdist
$ mkdir tmp; cd tmp
$ ls ../sdistprep/ghc-*-src.tar.xz | xargs -n1 tar -xf
$ cd ghc-*
$ ./boot
$ ./configure
$ make -j9
$ make test TEST=T10638
...
=====> T10638(normal) 1 of 1 [0, 0, 0]
cd "./th/T10638.run" && "/mnt/work/ghc/ghc-testing/temp/ghc-8.3.20170927/inplace/bin/ghc-stage2" -c T10638.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output -XTemplateHaskell -package template-haskell -v0
=====> T10638(ext-interp) 1 of 1 [0, 0, 0]
cd "./th/T10638.run" && "/mnt/work/ghc/ghc-testing/temp/ghc-8.3.20170927/inplace/bin/ghc-stage2" -c T10638.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output -XTemplateHaskell -package template-haskell -fexternal-interpreter -v0
Actual stderr output differs from expected:
diff -uw "./th/T10638.run/T10638.stderr.normalised" "./th/T10638.run/T10638.comp.stderr.normalised"
--- ./th/T10638.run/T10638.stderr.normalised 2017-09-27 12:18:45.737974039 -0400
+++ ./th/T10638.run/T10638.comp.stderr.normalised 2017-09-27 12:18:45.737974039 -0400
@@ -1,5 +1,18 @@
+ghc-iserv.bin: internal evacuate(static): strange closure type 16476
+ (GHC version 8.3.20170927 for x86_64_unknown_linux)
+ Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
-T10638.hs:26:11:
- ‘static test2’ is not a valid C identifier
- When checking declaration:
- foreign import prim safe "static test2" cmm_test2 :: Int# -> Int#
+T10638.hs:26:9:
+ Exception when trying to run compile-time code:
+ {handle: <file descriptor: 11>}: GHCi.Message.remoteCall: end of file
+ Code: do t <- [t| Int# -> Int# |]
+ cmm_test2 <- newName "cmm_test2"
+ addTopDecls
+ [ForeignD (ImportF Prim Safe "static test2" cmm_test2 t)]
+ ....
+ In the untyped splice:
+ $(do t <- [t| Int# -> Int# |]
+ cmm_test2 <- newName "cmm_test2"
+ addTopDecls
+ [ForeignD (ImportF Prim Safe "static test2" cmm_test2 t)]
+ [| test1 |])
*** unexpected failure for T10638(ext-interp)
Unexpected results from:
TEST="T10638"
...
```
The crashes are generally RTS panics or segmentation faults.8.4.1https://gitlab.haskell.org/ghc/ghc/-/issues/14271ghci hangs with -fexternal-interpreter -prof2019-07-07T18:17:41ZAndreas Klebingerghci hangs with -fexternal-interpreter -prof```
ghci -fexternal-interpreter -prof
GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help
Access violation in generated code when reading 00000001001e0418
```
- The address remains the same between reruns (and reinstalls) of g...```
ghci -fexternal-interpreter -prof
GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help
Access violation in generated code when reading 00000001001e0418
```
- The address remains the same between reruns (and reinstalls) of ghc.
- Closing the hanging process leaves the launched ghc active in the background.
- The directory I launch ghci from doesn't seem to matter.
- I have only tried it on my desktop so far (Win10/Skylake)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghci hangs with -fexternal-interpreter -prof","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\nghci -fexternal-interpreter -prof\r\nGHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help\r\nAccess violation in generated code when reading 00000001001e0418\r\n}}}\r\n\r\n* The address remains the same between reruns (and reinstalls) of ghc.\r\n* Closing the hanging process leaves the launched ghc active in the background.\r\n* The directory I launch ghci from doesn't seem to matter.\r\n* I have only tried it on my desktop so far (Win10/Skylake)","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/14028ghc panic: -fexternal-interpreter + .o + QuasiQuotes?2021-04-21T06:45:52Zblynnghc panic: -fexternal-interpreter + .o + QuasiQuotes?1. Compile an object file with -fPIC, e.g:
```
cat > hello.c << EOF
#include <stdio.h>
void hi(){puts("Hello, World!");}
EOF
gcc -c -fPIC hello.c
```
1. Write Haskell that uses QuasiQuotes, e.g:
```
cat > h.hs << EOF
{-# LANGUAGE Quas...1. Compile an object file with -fPIC, e.g:
```
cat > hello.c << EOF
#include <stdio.h>
void hi(){puts("Hello, World!");}
EOF
gcc -c -fPIC hello.c
```
1. Write Haskell that uses QuasiQuotes, e.g:
```
cat > h.hs << EOF
{-# LANGUAGE QuasiQuotes #-}
import Text.Heredoc (here)
s :: String
s = [here|goes nothing|]
EOF
```
1. Compile with -fexternal-interpreter:
```
cabal install heredoc
ghc -fexternal-interpreter h.hs hello.o
```
I saw:
\[1 of 1\] Compiling Main ( h.hs, h.o )
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-unknown-linux):
> Loading temp shared object failed: /home/blynn/.local/lib/ghc-8.0.2/ghc-prim-0.5.0.0/libHSghc-prim-0.5.0.0-ghc8.0.2.so: undefined symbol: stg_thawArrayzh
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.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 panic: -fexternal-interpreter + .o + QuasiQuotes?","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.2","keywords":["ghc","impossible","panic"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"1. Compile an object file with -fPIC, e.g:\r\n\r\n{{{\r\ncat > hello.c << EOF\r\n#include <stdio.h>\r\nvoid hi(){puts(\"Hello, World!\");}\r\nEOF\r\ngcc -c -fPIC hello.c\r\n}}}\r\n\r\n2. Write Haskell that uses QuasiQuotes, e.g:\r\n\r\n{{{\r\ncat > h.hs << EOF\r\n{-# LANGUAGE QuasiQuotes #-}\r\nimport Text.Heredoc (here)\r\ns :: String\r\ns = [here|goes nothing|]\r\nEOF\r\n}}}\r\n\r\n3. Compile with -fexternal-interpreter:\r\n\r\n{{{\r\ncabal install heredoc\r\nghc -fexternal-interpreter h.hs hello.o\r\n}}}\r\n\r\nI saw:\r\n\r\n[1 of 1] Compiling Main ( h.hs, h.o )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.0.2 for x86_64-unknown-linux):\r\n Loading temp shared object failed: /home/blynn/.local/lib/ghc-8.0.2/ghc-prim-0.5.0.0/libHSghc-prim-0.5.0.0-ghc8.0.2.so: undefined symbol: stg_thawArrayzh\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.2.1https://gitlab.haskell.org/ghc/ghc/-/issues/13184:show bindings broken under -fexternal-interpreter2019-07-07T18:23:17Zniteria:show bindings broken under -fexternal-interpreterThis is straight from GHC HEAD:
```
$ ./inplace/bin/ghc-stage2 --interactive -fexternal-interpreter
GHCi, version 8.1.20170123: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/bnitka/.ghc/ghci.conf
package ...This is straight from GHC HEAD:
```
$ ./inplace/bin/ghc-stage2 --interactive -fexternal-interpreter
GHCi, version 8.1.20170123: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/bnitka/.ghc/ghci.conf
package flags have changed, resetting and loading new packages...
Loaded GHCi configuration from /home/bnitka/.ghci
Prelude> let a = 1
Prelude> :show bindings
a ::
Num p =>
p = *** Exception: ghc-stage2: this operation requires -fno-external-interpreter
Prelude>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------- |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | low |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | niteria, simonmar |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":":show bindings broken under -fexternal-interpreter","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["niteria","simonmar"],"type":"Bug","description":"This is straight from GHC HEAD:\r\n\r\n{{{\r\n$ ./inplace/bin/ghc-stage2 --interactive -fexternal-interpreter\r\nGHCi, version 8.1.20170123: http://www.haskell.org/ghc/ :? for help\r\nLoaded GHCi configuration from /home/bnitka/.ghc/ghci.conf\r\npackage flags have changed, resetting and loading new packages...\r\nLoaded GHCi configuration from /home/bnitka/.ghci\r\nPrelude> let a = 1\r\nPrelude> :show bindings\r\na ::\r\n Num p =>\r\n p = *** Exception: ghc-stage2: this operation requires -fno-external-interpreter\r\nPrelude>\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/12946Cannot load hmatrix with ghci -fexternal-interpreter: missing symbol ___ieee_...2019-07-07T18:24:30ZSimon MarlowCannot load hmatrix with ghci -fexternal-interpreter: missing symbol ___ieee_divdc3See https://mail.haskell.org/pipermail/glasgow-haskell-users/2016-December/026419.html
I tested this on Linux and it seems to work, so I suspect it is an OS X issue. There's an old but related bug on the hmatrix bug tracker: https://git...See https://mail.haskell.org/pipermail/glasgow-haskell-users/2016-December/026419.html
I tested this on Linux and it seems to work, so I suspect it is an OS X issue. There's an old but related bug on the hmatrix bug tracker: https://github.com/albertoruiz/hmatrix/issues/81
Can someone with OS X look into this please?
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Runtime System (Linker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Cannot load hmatrix with ghci -fexternal-interpreter: missing symbol ___ieee_divdc3","status":"New","operating_system":"","component":"Runtime System (Linker)","related":[],"milestone":"8.2.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"bgamari"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"See https://mail.haskell.org/pipermail/glasgow-haskell-users/2016-December/026419.html\r\n\r\nI tested this on Linux and it seems to work, so I suspect it is an OS X issue. There's an old but related bug on the hmatrix bug tracker: https://github.com/albertoruiz/hmatrix/issues/81\r\n\r\nCan someone with OS X look into this please?","type_of_failure":"OtherFailure","blocking":[]} -->8.2.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/12230Non-deterministic ghc-iserv terminated error2019-07-07T18:27:04ZEdward Z. YangNon-deterministic ghc-iserv terminated errorI noticed on a recent validate that I have been getting non-deterministic test failures due to external interpreter:
```
=====> T10891(ext-interp) 12 of 15 [0, 1, 0] [77/9256]
cd "./th/T10...I noticed on a recent validate that I have been getting non-deterministic test failures due to external interpreter:
```
=====> T10891(ext-interp) 12 of 15 [0, 1, 0] [77/9256]
cd "./th/T10891.run" && "/home/hs01/ezyang/ghc-validate/inplace/test spaces/ghc-stage2" -c T10891.h
s -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-warn-missed-specialisatio
ns -fshow-warning-groups -XTemplateHaskell -package template-haskell -fexternal-interpreter -v0 > T108
91.comp.stderr 2>&1
Compile failed (exit code 1) errors were:
T10891.hs:30:3: error:
• Exception when trying to run compile-time code:
ghc-stage2: ghc-iserv terminated (-11)
Code: let
display :: Name -> Q ()
display q = ...
in
do { display ''C;
display ''C';
.... }
• In the untyped splice:
$(let
display :: Name -> Q ()
display q = do { ... }
in
do { display ''C;
display ''C';
display ''C'';
.... })
```
More tests error the higher I crank up parallelism; on a recent full test run I got something like twenty failures of this kind when I have twelve threads.
There are at least two problems here. The first is the actual failure, but the second is that there isn't enough diagnostic information here to tell what the actual problem is. Combined with the nondeterministic nature of this bug I'm not sure how to debug it.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Non-deterministic ghc-iserv terminated error","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"8.2.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"simonmar"},"version":"8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I noticed on a recent validate that I have been getting non-deterministic test failures due to external interpreter:\r\n\r\n{{{\r\n=====> T10891(ext-interp) 12 of 15 [0, 1, 0] [77/9256]\r\ncd \"./th/T10891.run\" && \"/home/hs01/ezyang/ghc-validate/inplace/test spaces/ghc-stage2\" -c T10891.h\r\ns -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-warn-missed-specialisatio\r\nns -fshow-warning-groups -XTemplateHaskell -package template-haskell -fexternal-interpreter -v0 > T108\r\n91.comp.stderr 2>&1\r\nCompile failed (exit code 1) errors were:\r\n\r\nT10891.hs:30:3: error:\r\n • Exception when trying to run compile-time code:\r\n ghc-stage2: ghc-iserv terminated (-11)\r\n Code: let\r\n display :: Name -> Q ()\r\n display q = ...\r\n in\r\n do { display ''C;\r\n display ''C';\r\n .... }\r\n • In the untyped splice:\r\n $(let\r\n display :: Name -> Q ()\r\n display q = do { ... }\r\n in\r\n do { display ''C;\r\n display ''C';\r\n display ''C'';\r\n .... })\r\n}}}\r\n\r\nMore tests error the higher I crank up parallelism; on a recent full test run I got something like twenty failures of this kind when I have twelve threads.\r\n\r\nThere are at least two problems here. The first is the actual failure, but the second is that there isn't enough diagnostic information here to tell what the actual problem is. Combined with the nondeterministic nature of this bug I'm not sure how to debug it.","type_of_failure":"OtherFailure","blocking":[]} -->8.2.1Simon MarlowSimon Marlowhttps://gitlab.haskell.org/ghc/ghc/-/issues/12219TH test failures with -fexternal-interpreter2019-07-07T18:27:07ZSimon MarlowTH test failures with -fexternal-interpreterThese TH tests are currently failing with -fexternal-interpreter. I need to fix these before I can enable testing of all TH tests with -fexternal-interpreter.
```
Unexpected failures:
T10697_decided_1.run T10697_decided_1 [exit code...These TH tests are currently failing with -fexternal-interpreter. I need to fix these before I can enable testing of all TH tests with -fexternal-interpreter.
```
Unexpected failures:
T10697_decided_1.run T10697_decided_1 [exit code non-0] (ext-interp)
T10697_decided_2.run T10697_decided_2 [exit code non-0] (ext-interp)
T10697_decided_3.run T10697_decided_3 [exit code non-0] (ext-interp)
T8761.run T8761 [stderr mismatch] (ext-interp)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"TH test failures with -fexternal-interpreter","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.0.2","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"simonmar"},"version":"8.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"These TH tests are currently failing with -fexternal-interpreter. I need to fix these before I can enable testing of all TH tests with -fexternal-interpreter.\r\n\r\n{{{\r\nUnexpected failures:\r\n T10697_decided_1.run T10697_decided_1 [exit code non-0] (ext-interp)\r\n T10697_decided_2.run T10697_decided_2 [exit code non-0] (ext-interp)\r\n T10697_decided_3.run T10697_decided_3 [exit code non-0] (ext-interp)\r\n T8761.run T8761 [stderr mismatch] (ext-interp)\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.0.2Simon MarlowSimon Marlow