[GHC] #14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: | Version: 8.2.2 libraries/base | Keywords: | Operating System: Linux Architecture: | Type of failure: Incorrect result Unknown/Multiple | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When you run 'error', it shows the usual stack trace. When you enable profiling with the -prof flag to ghc, and you run 'error', it shows the usual stack trace plus an additional prof-specific stack trace. When you run 'errorWithoutStackTrace' with profiling enabled, it strips the usual stack trace of 'error', but still displays the prof-specific stack trace. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.2.2 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * cc: simonmar (added) Comment: Why do you think this is a bug? We're talking about two kinds of stacks here 1. Stack trace constructed by user-provided `HasCallStack` constraints 2. Stack trace constructed by the RTS and generated code via (sometimes auto-generated) `SCC` annotations (aka. "cost-centre stack") and it's quite possible that these two stack traces show different things, they have different purposes. `errorWithoutStackTrace` overrides (1) but it can't override (2), (2) is a lower-level thing. Paging simonmar as he made `error` include the CCS stack in profiling mode in Phab:D1426. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.2.2 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rotaerk): I don't know for sure that it's a bug. The ''apparent'' intent of errorWithoutStackTrace was not being followed, so I wanted to draw attention to it. If someone with familiarity with the decisions behind the implementation declares this to be intended behavior, the ticket can be closed. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.2.2 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Indeed I think this is expected. The point (as I understand it) of `errorWithoutStackTrace` is to avoid the (potential) runtime cost of `HasCallStack`. In the case of the CCS stack there is no additional cost to providing the stack-trace. We probably ought to document this, however. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.4.2 Component: libraries/base | Version: 8.2.2 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * owner: (none) => simonmar * milestone: => 8.4.2 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: libraries/base | Version: 8.2.2 Resolution: | Keywords: Operating System: Linux | 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.4.2 => 8.6.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: libraries/base | Version: 8.2.2 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4648 Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * differential: => Phab:D4648 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: libraries/base | Version: 8.2.2 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4648 Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * cc: dfeuer (added) Comment: bgamari, that's a bit tricky. It's only possible to avoid building the call stack if the demand analyzer can see that it won't be used. I think the only reliable way to avoid building one is to be careful with your constraints. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: libraries/base | Version: 8.2.2 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4648 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Marlow <marlowsd@…>): In [changeset:"dc655bf0310012b193cf49cce9f5b0bfbc53764c/ghc" dc655bf0/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="dc655bf0310012b193cf49cce9f5b0bfbc53764c" errorWithoutStackTrace: omit profiling stack trace (#14970) Test Plan: validate Reviewers: hvr, bgamari, erikd Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4648 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14970: GHC.Err.errorWithoutStackTrace produces stack trace when profiling enabled -------------------------------------+------------------------------------- Reporter: rotaerk | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: libraries/base | Version: 8.2.2 Resolution: fixed | Keywords: Operating System: Linux | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4648 Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14970#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC