[GHC] #9525: +RTS -xc stack trace sometimes reported twice

GHC ghc-devs at haskell.org
Sat Aug 30 10:57:19 UTC 2014


#9525: +RTS -xc stack trace sometimes reported twice
-------------------------------------+-------------------------------------
       Reporter:  osa1               |                   Owner:  osa1
           Type:  bug                |                  Status:  new
       Priority:  low                |               Milestone:
      Component:  Runtime System     |                 Version:  7.8.3
       Keywords:  profiling, stack   |        Operating System:
  trace, error                       |  Unknown/Multiple
   Architecture:  x86_64 (amd64)     |         Type of failure:  Incorrect
     Difficulty:  Unknown            |  result at runtime
     Blocked By:                     |               Test Case:
Related Tickets:                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 Not sure if really a bug but just wanted to show. If this is a bug I'm
 hoping to fix this myself but I may need some guidance.

 Stack trace reported by `+RTS -xc` is sometimes printed twice. This
 program reports it only once, as expected:

 {{{#!haskell
 f :: Int -> Int
 f = error "hello"

 main = print (f 20)
 }}}

 {{{
 ➜  ghc_patch  ./error +RTS -xc
 *** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace:
   Main.f,
   called from Main.CAF
   --> evaluated by: Main.main,
   called from Main.CAF
 error: hello
 }}}

 But if I change it to this:

 {{{#!haskell
 f :: Int -> Int
 f x =
   let x = x + 20
   in x

 main = print (f 20)
 }}}

 Stack trace is reported twice:

 {{{
 ➜  ghc_patch  ./error +RTS -xc
 *** Exception (reporting due to +RTS -xc): (THUNK_STATIC), stack trace:
   Main.f.x,
   called from Main.f,
   called from Main.main,
   called from Main.CAF
 *** Exception (reporting due to +RTS -xc): (THUNK_STATIC), stack trace:
   Main.f.x,
   called from Main.f,
   called from Main.main,
   called from Main.CAF
 error: <<loop>>
 }}}

 Can anyone confirm that this is really a bug?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9525>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list