From f31001db75ed27f5419f6a35213478c612af1d31 Mon Sep 17 00:00:00 2001 From: noahfalk Date: Mon, 20 Mar 2017 17:06:59 -0700 Subject: [PATCH] Support Windows Minidump This is the coreclr portion of the work to complete issue dotnet/coreclr#10334. It adds a resource to coreclr with a well-known name and format that can be used by MiniDumpWriteDump to discover and load custom dump collection extensions. At this time the OS work hasn't been implemented yet and the scenario won't work until their part is complete. Commit migrated from https://github.com/dotnet/coreclr/commit/761db6438911ca82d99fe26a809331bf88574804 --- src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt | 3 ++- src/coreclr/src/dlls/mscoree/coreclr/README.md | 7 +++++++ .../src/dlls/mscoree/coreclr/dump_helper_resource.bin | Bin 0 -> 17 bytes 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/coreclr/src/dlls/mscoree/coreclr/README.md create mode 100644 src/coreclr/src/dlls/mscoree/coreclr/dump_helper_resource.bin diff --git a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt index ed15500..f2514d2 100644 --- a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -166,8 +166,9 @@ if(WIN32) COMMAND ${BuildToolsDir}/InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$ COMMAND ${BuildToolsDir}/GenClrDebugResource.exe /dac:$ /dbi:$ /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin COMMAND ${BuildToolsDir}/InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$ /name:CLRDEBUGINFO + COMMAND ${BuildToolsDir}/InjectResource.exe /bin:${CMAKE_CURRENT_SOURCE_DIR}/dump_helper_resource.bin /dll:$ /name:MINIDUMP_AUXILIARY_PROVIDER COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp - COMMENT Add dactable & debug resources to coreclr + COMMENT Add dactable, debug resources, and dump helper resources to coreclr ) add_custom_target(inject_debug_resources ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp) diff --git a/src/coreclr/src/dlls/mscoree/coreclr/README.md b/src/coreclr/src/dlls/mscoree/coreclr/README.md new file mode 100644 index 0000000..b33473b --- /dev/null +++ b/src/coreclr/src/dlls/mscoree/coreclr/README.md @@ -0,0 +1,7 @@ +dump\_helper\_resource.bin in this folder is a text file with a single 0 byte appended on the end using a hex-editor. It is unlikely it will need to be modified frequently if at all, +but if that changes we can always create a little nicer tooling for it. + +dump\_helper\_resource.bin is used to populate the DUMP\_HELPER resource inside coreclr.dll on Windows. When an application crashes, Windows MinidumpWriteDump is planning to scan +modules looking for this resource. The content of the resource is expected to be the name of a dll in the same folder, encoded in UTF8, null terminated, that implements the +CLRDataCreateInterface function. For OS security purposes MinidumpWriteDump will do an authenticode signing check before loading the indicated binary, however if your build isn't +signed you can get around this limitation by registering it at HKLM\Software\Microsoft\WindowsNT\CurrentVersion\MiniDumpAuxilliaryDlls. \ No newline at end of file diff --git a/src/coreclr/src/dlls/mscoree/coreclr/dump_helper_resource.bin b/src/coreclr/src/dlls/mscoree/coreclr/dump_helper_resource.bin new file mode 100644 index 0000000000000000000000000000000000000000..aa2d9eae1f8c5fa5108c6854a1c09c90ad32ea02 GIT binary patch literal 17 Wcmc~TPR=h%NlXTksd_0nISc?j;Rav; literal 0 HcmV?d00001 -- 2.7.4