diff options
author | Steve Dower <steve.dower@microsoft.com> | 2017-06-05 22:54:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-05 22:54:15 (GMT) |
commit | e6a23c8f9a3ce05b759599696cc131c2d9d147ac (patch) | |
tree | a94a11d18829920638d1f54d1f388bf39295a9e6 /Modules/faulthandler.c | |
parent | 1bced56567335745f91676192fc39c06aab30da9 (diff) | |
download | cpython-e6a23c8f9a3ce05b759599696cc131c2d9d147ac.zip cpython-e6a23c8f9a3ce05b759599696cc131c2d9d147ac.tar.gz cpython-e6a23c8f9a3ce05b759599696cc131c2d9d147ac.tar.bz2 |
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.
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r-- | Modules/faulthandler.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index dcfebf2..39b70bc 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"); |