id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
4532	Profiling crashes with GHC API	guest		"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."	bug	closed	normal		Profiling	6.12.3	fixed	GHC,Profiling,GHC API,Crash		MacOS X	x86	Runtime crash					
