id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
6103	Interrupted program cannot produce biographical heap profile	konn	simonmar	"If I interrupt program running with ""+RTS -p -hb"" option, the program aborts with message below and I could only get empty heap profile.

Minimal case is below:

{{{
module Main where
main :: IO ()
main = print $ sum [1..10000000000]
}}}

I compiled this code with ""-prof -rtsopts"" options, ran the program and then interrupt after several seconds.

{{{
$ ghc http-biographic-profile.hs -prof -rtsopts
[1 of 1] Compiling Main             ( http-biographic-profile.hs, http-biographic-profile.o )
Linking biographic-profile ...
$ ./http-biographic-profile +RTS -hb -p        
^Chttp-biographic-profile: internal error: Invalid object in processHeapClosureForDead(): 58
    (GHC version 7.0.4 for x86_64_apple_darwin)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
zsh: abort      ./http-biographic-profile +RTS -hb -p
}}}

Empty heap profile generated is below:

{{{
JOB ""biographic-profile +RTS -hb -p""
DATE ""Thu May 17 17:12 2012""
SAMPLE_UNIT ""seconds""
VALUE_UNIT ""bytes""
BEGIN_SAMPLE 0.00
END_SAMPLE 0.00
}}}

I reproduce this behaviour in environments below:


 * GHC-7.0.4 (x86_64_apple_darwin, OS X 10.6.8, distributed with haskell-platform 2011.3.0.0)
 * GHC-7.4.1 (x86_64_apple_darwin, OS X 10.6.8, installed from tarball, sandboxed with virthualenv)


I think ""-hb"" show work even when program interrupted, because ""-hy"", ""-hd"", ""-hr"" and so on works in such a situation. Is this a intended behaviour?"	bug	closed	high	7.4.2	Profiling	7.4.1	fixed			MacOS X	x86_64 (amd64)	Runtime crash	Unknown				
