
#15832: returnIO/bindIO destroys runtime explicit stack information in some cases -------------------------------------+------------------------------------- Reporter: infinity0 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Resolution: | 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 infinity0): OK, but then how do I get a proper "evaluated by" stack trace? From [https://github.com/ghc/ghc/blob/f877d9cc99dd1ba0c038e70527031e9ba0934cd3/rts... here] it seems that only CAF stacks can be traversed to the "evaluated by" stacks. Stacks that don't come from a CAF, can't be traversed further to see what caused the evaluation of an error/bottom value. In both cases, I am creating an `X` with a bottom inside it. This is a decently common pattern used in Haskell, the intent is that I never evaluate the bottom. However, programmers make mistakes and it's nice to be able to get a stack trace showing me what was trying to evaluate the bottom. In the good case, I can see both (a) the stack that created the bottom value and (b) the stack that caused the evaluation of bottom. In the bad case, I can only see (a) and I can't see (b), making things very hard to debug. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15832#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler