Support Windows Minidump
authornoahfalk <noahfalk@microsoft.com>
Tue, 21 Mar 2017 00:06:59 +0000 (17:06 -0700)
committernoahfalk <noahfalk@microsoft.com>
Tue, 21 Mar 2017 23:46:03 +0000 (16:46 -0700)
This is the coreclr portion of the work to complete issue #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.

src/dlls/mscoree/coreclr/CMakeLists.txt
src/dlls/mscoree/coreclr/README.md [new file with mode: 0644]
src/dlls/mscoree/coreclr/dump_helper_resource.bin [new file with mode: 0644]

index ed15500..f2514d2 100644 (file)
@@ -166,8 +166,9 @@ if(WIN32)
         COMMAND ${BuildToolsDir}/InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$<TARGET_FILE:coreclr>
         COMMAND ${BuildToolsDir}/GenClrDebugResource.exe /dac:$<TARGET_FILE:mscordaccore> /dbi:$<TARGET_FILE:mscordbi> /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
         COMMAND ${BuildToolsDir}/InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$<TARGET_FILE:coreclr> /name:CLRDEBUGINFO
+        COMMAND ${BuildToolsDir}/InjectResource.exe /bin:${CMAKE_CURRENT_SOURCE_DIR}/dump_helper_resource.bin /dll:$<TARGET_FILE:coreclr> /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/dlls/mscoree/coreclr/README.md b/src/dlls/mscoree/coreclr/README.md
new file mode 100644 (file)
index 0000000..b33473b
--- /dev/null
@@ -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/dlls/mscoree/coreclr/dump_helper_resource.bin b/src/dlls/mscoree/coreclr/dump_helper_resource.bin
new file mode 100644 (file)
index 0000000..aa2d9ea
Binary files /dev/null and b/src/dlls/mscoree/coreclr/dump_helper_resource.bin differ