Created
October 24, 2013 14:45
-
-
Save Tarrasch/7138579 to your computer and use it in GitHub Desktop.
Stack Traces, why you such a *****?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- version 1: | |
| e = do print 1002 | |
| ba <- reifyStack' | |
| print $ sizeofByteArray ba | |
| printStackTrace ba | |
| print $ 1 `div` 0 | |
| print 2002 | |
| -- gives: | |
| Stack trace: | |
| 0: stg_bh_upd_frame_ret (at rts/Updates.cmm:86:1-91:2) | |
| 1: stg_bh_upd_frame_ret (at rts/Updates.cmm:86:1-91:2) | |
| 2: runMainIO (at libraries/base/GHC/TopHandler.lhs:67:35-71:67) | |
| ... 2 unknown frames ... | |
| 5: sFt_info (using SYMTAB: /home/arash/repos/ghc-prof/my/ReifyTest) | |
| ... 3 unknown frames ... | |
| 9: sFt_info (using SYMTAB: /home/arash/repos/ghc-prof/my/ReifyTest) | |
| ... 3 unknown frames ... | |
| 13: sFt_info (using SYMTAB: /home/arash/repos/ghc-prof/my/ReifyTest) | |
| -- Version 2: | |
| e = do print 1002 | |
| print $ 1 `div` 0 | |
| print 2002 | |
| -- gives: | |
| Loading debug data... | |
| Stack trace: | |
| 0: stg_bh_upd_frame_ret (at rts/Updates.cmm:86:1-91:2) | |
| 1: stg_bh_upd_frame_ret (at rts/Updates.cmm:86:1-91:2) | |
| 2: ltInteger (at libraries/integer-gmp/GHC/Integer/Type.lhs:340:1-343:66) | |
| 3: integerToString (at libraries/base/GHC/Show.lhs:477:1-552:35) | |
| 4: stg_upd_frame_ret (at rts/Updates.cmm:31:1-38:2) | |
| 5: writeBlocks (at libraries/base/GHC/IO/Handle/Text.hs:587:4-612:31) | |
| 6: stg_ap_v_ret (at rts/dist/build/AutoApply.cmm:8:1-92:2) | |
| 7: bindIO (at libraries/base/GHC/Base.lhs:609:61-609:77) | |
| 8: bindIO (at libraries/base/GHC/Base.lhs:609:61-609:77) | |
| 9: bindIO (at libraries/base/GHC/Base.lhs:609:61-609:77) | |
| 10: bindIO (at libraries/base/GHC/Base.lhs:609:61-609:77) | |
| 11: bindIO (at libraries/base/GHC/Base.lhs:609:61-609:77) | |
| 12: bindIO (at libraries/base/GHC/Base.lhs:609:61-609:77) | |
| 13: stg_catch_frame_ret (at rts/Exception.cmm:365:1-367:2) | |
| As a procedural programmer this is extremely unintuitive. Why on earth is the stack *completly* different when you just do some successfully terminating actions before exactly the same crash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment