[commit: ghc] master: Add stack traces on crashes on Windows (99c61e2)
git at git.haskell.org
git at git.haskell.org
Sun Oct 22 11:18:58 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/99c61e2220c4cba20117107f371aace68668a42f/ghc
>---------------------------------------------------------------
commit 99c61e2220c4cba20117107f371aace68668a42f
Author: Tamar Christina <tamar at zhox.com>
Date: Sun Oct 22 12:14:22 2017 +0100
Add stack traces on crashes on Windows
Summary:
This patch adds the ability to generate stack traces on crashes for Windows.
When running in the interpreter this attempts to use symbol information from
the interpreter and information we know about the loaded object files to
resolve addresses to symbols.
When running compiled it doesn't have this information and then defaults
to using symbol information from PDB files. Which for now means only
files compiled with ICC or MSVC will show traces compiled.
But I have a future patch that may address this shortcoming.
Also since I don't know how to walk a pure haskell stack, I can for now
only show the last entry. I'm hoping to figure out how Apply.cmm works to
be able to walk the stalk and give more entries for pure haskell code.
In GHCi
```
$ echo main | inplace/bin/ghc-stage2.exe --interactive ./testsuite/tests/rts/derefnull.hs
GHCi, version 8.3.20170830: http://www.haskell.org/ghc/ :? for help
Ok, 1 module loaded.
Prelude Main>
Access violation in generated code when reading 0x0
Attempting to reconstruct a stack trace...
Frame Code address
* 0x77cde10 0xc370229 E:\..\base\dist-install\build\HSbase-4.10.0.0.o+0x190031
(base_ForeignziStorable_zdfStorableInt4_info+0x3f)
```
and compiled
```
Access violation in generated code when reading 0x0
Attempting to reconstruct a stack trace...
Frame Code address
* 0xf0dbd0 0x40bb01 E:\..\rts\derefnull.run\derefnull.exe+0xbb01
```
Test Plan: ./validate
Reviewers: austin, hvr, bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3913
>---------------------------------------------------------------
99c61e2220c4cba20117107f371aace68668a42f
docs/users_guide/8.4.1-notes.rst | 4 +
docs/users_guide/runtime_control.rst | 6 +
includes/rts/Flags.h | 1 +
libraries/base/GHC/RTS/Flags.hsc | 3 +
libraries/base/changelog.md | 3 +
rts/Linker.c | 15 ++
rts/LinkerInternals.h | 3 +
rts/RtsFlags.c | 15 ++
rts/linker/PEi386.c | 196 +++++++++++++++++++++
rts/linker/PEi386.h | 2 +
rts/package.conf.in | 1 +
rts/win32/veh_excn.c | 96 +++++++++-
rts/win32/veh_excn.h | 1 +
testsuite/tests/rts/all.T | 8 +-
.../rts/derefnull.stdout-i386-unknown-mingw32 | 1 -
.../rts/derefnull.stdout-x86_64-unknown-mingw32 | 1 -
.../rts/divbyzero.stdout-i386-unknown-mingw32 | 1 -
.../rts/divbyzero.stdout-x86_64-unknown-mingw32 | 1 -
18 files changed, 346 insertions(+), 12 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 99c61e2220c4cba20117107f371aace68668a42f
More information about the ghc-commits
mailing list