ghc-vis
ghc-vis copied to clipboard
segmentation fault
GHC 7.8.3 32bit, Windows
Consider the following example:
data Pair2 = Pair2 !Int !Int
let p2 = Pair2 (1+2) (3+4)
:vis
:view p2
the window is empty and nothing works. When I close the window and do
:vis
:view p2
I get
Prelude> Segmentation fault
. That's a minimal example I constructed; however, this exact same bug happened to me many times when trying to work with ghc-vis
on a small program.
Looks like this issue in ghc-heap-view: https://github.com/nomeata/ghc-heap-view/issues/3
To quote from the ghc-heap-view issue:
PR 23 deleted the code of ghc-heap-view to read the heap. instead ghc-heap-view now uses the standard GHC library GHC.Exts.Heap. Since this change, I could NOT reproduce any of the Unknown opcode 0exceptions. So I think, PR 23 also fixed this issue.
However, the issue is only fixed in GHC with version >= 8.6. Nothing was done for older versions.
stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.8.1
$ stack repl
λ> :script ghci
λ> :vis
λ> let g = [1..]
λ> :view g
This also leads to a segfault on my Linux machine.
I'll look a bit into this and see if there are more details which could be useful, but it seems the ghc version isn't the problem