Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
Register a custom crash handler #95461
Copy link
Copy link
Open
Labels
area-Diagnostics-coreclrenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
Metadata
Metadata
Assignees
Labels
area-Diagnostics-coreclrenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
We would like to implement custom data collection/reporting when a crash occurs in a .NET application, but right now it doesn't look like there is a good way to do that.
It would be nice to have something similar to
-XX:OnErrorin Java, which allows to set a custom command that will be executed in case of a crash (before the process is teared down).For instance, it could be a
DOTNET_DbgCrashHandlerenvironment variable that takes the path to the custom crash handler. Just like-XX:OnError, it would replace%pwith the pid. It could make sense to also support the other arguments that are currently given to createdump (such as the minidump type or the path) but I don't see that as a requirement.From a CLR perspective, most of the code would be identical, the main difference being that
PROCBuildCreateDumpCommandLinewould initialize the command-line for the custom tool instead of createdump (it has also some impacts inPROCCreateCrashDumpIfEnabled).