8000 bpo-40458: Increase reserved stack space to prevent overflow crash on Windows by zooba · Pull Request #19845 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-40458: Increase reserved stack space to prevent overflow crash on Windows #19845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 5, 2020
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
Next Next commit
bpo-40458: Increase reserved stack space to prevent overflow crash on…
… Windows
  • Loading branch information
zooba committed May 1, 2020
commit cbd571e614bc17b4e486fcba7c1926b49383636c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increase reserved stack space to prevent overflow crash on Windows.
11 changes: 10 additions & 1 deletion Modules/faulthandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ 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 @@ -402,7 +403,15 @@ 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"); break;
case EXCEPTION_STACK_OVERFLOW:
PUTS(fd, "stack overflow");
tstate = get_thread_state();
if (tstate != NULL) {
PUTS(fd, " (recursion depth=");
_Py_DumpDecimal(fd, tstate->recursion_depth);
PUTS(fd, ")");
}
break;
default:
PUTS(fd, "code 0x");
_Py_DumpHexadecimal(fd, code, 8);
Expand Down
1 change: 1 addition & 0 deletions PCbuild/python_uwp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<Link>
<AdditionalDependencies>windowsapp.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
<StackReserveSize>2000000</StackReserveSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="$(Configuration) != 'Debug'">
Expand Down
0