Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 458
    • Merge requests 458
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #9525
Closed
Open
Created Aug 30, 2014 by Ömer Sinan Ağacan@osa1Maintainer

+RTS -xc stack trace sometimes reported twice

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:

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:

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?

Trac metadata
Trac field Value
Version 7.8.3
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC simonmar
Operating system
Architecture
evaluated by: Main.main,\r\n called from Main.CAF\r\nerror: hello\r\n}}}\r\n\r\nBut if I change it to this:\r\n\r\n{{{#!haskell\r\nf :: Int -> Int\r\nf x =\r\n let x = x + 20\r\n in x\r\n\r\nmain = print (f 20)\r\n}}}\r\n\r\nStack trace is reported twice:\r\n\r\n{{{\r\n➜ ghc_patch ./error +RTS -xc \r\n*** Exception (reporting due to +RTS -xc): (THUNK_STATIC), stack trace: \r\n Main.f.x,\r\n called from Main.f,\r\n called from Main.main,\r\n called from Main.CAF\r\n*** Exception (reporting due to +RTS -xc): (THUNK_STATIC), stack trace: \r\n Main.f.x,\r\n called from Main.f,\r\n called from Main.main,\r\n called from Main.CAF\r\nerror: <>\r\n}}}\r\n\r\nCan anyone confirm that this is really a bug?","type_of_failure":"OtherFailure","blocking":[]} -->
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking