summaryrefslogtreecommitdiff
path: root/rts/RtsMain.c
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2017-09-26 14:34:58 -0400
committerBen Gamari <ben@smart-cactus.org>2017-09-26 17:43:48 -0400
commit1421d87c8aabd7b1934f60bef688939882c8251c (patch)
treea686de6c4aa4b1dbb9622b1af0ba5b699d79fe49 /rts/RtsMain.c
parent47888fd8b40fa1db24f107ffdf12ac1673bbe650 (diff)
downloadhaskell-1421d87c8aabd7b1934f60bef688939882c8251c.tar.gz
Switch VEH to VCH and allow disabling of SEH completely.
Exception handling on Windows is unfortunately a bit complicated. But essentially the VEH Handlers we currently have are running too early. This was a problem as it ran so early it also swallowed C++ exceptions and other software exceptions which the system could have very well recovered from. So instead we use a sequence of chains to for the exception handlers to run as late as possible. You really can't get any later than this. Please read the comment in the patch for more details. I'm also providing a switch to allow people to turn off the exception handling entirely. In case it does present a problem with their code. (Reverted and recommitted to fix authorship information) Test Plan: ./validate Reviewers: austin, hvr, bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13911, #12110 Differential Revision: https://phabricator.haskell.org/D3911
Diffstat (limited to 'rts/RtsMain.c')
-rw-r--r--rts/RtsMain.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/rts/RtsMain.c b/rts/RtsMain.c
index c73002f63e..21b8577cca 100644
--- a/rts/RtsMain.c
+++ b/rts/RtsMain.c
@@ -44,8 +44,6 @@ int hs_main ( int argc, char *argv[], // program args
RtsConfig rts_config) // RTS configuration
{
- BEGIN_WINDOWS_VEH_HANDLER
-
int exit_status;
SchedulerStatus status;
@@ -56,11 +54,10 @@ int hs_main ( int argc, char *argv[], // program args
}
#endif
-
-
-
hs_init_ghc(&argc, &argv, rts_config);
+ BEGIN_WINDOWS_VEH_HANDLER
+
// kick off the computation by creating the main thread with a pointer
// to mainIO_closure representing the computation of the overall program;
// then enter the scheduler with this thread and off we go;