Skip to content

Interrupted program cannot produce biographical heap profile

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?

Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Profiling
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information