Opened 4 years ago

Closed 3 years ago

#6103 closed bug (fixed)

Interrupted program cannot produce biographical heap profile

Reported by: konn Owned by: simonmar
Priority: high Milestone: 7.4.2
Component: Profiling Version: 7.4.1
Keywords: Cc:
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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:
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"

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?

Change History (5)

comment:1 Changed 4 years ago by simonmar

  • difficulty set to Unknown
  • Milestone set to 7.4.2
  • Owner set to simonmar
  • Priority changed from normal to high

Thanks for the report, I'll take a look.

comment:2 Changed 3 years ago by marlowsd@…

commit 20ba7f1a7a7b05acd81124f1567a3a103bcd0d1b

Author: Simon Marlow <[email protected]>
Date:   Tue Jun 5 09:05:47 2012 +0100

    throwTo: unlock the MSG_THROWTO object before returning (#6103)

 rts/RaiseAsync.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

comment:3 Changed 3 years ago by simonmar

  • Resolution set to fixed
  • Status changed from new to closed

Punting on a regression test, because it's too hard to make one.

comment:4 Changed 3 years ago by simonmar

  • Status changed from closed to merge

comment:5 Changed 3 years ago by pcapriotti

  • Status changed from merge to closed
Note: See TracTickets for help on using tickets.