Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#9903 closed bug (invalid)

GHCi produces a cryptic message when using HPC

Reported by: facundo.dominguez Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.9
Keywords: hpc Cc: m@…, alexander.vershilov@…, hvr
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHCi crash Test Case:
Blocked By: Blocking:
Related Tickets: #9878, #9762 ? Differential Rev(s):
Wiki Page:

Description (last modified by facundo.dominguez)

The following test produces an impolite response from GHCi

$ cat t.hs
g :: Int
g = 1 + 1
$ ghc-stage2 --interactive t.hs -fhpc
GHCi, version 7.9.20141217:  :? for help
[1 of 1] Compiling Main             ( t.hs, interpreted )
Ok, modules loaded: Main.
*Main> g
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.9.20141217 for x86_64-unknown-linux):
	Loading temp shared object failed: /tmp/ghc25774_0/ undefined symbol: _hpc_tickboxes_Main_hpc

Please report this as a GHC bug:

Discovered while investigating #9878.

Change History (5)

comment:1 Changed 4 years ago by facundo.dominguez

Description: modified (diff)

comment:2 Changed 4 years ago by rwbarton

This is likely the same issue as #9762, yes.

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

Replying to rwbarton:

This is likely the same issue as #9762, yes.

After some investigation I no longer think it's the same issue. This one is really about supporting HPC in bytecode objects. In the short term we may just want to bail out of the bytecode compiler if HPC is turned on (with a friendlier message) and suggest that the user use -fobject-code.

comment:4 Changed 4 years ago by bgamari

Resolution: invalid
Status: newclosed

It appears that the issue here is really the poor error message. As noted in the User's Guide, hpc and GHCi aren't compatible (as the code generator is expected to produce some symbols which the interpreter does not produce, hence the error message here).

I'll push a fix for the error message shortly.

comment:5 Changed 4 years ago by Ben Gamari <ben@…>

In d2dd5af/ghc:

DynFlags: Prohibit hpc and byte-code interpreter

The user's guide says hpc is incompatible with GHCi and #9903 would
agree. Fixes #9903.
Note: See TracTickets for help on using tickets.