diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-01-15 11:54:41 -0500 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-01-15 11:54:41 -0500 |
commit | c13151e5ac774d38d7c5a807692851022c18fe6b (patch) | |
tree | e95e46062ec96ca66dbe64e42c0b63b3a9a9b7b7 /testsuite | |
parent | db91d17edfbe7deecb62bbb89c804249f9c4a4bd (diff) | |
download | haskell-c13151e5ac774d38d7c5a807692851022c18fe6b.tar.gz |
Improve access violation reporting on Windows
Summary:
This patch is courtesy of @awson.
Currently, whenever GHC catches a segfault on Windows, it simply reports the
somewhat uninformative message
`Segmentation fault/access violation in generated code`. This patch adds to
the message the type of violation (read/write/dep) and location information,
which should help debugging segfaults in the future.
Fixes #13108.
Test Plan: Build on Windows
Reviewers: austin, erikd, bgamari, simonmar, Phyx
Reviewed By: bgamari, Phyx
Subscribers: awson, thomie, #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D2969
GHC Trac Issues: #13108
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/rts/all.T | 12 | ||||
-rw-r--r-- | testsuite/tests/rts/derefnull.stdout-i386-unknown-mingw32 | 2 | ||||
-rw-r--r-- | testsuite/tests/rts/derefnull.stdout-x86_64-unknown-mingw32 | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index cf8e90419e..14f0cec295 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -13,6 +13,12 @@ test('testmblockalloc', # See bug #101, test requires +RTS -c (or equivalently +RTS -M<something>) # only GHCi triggers the bug, but we run the test all ways for completeness. test('bug1010', normal, compile_and_run, ['+RTS -c -RTS']) + +def normalise_address(str): + return re.sub('Access violation in generated code when reading [0]+', + 'Access violation in generated code when reading ADDRESS', + str) + test('derefnull', [# LLVM Optimiser considers dereference of a null pointer # undefined and marks the code as unreachable which means @@ -29,7 +35,7 @@ test('derefnull', when(platform('i386-apple-darwin'), [ignore_stderr, exit_code(139)]), when(platform('x86_64-apple-darwin'), [ignore_stderr, exit_code(139)]), when(platform('powerpc-apple-darwin'), [ignore_stderr, exit_code(139)]), - when(opsys('mingw32'), exit_code(1)), + when(opsys('mingw32'), [exit_code(1), normalise_fun(normalise_address)]), # since these test are supposed to crash the # profile report will be empty always. # so disable the check for profiling @@ -180,7 +186,7 @@ def checkDynAsm(actual_file, normaliser): # to somehow extract out the name of DLLs to do that test('T5435_v_asm', when(arch('powerpc64') or arch('powerpc64le'), - expect_broken(11259)), + expect_broken(11259)), run_command, ['$MAKE -s --no-print-directory T5435_v_asm']) test('T5435_v_gcc', when(arch('powerpc64') or arch('powerpc64le'), expect_broken(11259)), @@ -371,7 +377,7 @@ test('T10296b', [only_ways('threaded2')], compile_and_run, ['']) test('numa001', [ extra_run_opts('8'), extra_ways(['debug_numa']) ] , compile_and_run, ['']) - + test('T12497', [ unless(opsys('mingw32'), skip) ], run_command, ['$MAKE -s --no-print-directory T12497']) diff --git a/testsuite/tests/rts/derefnull.stdout-i386-unknown-mingw32 b/testsuite/tests/rts/derefnull.stdout-i386-unknown-mingw32 index 5f2034dd57..4541b7fb28 100644 --- a/testsuite/tests/rts/derefnull.stdout-i386-unknown-mingw32 +++ b/testsuite/tests/rts/derefnull.stdout-i386-unknown-mingw32 @@ -1 +1 @@ -Segmentation fault/access violation in generated code +Access violation in generated code when reading ADDRESS diff --git a/testsuite/tests/rts/derefnull.stdout-x86_64-unknown-mingw32 b/testsuite/tests/rts/derefnull.stdout-x86_64-unknown-mingw32 index 5f2034dd57..4541b7fb28 100644 --- a/testsuite/tests/rts/derefnull.stdout-x86_64-unknown-mingw32 +++ b/testsuite/tests/rts/derefnull.stdout-x86_64-unknown-mingw32 @@ -1 +1 @@ -Segmentation fault/access violation in generated code +Access violation in generated code when reading ADDRESS |