[GHC] #11544: SCC call-stack from `error` missing call-sites

#11544: SCC call-stack from `error` missing call-sites -------------------------------------+------------------------------------- Reporter: gridaphobe | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.0.1-rc1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- For some reason the `-prof` stack that `error` attaches only includes the top-level CAF. This is with the default build settings (which I believe are the release settings?) {{{ $ cat Foo.hs main = print (foo [1]) foo xs = tail (tail xs) $ ./inplace/bin/ghc-stage2 --make -prof -fprof-auto-calls Foo.hs [1 of 1] Compiling Main ( Foo.hs, Foo.o ) [flags changed] Linking Foo ... $ ./Foo Foo: Prelude.tail: empty list CallStack (from -prof): GHC.List.CAF (<entire-module>) }}} I would expect to at least see the call-site of `foo` (if not also `tail`) in the stack. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11544 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11544: SCC call-stack from `error` missing call-sites -------------------------------------+------------------------------------- Reporter: gridaphobe | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Profiling | Version: 8.0.1-rc1 Resolution: wontfix | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * status: new => closed * resolution: => wontfix Comment: Yeah, this is a known problem, and it's kind of by design. The call to `error` in `GHC.List` is lifted out as a CAF, because it has no dependencies. Profiling doesn't add extra arguments to things (to avoid changing the cost model of the program), so this CAF can be evaluated only once. I'll close the ticket as wontfix for now, but I do have some experimental changes that might help with this in the future. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11544#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11544: SCC call-stack from `error` missing call-sites -------------------------------------+------------------------------------- Reporter: gridaphobe | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Profiling | Version: 8.0.1-rc1 Resolution: wontfix | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gridaphobe): I see, that makes some sense. Is this decision documented somewhere? It came up in a thread [1] on /r/haskell, and is likely to cause more confusion with the advertisement of stack-traces by default from `error`. [1]: https://www.reddit.com/r/haskell/comments/441e3s/how_to_use_the_implicit_err... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11544#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11544: SCC call-stack from `error` missing call-sites -------------------------------------+------------------------------------- Reporter: gridaphobe | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Profiling | Version: 8.0.1-rc1 Resolution: wontfix | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by varosi): How could we find such an error in large application where we doesn't know where this Prelude.tail usage come from? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11544#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC