Ticket #4532 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Profiling crashes with GHC API

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Profiling Version: 6.12.3
Keywords: GHC,Profiling,GHC API,Crash Cc:
Operating System: MacOS X Architecture: x86
Type of failure: Runtime crash Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Profiling program using ghc api crashes.

For example:

ghc-api.hs

import GHC
import GHC.Paths

main = do
  runGhc (Just libdir) $ do
    getSessionDynFlags >>= setSessionDynFlags
    dynCompileExpr "()"

Compile ghc-api.hs with following options:

$ ghc --make -prof ghc-api.hs

Run ./ghc-api with "+RTS -p" flag on, then program crashes.

$ ./ghc-api +RTS -p          
ghc-api: internal error: PAP object entered!
    (GHC version 6.12.3 for i386_apple_darwin)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
zsh: abort      ./ghc-api +RTS -p

My Envinronment is GHC-6.12.3 on Mac OS X 10.6.5.

Change History

Changed 3 years ago by guest

  • version changed from 7.0.1 to 6.12.3

Changed 3 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Thanks for the report.

In 7.0.1 you get a nice error:

$ ./q +RTS -p
q: q: You can't call compileExpr in a profiled compiler

Unfortunately this isn't possible at present.

Note: See TracTickets for help on using tickets.