[GHC] #12202: GHC 7.10.3 throws away callstack frames for outer

#12202: GHC 7.10.3 throws away callstack frames for outer -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect result Unknown/Multiple | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It was noticed that GHC 7.10.3 sometimes drops outer callers from IP callstacks. For instance, {{{#!hs {-# LANGUAGE ImplicitParams #-} import GHC.Stack import Control.Monad.Catch newtype MyError = MyError CallStack instance Exception MyError instance Show MyError where show (MyError e) = show e fromEvents :: (MonadThrow m, ?loc :: CallStack) => m (Maybe Int) fromEvents = do Just <$> require 42 where -- require :: (MonadThrow m, ?loc :: CallStack) => Int -> m Int require n -- line 17 | even n = throwM $ MyError ?loc | otherwise = return n main = do putStrLn "Hello world" fromEvents -- line 24 }}} GHC 8.0.1 produces the correct output, {{{ $ ./Hi Hello world Hi: [("fromEvents",SrcLoc {srcLocPackage = "main", srcLocModule = "Main", srcLocFile = "Hi.hs", srcLocStartLine = 24, srcLocStartCol = 5, srcLocEndLine = 24, srcLocEndCol = 15})] }}} GHC 7.10.3 produces only one {{{#!hs $ ./Hi Hello world Hi: CallStack {getCallStack = [("?loc",SrcLoc {srcLocPackage = "main", srcLocModule = "Main", srcLocFile = "Hi.hs", srcLocStartLine = 17, srcLocStartCol = 35, srcLocEndLine = 17, srcLocEndCol = 39})]} }}} Uncommenting the type signature for `require` however results in more-or- less the expected callstack with 7.10.3, {{{#!hs $ ./Hi Hello world Hi: CallStack {getCallStack = [("?loc",SrcLoc {srcLocPackage = "main", srcLocModule = "Main", srcLocFile = "Hi.hs", srcLocStartLine = 18, srcLocStartCol = 35, srcLocEndLine = 18, srcLocEndCol = 39}),("require",SrcLoc {srcLocPackage = "main", srcLocModule = "Main", srcLocFile = "Hi.hs", srcLocStartLine = 14, srcLocStartCol = 14, srcLocEndLine = 14, srcLocEndCol = 21}),("fromEvents",SrcLoc {srcLocPackage = "main", srcLocModule = "Main", srcLocFile = "Hi.hs", srcLocStartLine = 24, srcLocStartCol = 5, srcLocEndLine = 24, srcLocEndCol = 15})]} }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12202 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12202: GHC 7.10.3 throws away callstack frames for outer -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: => 8.0.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12202#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12202: GHC 7.10.3 throws away callstack frames for outer -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12202#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12202: GHC 7.10.3 throws away callstack frames in some cases -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12202#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12202: GHC 7.10.3 throws away callstack frames in some cases -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by edsko): * cc: edsko (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12202#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC