[GHC] #12696: Exception gives not enough information to be useful

GHC ghc-devs at haskell.org
Thu Oct 13 18:11:02 UTC 2016


#12696: Exception gives not enough information to be useful
-------------------------------------+-------------------------------------
           Reporter:  flip101        |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:  exception      |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I was told in #haskell @freenode to report this as a bug. I have a program
 that throws exceptions and tried debugging the problem within ghci and
 also outside of ghci with these commands:

 {{{
 stack build --ghc-options '-rtsopts -fprof-auto -fprof-auto-calls'
 --executable-profiling
 stack exec -- vhdl +RTS -xc
 }}}


 {{{#!hs
 tfComment :: Data from => from -> from
 tfComment = transformBi tf
   where tf (Comment ((pos_c, c), (pos_s, s))) = Comment $ ((pos_c,
 T.concat ["--", c]), (pos_s, s))
         tf a = a

 zeroPos :: Data from => from -> from
 zeroPos = transformBi zp
   where zp sp@(M.SourcePos _ _ _) = sp { M.sourceName="",
 M.sourceLine=unsafePos 1, M.sourceColumn=unsafePos 1}
         zp x = x

 -- (a)dd (e)xtended(i)dentifier (s)laches
 aeis :: Data from => from -> from
 aeis = transformBi x
   where x (IExtended a) = let updated_text :: Text
                               updated_text = T.concat ["\\", snd $ t_text
 a, "\\"]
                           in IExtended $ a {t_text = (fst $ t_text a,
 updated_text)}
         x a = a

 bla = something..
   where parser_prop :: ContextClause -> Bool
         parser_prop = \x -> (transformIn <$> Right x) == (transformOut <$>
 parseSource parser $ T.toStrict . printSource $ transformIn x)
         transformIn ast = zeroPos ast
         transformOut ast = tfComment $ aeis $ zeroPos ast
 }}}

 ghci trace
 {{{
 λ> :trace main
 Stopped in <exception thrown>, <unknown>
 _exception :: e = _
 λ> :back
 Logged breakpoint at Main.hs:95:13-26
 _result :: from -> from
 tf :: Comment -> Comment
 λ> :list
 94  tfComment :: Data from => from -> from
 95  tfComment = transformBi tf -- transformBi tf highlighted here
 96    where tf (Comment ((pos_c, c), (pos_s, s))) = Comment $ ((pos_c,
 T.concat ["--", c]), (pos_s, s))
 λ> :back
 Logged breakpoint at Main.hs:242:28-57
 _result :: from
 ast :: from
 λ> :list
 241          transformIn ast = zeroPos ast
 242          transformOut ast = tfComment $ aeis $ zeroPos ast --
 tfComment $ aeis $ zeroPos ast highlighted here
 243
 λ> :force ast
 ast = Right []
 λ> transformIn (Right [])
 Right []
 λ> transformOut (Right [])
 Right []
 λ> zeroPos (Right [])
 Right []
 λ> aeis (Right [])
 Right []
 λ> tfComment (Right [])
 Right []
 }}}

 run with profiling options (this was aborted at some point)

 {{{
 » stack exec -- vhdl +RTS -xc
 *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
   Data.Data.CAF
   --> evaluated by: Data.Generics.Uniplate.Internal.Data.sybChildren.f,
   called from Data.Generics.Uniplate.Internal.Data.sybChildren,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f.cs,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap.populate,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
   called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
   called from Data.Generics.Uniplate.Data.biplate.answer,
   called from Data.Generics.Uniplate.Data.biplate,
   called from Main.CAF:lvl2028_r3oe6
   --> evaluated by: Data.HashMap.Base.toList',
  called from Data.HashMap.Base.equal,
  called from Data.HashMap.Base.==,
  called from Data.Generics.Uniplate.Internal.Data.fixEq,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
  called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
  called from Data.Generics.Uniplate.Data.biplate.answer,
  called from Data.Generics.Uniplate.Data.biplate,
  called from Main.CAF:lvl2028_r3oe6
 *** Exception (reporting due to +RTS -xc): (THUNK_STATIC), stack trace:
  Data.Generics.Uniplate.Internal.Data.uniplateVerbose,
  called from Data.Generics.Uniplate.Internal.Data.CAF:uniplateVerbose
  --> evaluated by: Data.Generics.Uniplate.Internal.Data.readCacheFollower,
  called from Data.Generics.Uniplate.Data.biplate.answer,
  called from Data.Generics.Uniplate.Data.biplate,
  called from Main.CAF:lvl2028_r3oe6
  --> evaluated by: Data.Generics.Uniplate.Internal.Data.fromOracle,
  called from Data.Generics.Uniplate.Internal.Data.biplateData,
  called from Data.Generics.Uniplate.Data.biplate,
  called from Main.tfComment,
  called from Main.qcrp.transformOut,
  called from Main.qcrp.parser_prop,
  called from Main.qcrp.parser_prop,
  called from Main.qc2.logInput,
  called from Main.qc2.logInput,
  called from Main.qc2.logInput,
  called from Main.qc2,
  called from Test.QuickCheck.Property.forAllShrink.\.\,
  called from Test.QuickCheck.Property.property,
  called from Test.QuickCheck.Test.quickCheckWithResult.property',
   called from Test.QuickCheck.Test.quickCheckWithResult.\,
   called from Test.QuickCheck.Text.withNullTerminal,
   called from Test.QuickCheck.Test.quickCheckWithResult,
   called from Main.qc2,
   called from Main.qcrp,
   called from Main.ntc
 *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
   Data.Generics.Uniplate.Internal.Data.sybChildren.f,
   called from Data.Generics.Uniplate.Internal.Data.sybChildren,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f.cs,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap.populate,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
   called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
   called from Data.Generics.Uniplate.Data.biplate.answer,
   called from Data.Generics.Uniplate.Data.biplate,
   called from Main.CAF:lvl2025_r3oe3
   --> evaluated by: Data.HashMap.Base.toList',
  called from Data.HashMap.Base.equal,
  called from Data.HashMap.Base.==,
  called from Data.Generics.Uniplate.Internal.Data.fixEq,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
  called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
  called from Data.Generics.Uniplate.Data.biplate.answer,
  called from Data.Generics.Uniplate.Data.biplate,
  called from Main.CAF:lvl2025_r3oe3
 *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
  Data.Generics.Uniplate.Internal.Data.sybChildren.f,
  called from Data.Generics.Uniplate.Internal.Data.sybChildren,
  called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f.cs,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap.populate,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
  called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
  called from Data.Generics.Uniplate.Data.biplate.answer,
  called from Data.Generics.Uniplate.Data.biplate,
  called from Main.CAF:lvl2022_r3oe0
  --> evaluated by: Data.HashMap.Base.toList',
   called from Data.HashMap.Base.equal,
   called from Data.HashMap.Base.==,
   called from Data.Generics.Uniplate.Internal.Data.fixEq,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
   called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
   called from Data.Generics.Uniplate.Data.biplate.answer,
   called from Data.Generics.Uniplate.Data.biplate,
   called from Main.CAF:lvl2022_r3oe0
 *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
   Data.Generics.Uniplate.Internal.Data.sybChildren.f,
   called from Data.Generics.Uniplate.Internal.Data.sybChildren,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f.cs,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap.populate,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
   called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
   called from Data.Generics.Uniplate.Data.biplate.answer,
   called from Data.Generics.Uniplate.Data.biplate,
   called from Main.CAF:lvl1945_r3oc9
 *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
   Data.Generics.Uniplate.Internal.Data.sybChildren.f,
   called from Data.Generics.Uniplate.Internal.Data.sybChildren,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f.cs,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap.populate,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
   called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
   called from Data.Generics.Uniplate.Data.descend.answer,
   called from Data.Generics.Uniplate.Data.descend,
   called from Data.Generics.Uniplate.Operations.transform.g,
   called from Data.Generics.Uniplate.Operations.transform,
   called from Main.CAF:answer6_r3ocg
   --> evaluated by: Data.HashMap.Base.toList',
  called from Data.HashMap.Base.equal,
  called from Data.HashMap.Base.==,
  called from Data.Generics.Uniplate.Internal.Data.fixEq,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
  called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
  called from Data.Generics.Uniplate.Data.descend.answer,
  called from Data.Generics.Uniplate.Data.descend,
  called from Data.Generics.Uniplate.Operations.transform.g,
  called from Data.Generics.Uniplate.Operations.transform,
  called from Main.CAF:answer6_r3ocg
 *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
  Data.Generics.Uniplate.Internal.Data.sybChildren.f,
  called from Data.Generics.Uniplate.Internal.Data.sybChildren,
  called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f.cs,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap.populate,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
  called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
  called from Data.Generics.Uniplate.Data.descend.answer,
  called from Data.Generics.Uniplate.Data.descend,
  called from Data.Generics.Uniplate.Operations.transform.g,
  called from Data.Generics.Uniplate.Operations.transform,
  called from Main.CAF:answer7_r3ocp
  --> evaluated by: Data.HashMap.Base.toList',
   called from Data.HashMap.Base.equal,
   called from Data.HashMap.Base.==,
   called from Data.Generics.Uniplate.Internal.Data.fixEq,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
   called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
   called from Data.Generics.Uniplate.Data.descend.answer,
   called from Data.Generics.Uniplate.Data.descend,
   called from Data.Generics.Uniplate.Operations.transform.g,
   called from Data.Generics.Uniplate.Operations.transform,
   called from Main.CAF:answer7_r3ocp
 *** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
   Data.Generics.Uniplate.Internal.Data.sybChildren.f,
   called from Data.Generics.Uniplate.Internal.Data.sybChildren,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f.cs,
   called from
 Data.Generics.Uniplate.Internal.Data.insertHitMap.populate.f,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap.populate,
   called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
   called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
   called from Data.Generics.Uniplate.Data.descend.answer,
   called from Data.Generics.Uniplate.Data.descend,
   called from Data.Generics.Uniplate.Operations.transform.g,
   called from Data.Generics.Uniplate.Operations.transform,
   called from Main.CAF:answer8_r3ocy
   --> evaluated by: Data.HashMap.Base.toList',
  called from Data.HashMap.Base.equal,
  called from Data.HashMap.Base.==,
  called from Data.Generics.Uniplate.Internal.Data.fixEq,
  called from Data.Generics.Uniplate.Internal.Data.insertHitMap,
  called from Data.Generics.Uniplate.Internal.Data.readCacheFollower,
  called from Data.Generics.Uniplate.Data.descend.answer,
  called from Data.Generics.Uniplate.Data.descend,
  called from Data.Generics.Uniplate.Operations.transform.g,
  called from Data.Generics.Uniplate.Operations.transform,
  called from Main.CAF:answer8_r3ocy
 ^C^C^C^C
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12696>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list