Segfault in GHC API code using Shelly
A segfault occurs when using the GHC API with Shelly. I do not know why.
Here is a code snippet that triggers it:
import GHC
import GHC.Paths ( libdir )
import DynFlags
main = runGhc (Just libdir) $ do
dflags <- getSessionDynFlags
setSessionDynFlags $ dflags { hscTarget = HscInterpreted,
ghcLink = LinkInMemory }
imports <- mapM parseImportDecl ["import Shelly", "import Prelude"]
setContext $ map IIDecl imports
runStmt "shelly undefined" RunToCompletion
Note that on Mac OS X, this has no output whatsoever. The segfault occurs on Ubuntu 14.04, with uname -a outputting the following:
Linux yed 3.13.0-34-generic #60-Ubuntu SMP Wed Aug 13 15:45:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I cannot find any way to get this to work and have no idea what's up with this or why shelly triggers it.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.8.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHC API |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |