Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GHC Panic: Loading temp shared object failed

Tags:

haskell

ghc

cabal

We're working on a fork of Parsec (with complete QuickCheck test-suite, better error messages and other improvements) and some progress has been done. Most of the time I worked with REPL from Emacs, specifying build target tests (that is, obviously name of the test suite). This has been working fine.

Now our thing passes the tests, everything seems to be OK, but if I start REPL with library target (or omitting it, i.e. cabal repl or cabal repl lib:megaparsec) and do something, I get GHC panic:

λ> parseTest (string "rere" <* eof) "reri"
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.1 for x86_64-unknown-linux):
    Loading temp shared object failed: /tmp/ghc9380_0/libghc9380_93.so: undefined symbol: _hpc_tickboxes_megapzuEw3SHAmfXgNLpm5a31oXO6_TextziMegaparsecziError_hpc

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Since the code compiles and works fine via cabal repl tests, I conclude this is not my programming fault at any rate, but may be it is a bug.

I've found this ticket: https://ghc.haskell.org/trac/ghc/ticket/10761, but our library doesn't use Template Haskell.

Actual question is: what should I do and how can this be fixed? I cannot even tell if it's Cabal or GHC, I have no idea how to build minimal example that could reproduce the problem.


I've reported it:

https://ghc.haskell.org/trac/ghc/ticket/10765#ticket

like image 575
Mark Karpov Avatar asked Aug 11 '15 08:08

Mark Karpov


1 Answers

If you read the error carefully, you'll notice that the function that is missing is related to hpc:

undefined symbol: _hpc_tickboxes_megapzuEw3SHAmfXgNLpm5a31oXO6_TextziMegaparsecziError_hpc

My guess is that the instrumentation that HPC (haskell program coverage) does is not compatible with the interactive loading of haskell code that GHCi does. Disabling HPC (cabal clean followed by cabal configure, making sure coverage is disabled when configuring) should fix the issue.

I suggest reporting a bug on the GHC bug tracker (although this could also be a cabal bug, not sure who is at fault here).

like image 70
bennofs Avatar answered Nov 12 '22 16:11

bennofs