diff options
author | Tamar Christina <tamar@zhox.com> | 2017-10-03 13:37:52 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-10-03 15:16:27 -0400 |
commit | ec9ac20d0964c9f1323105b5a2df24f50d4fe3ef (patch) | |
tree | 5e21ede1766511cc09b1eb46e7f571d36f3c34ae /docs | |
parent | 55001c0c9934de2cf94d3879cea20c0faf73695c (diff) | |
download | haskell-ec9ac20d0964c9f1323105b5a2df24f50d4fe3ef.tar.gz |
Add ability to produce crash dumps on Windows
It's often hard to debug things like segfaults on Windows,
mostly because gdb isn't always of use and users don't know
how to effectively use it.
This patch provides a way to create a crash drump by passing
`+RTS --generate-crash-dumps` as an option. If any unhandled
exception is triggered a dump is made that contains enough
information to be able to diagnose things successfully.
Currently the created dumps are a bit big because I include
all registers, code and threads information.
This looks like
```
$ testsuite/tests/rts/derefnull.run/derefnull.exe +RTS
--generate-crash-dumps
Access violation in generated code when reading 0000000000000000
Crash dump created. Dump written to:
E:\msys64\tmp\ghc-20170901-220250-11216-16628.dmp
```
Test Plan: ./validate
Reviewers: austin, hvr, bgamari, erikd, simonmar
Reviewed By: bgamari, simonmar
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3912
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/8.4.1-notes.rst | 3 | ||||
-rw-r--r-- | docs/users_guide/runtime_control.rst | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/users_guide/8.4.1-notes.rst b/docs/users_guide/8.4.1-notes.rst index 107519d92a..142f9f9340 100644 --- a/docs/users_guide/8.4.1-notes.rst +++ b/docs/users_guide/8.4.1-notes.rst @@ -170,6 +170,9 @@ Runtime system completely disable the runtime's handling of exceptions. See :ghc-ticket:`13911`, :ghc-ticket:`12110`. +- The GHC runtime on Windows can now generate crash dumps on unhandled exceptions + using the RTS flag :rts-flag:`--generate-crash-dumps`. + Template Haskell ~~~~~~~~~~~~~~~~ diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst index 7afc7262f8..905048c69b 100644 --- a/docs/users_guide/runtime_control.rst +++ b/docs/users_guide/runtime_control.rst @@ -228,6 +228,13 @@ Miscellaneous RTS options DLL, and don't want the RTS to ungracefully terminate your application on erros such as segfaults. +.. rts-flag:: --generate-crash-dumps + + If yes (the default), the RTS on Windows will generate a core dump on + any crash. These dumps can be inspected using debuggers such as WinDBG. + The dumps record all code, registers and threading information at the time + of the crash. Note that this implies `--install-seh-handlers=yes`. + .. rts-flag:: -xm ⟨address⟩ .. index:: |