Capture memory dumps on First Chance Exception using DebugDiag

We often need to capture memory dumps to investigate issues. I am sharing below guide to collect memory dumps using DebugDiag :

Pre-requisites :

  • Download DebugDiag (download)
  • Windows 2008 and higher

There are 2 ways to capture FIRST CHANCE EXCEPTION memory dumps of a process.

  • Method 1: Generate a dump for all First Chance Exception
    Or
  • Method 2: Target a specific First chance exception (Recommended)

Method 1: Generate a dump for all First Chance Exception

  1. Launch DebugDiag

  2. In the Rules tab select Crash and click on Next.
     

  3. In “Select Target Type” select “A specific process” and click on Next.

    Note: If the target is a web application hosted on IIS then, choose either “All IIS/COM+ related processes” or “A specific IIS web application pool”.

  4. In “Select Target” select the target process and click on Next.

  5. In “Advanced Configuration (Optional)” under “Unconfigured First Chance Exceptions” set the following: 
    Action type for unconfigured first chance exceptions: Full Userdump
    Action Limit for unconfigured first chance exceptions: 10

  6. Click on Next twice and then click on Finish to activate the rule.

Method 2: Target a specific First Chance Exception (Recommended)

Refer the instructions in Method 1 until step 5. After that refer the below instructions. For the purpose of this post, we will use StackOverflowException.

  1. In “Advanced Configuration (Optional)” click on the Exceptions… button :

  2. In “First chance Exception Configuration” click on “Add Exception…”

  3. In “Configure Exception” select the CLR Exception from the LHS and since we are targeting StackOverflowException, specify the details as shown below: 
    .NET Exception Type: System.StackOverflowException
    Action Type: Full Userdump
    Action Limit: 5

  4. NOTE: The Exception type is case sensitive. Ensure it is entered correctly.

  5. Click on Ok and then click on “Save & Close”.

  6. Click on Next twice and then click on Finish to activate the rule.

4 Likes