Skip to content

gjuttla/ExceptionDumpGrabber

 
 

Repository files navigation

Small utility to grab memory dumps on first-chance and unhandled exceptions

This code is just a small tool that will use the createdump utility from .NET to fetch full dumps from a running .NET process if one of the configured first-chance exception or an unhandled exception happens.

Building

Just use

dotnet publish -c release

and you will find the contents in bin\release\netcoreapp3.0\publish\.

Injecting into the observed process

To do so you need to use the .NET start-up hooks.

Please set the Environment:

DOTNET_STARTUP_HOOKS=<directory_where_the_tool_is_deployed>/ExceptionGrabber.dll
DT_FIRST_CHANCE_EXCEPTIONS=<ExceptionA>,<ExceptionB>

After starting the process again you should notice a line like:

...
Exception Grabber active - wrtiting dumps to /tmp
...

Settings

Setting the directory dumps will be written to

DT_CRASH_DUMP_DIR=/home/user/mycrashdumps

Changing the crashdump - executable

DT_DUMP_EXEC=/root/.dotnet/shared/Microsoft.NETCore.App/3.1.4/createdump

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 53.3%
  • C# 46.7%