Skip to content

Commit

Permalink
Fix stack overflow createdump triggering on Windows (#40869)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikem8361 authored Aug 15, 2020
1 parent 8907340 commit 1d6fc68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/coreclr/src/vm/eepolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,9 @@ void DisplayStackOverflowException()
DWORD LogStackOverflowStackTraceThread(void* arg)
{
LogCallstackForLogWorker((Thread*)arg);

#ifdef HOST_WINDOWS
CreateCrashDumpIfEnabled();
#endif
return 0;
}

Expand Down
7 changes: 4 additions & 3 deletions src/coreclr/src/vm/excep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4119,10 +4119,11 @@ LaunchCreateDump(LPCWSTR lpCommandLine)
void
CreateCrashDumpIfEnabled()
{
// If enabled, launch the create minidump utility and wait until it completes
if (g_createDumpCommandLine != nullptr)
// If enabled, launch the create minidump utility and wait until it completes. Only launch createdump once for this process.
LPCWSTR createDumpCommandLine = InterlockedExchangeT<LPCWSTR>(&g_createDumpCommandLine, nullptr);
if (createDumpCommandLine != nullptr)
{
LaunchCreateDump(g_createDumpCommandLine);
LaunchCreateDump(createDumpCommandLine);
}
}

Expand Down

0 comments on commit 1d6fc68

Please sign in to comment.