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

#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

#9525: +RTS -xc stack trace sometimes reported twice -------------------------------------+------------------------------------- Reporter: osa1 | Owner: osa1 Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 7.8.3 Resolution: | Keywords: profiling, | stack trace, error Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * priority: low => normal * component: Runtime System => Profiling Comment: Some duplicates stack traces in this output as well, with a profiled `ghc`: http://lpaste.net/1842576927450202112. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9525#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9525: +RTS -xc stack trace sometimes reported twice -------------------------------------+------------------------------------- Reporter: osa1 | Owner: osa1 Type: bug | Status: closed Priority: normal | Milestone: Component: Profiling | Version: 7.8.3 Resolution: invalid | Keywords: profiling, | stack trace, error Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * status: new => closed * resolution: => invalid Comment: I'm closing this ticket as it's not possible to reproduce anymore. Same program now prints this with `-O`: {{{ *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace: Main.f, called from Main.main, called from Main.CAF --> evaluated by: Main.main, called from Main.CAF --> evaluated by: Main.main Main: test CallStack (from HasCallStack): error, called at Main.hs:2:5 in main:Main CallStack (from -prof): Main.f (Main.hs:2:1-16) Main.main (Main.hs:4:1-19) Main.CAF (<entire-module>) }}} and this without `-O`: {{{ *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace: Main.f, called from Main.CAF --> evaluated by: Main.main, called from Main.CAF Main: test CallStack (from HasCallStack): error, called at Main.hs:2:5 in main:Main CallStack (from -prof): Main.f (Main.hs:2:1-16) Main.CAF (<entire-module>) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9525#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC