Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revert improved diagnostics
  • Loading branch information
zooba committed May 5, 2020
commit 6c53dd4514a0954aa528cb15ac8fe1ef0e3279ba
2 changes: 1 addition & 1 deletion Lib/test/test_faulthandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ def test_raise_exception(self):
for exc, name in (
('EXCEPTION_ACCESS_VIOLATION', 'access violation'),
('EXCEPTION_INT_DIVIDE_BY_ZERO', 'int divide by zero'),
('EXCEPTION_STACK_OVERFLOW', r'stack overflow(\s+\(.+\))?'),
('EXCEPTION_STACK_OVERFLOW', 'stack overflow'),
):
self.check_windows_exception(f"""
import faulthandler
Expand Down
12 changes: 1 addition & 11 deletions Modules/faulthandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ faulthandler_exc_handler(struct _EXCEPTION_POINTERS *exc_info)
const int fd = fatal_error.fd;
DWORD code = exc_info->ExceptionRecord->ExceptionCode;
DWORD flags = exc_info->ExceptionRecord->ExceptionFlags;
PyThreadState *tstate;

if (faulthandler_ignore_exception(code)) {
/* ignore the exception: call the next exception handler */
Expand All @@ -403,16 +402,7 @@ faulthandler_exc_handler(struct _EXCEPTION_POINTERS *exc_info)
case EXCEPTION_INT_DIVIDE_BY_ZERO: PUTS(fd, "int divide by zero"); break;
case EXCEPTION_INT_OVERFLOW: PUTS(fd, "integer overflow"); break;
case EXCEPTION_IN_PAGE_ERROR: PUTS(fd, "page error"); break;
case EXCEPTION_STACK_OVERFLOW:
PUTS(fd, "stack overflow");
/* call UncheckedGet directly to avoid setting exceptions */
tstate = _PyThreadState_UncheckedGet();
if (tstate != NULL) {
PUTS(fd, " (recursion depth=");
_Py_DumpDecimal(fd, tstate->recursion_depth);
PUTS(fd, ")");
}
break;
case EXCEPTION_STACK_OVERFLOW: PUTS(fd, "stack overflow"); break;
default:
PUTS(fd, "code 0x");
_Py_DumpHexadecimal(fd, code, 8);
Expand Down