Opened 4 years ago

Closed 4 years ago

#10765 closed bug (duplicate)

GHC panic: Loading temp shared object failed with `--enable-coverage` option

Reported by: mrkkrp Owned by:
Priority: normal Milestone:
Component: Code Coverage Version: 7.10.1
Keywords: hpc Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: #9903 Differential Rev(s):
Wiki Page:

Description

Please see this StackOverflow question and answer for comprehensive description.

http://stackoverflow.com/questions/31937302/ghc-panic-loading-temp-shared-object-failed

In short, when test coverage (via HPC) is enabled (via cabal configure --enable-coverage) and cabal repl is started for non-test build target you get a GHC panic when you try to interact with your functions via REPL.

Change History (4)

comment:1 Changed 4 years ago by bgamari

To quote the ticket,

λ> 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

comment:2 Changed 4 years ago by Yuras

I saw the same issue too, but it is cabal fault because it passes -fhpc to ghci. Note: cabal exec ghci works, but cabal exec ghci -- -fhpc fails.

Lack of HPC support in interpreter is documented. The relevant issue about bad error message from ghc is #9903.

I propose to open an issue on cabals tracker and close this one as a duplicate of #9903.

comment:3 in reply to:  2 ; Changed 4 years ago by mrkkrp

Replying to Yuras:

I saw the same issue too, but it is cabal fault because it passes -fhpc to ghci. Note: cabal exec ghci works, but cabal exec ghci -- -fhpc fails.

Lack of HPC support in interpreter is documented. The relevant issue about bad error message from ghc is #9903.

I propose to open an issue on cabals tracker and close this one as a duplicate of #9903.

I opened an issue on Cabal's GitHub page before reporting it here:

https://github.com/haskell/cabal/issues/2757

where I was told that "GHC Panic" is usually signifies a GHC bug.

comment:4 in reply to:  3 Changed 4 years ago by Yuras

Architecture: x86_64 (amd64)Unknown/Multiple
Operating System: LinuxUnknown/Multiple
Resolution: duplicate
Status: newclosed

Replying to mrkkrp:

I opened an issue on Cabal's GitHub page before reporting it here:

https://github.com/haskell/cabal/issues/2757

where I was told that "GHC Panic" is usually signifies a GHC bug.

They are right, ghc should fail with polite error message instead of a panic, but that is exactly why #9903 exists. Cabal's fault is to pass -fhpc to ghci.

I sent a fix to Cabal, so closing. Thank you for reporting the issue.

Note: See TracTickets for help on using tickets.