Skip to content

Commit

Permalink
Fix a couple of Windows createdump issues (#35820)
Browse files Browse the repository at this point in the history
* Fix ERROR_PARTIAL_COPY retry. MiniDumpWriteDump sets the last error to the HRESULT instead of win32 error code

* Fix createdump crash triggering on x86 runtime. The initialization code
was in the wrong place and not being called on the x86 coreclr.dll. Moved
it to early in EEStartupHelper.
  • Loading branch information
mikem8361 committed May 5, 2020
1 parent e3c7444 commit 30c0d0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/src/debug/createdump/createdumpwindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ CreateDump(const char* dumpPath, int pid, MINIDUMP_TYPE minidumpType)
else
{
int err = GetLastError();
if (err != ERROR_PARTIAL_COPY)
if (err != HRESULT_FROM_WIN32(ERROR_PARTIAL_COPY))
{
fprintf(stderr, "Write dump FAILED %d\n", err);
fprintf(stderr, "Write dump FAILED 0x%08x\n", err);
break;
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/src/vm/ceemain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,11 @@ void EEStartupHelper()
IfFailGo(EEConfig::Setup());

#ifndef CROSSGEN_COMPILE

#ifdef HOST_WINDOWS
InitializeCrashDump();
#endif // HOST_WINDOWS

// Initialize Numa and CPU group information
// Need to do this as early as possible. Used by creating object handle
// table inside Ref_Initialization() before GC is initialized.
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/src/vm/exceptionhandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,6 @@ void InitializeExceptionHandling()
// Register handler for termination requests (e.g. SIGTERM)
PAL_SetTerminationRequestHandler(HandleTerminationRequest);
#endif // TARGET_UNIX
#ifdef HOST_WINDOWS
InitializeCrashDump();
#endif // HOST_WINDOWS
}

struct UpdateObjectRefInResumeContextCallbackState
Expand Down

0 comments on commit 30c0d0a

Please sign in to comment.