summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-06-06 20:47:14 (GMT)
committerGitHub <noreply@github.com>2017-06-06 20:47:14 (GMT)
commit2bafc0dccac2390a52670ba289878318b6ea0293 (patch)
tree334d1274a37f407c5810b35a5a32e969a281647d /Modules
parentb25b7254d909697bb7f3aa893b740cb650547cb6 (diff)
downloadcpython-2bafc0dccac2390a52670ba289878318b6ea0293.zip
cpython-2bafc0dccac2390a52670ba289878318b6ea0293.tar.gz
cpython-2bafc0dccac2390a52670ba289878318b6ea0293.tar.bz2
[3.6] bpo-30557: faulthandler now correctly filters and displays exception … (#1960)
* bpo-30557: faulthandler now correctly filters and displays exception codes on Windows (#1924) * bpo-30557: faulthandler now correctly filters and displays exception codes on Windows * Adds test for non-fatal exceptions. * Adds bpo number to comment. * bpo-30557: Fix test_faulthandler (#1969) On Windows 8, 8.1 and 10 at least, the exit code is the exception code (no bit is cleared).
Diffstat (limited to 'Modules')
-rw-r--r--Modules/faulthandler.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 61fc490..2efa998 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -373,8 +373,8 @@ faulthandler_exc_handler(struct _EXCEPTION_POINTERS *exc_info)
DWORD code = exc_info->ExceptionRecord->ExceptionCode;
DWORD flags = exc_info->ExceptionRecord->ExceptionFlags;
- /* only log fatal exceptions */
- if (flags & EXCEPTION_NONCONTINUABLE) {
+ /* bpo-30557: only log fatal exceptions */
+ if (!(code & 0x80000000)) {
/* call the next exception handler */
return EXCEPTION_CONTINUE_SEARCH;
}
@@ -391,8 +391,8 @@ faulthandler_exc_handler(struct _EXCEPTION_POINTERS *exc_info)
case EXCEPTION_IN_PAGE_ERROR: PUTS(fd, "page error"); break;
case EXCEPTION_STACK_OVERFLOW: PUTS(fd, "stack overflow"); break;
default:
- PUTS(fd, "code ");
- _Py_DumpDecimal(fd, code);
+ PUTS(fd, "code 0x");
+ _Py_DumpHexadecimal(fd, code, 8);
}
PUTS(fd, "\n\n");