Using error reports to debug crashes


Summary
At ArcGIS 9.3 and later, ArcGIS for Desktop applications generate user-mode error reports when ArcGIS applications fail. Error reports contain all the important information about the application that was running when it failed. These error reports are created for ArcGIS for Desktop applications and extensions (excluding ArcGIS Engine).
If the error occurred as a result of a custom component, the developer of that component can open the dump file (.dmp) in Visual Studio and locate the function call where the error occurred.

In this topic

  • Error reporting
  • Adding symbol file locations
  • Opening an error report and finding the exception
  • Minimum requirements

Error reporting

At ArcGIS 9.3 and later, ArcGIS for Desktop applications and extensions produce an error report if the application fails. An error report contains important information about where the failure occurred. If an ArcGIS application crashes, the user is prompted to send the error report (via a Web service) to Esri. All error reports sent to Esri are evaluated and addressed as appropriate. Regardless of whether the user sends the error report, the most recent 10 error reports are saved to the local %APPDATA%\ESRI\ErrorReports user directory with a .dmp file extension. When the number of error reports in the directory exceeds 10, the oldest error reports are automatically deleted as new error reports are saved.
As an ArcGIS for Desktop developer, you can utilize the technologies that capture software crash data as an additional debugging tool. In the event that ArcMap crashes due to a custom application command or extension, you can leverage the information contained in the Esri error report.
You can only debug crashes that occur as a result of your custom application command or extension; you cannot debug crashes within the ArcGIS for Desktop application.

Adding symbol file locations

To debug an ArcGIS for Desktop custom component error report, you must have access to the symbol files for Microsoft, ArcGIS, and your custom components. Symbol files provide a footprint of the functions that are contained in executable files and dynamic-link libraries (DLLs). Additionally, symbol files can present a roadmap of the function calls that lead to the point of failure. See How to use a symbol server on the Microsoft Developer Network (MSDN) Web site.
The process for adding symbol file locations differs slightly depending on whether you're using Visual Studio 2008 or Visual Studio 2010.
To add symbol file locations using Visual Studio 2008, perform the following steps:
  1. Start Microsoft Visual Studio.
  2. On the Tools menu, click Options. The Options dialog box appears.
  3. Click to expand the Debugging node, then click Symbols.
  4. Under the Symbol file (.pdb) locations area, click the Add Folder button and specify http://msdl.microsoft.com/download/symbols for the Microsoft symbols.
  5. Click the Add Folder button again and specify http://downloads2.esri.com/Support/symbols for the Esri symbols.
  6. Click the Add Folder button once more and add the location of your custom component symbol files (.pdb). See the following screen shot:

  1. Ensure that the Search the above locations only when symbols are loaded manually check box is not selected.
  2. Since you are using symbols on a remote symbol server, you can improve performance by creating and specifying a local directory to which the symbols can be copied. To do this, type a path in the Cache symbols from symbol servers to this directory text box (for example: C:\SymbolsCache).
  3. Click OK.
  4. Since you are using the Microsoft public symbol server, an End User License Agreement dialog box might appear as you initially access the symbols. Click Yes to accept the agreement and download symbols to your local cache.
To add symbol file locations using Visual Studio 2010, perform the following steps:
  1. Start Microsoft Visual Studio.
  2. On the Tools menu, click Options. The Options dialog box appears.
  3. Click to expand the Debugging node, then click Symbols.
  4. Under the Symbol file (.pdb) locations area, check the box for the Microsoft Symbol Servers.
  5. Click the Add Folder button and specify http://downloads2.esri.com/Support/symbols for the Esri symbols. 
  6. Click the Add Folder button again and add the location of your custom component symbol files (.pdb). See the following screen shot:

  1. Under Automatically load symbols for, select the All modules, unless excluded option.
  2. Since you are using symbols on a remote symbol server, you can improve performance by creating and specifying a local directory to which the symbols can be copied. To do this, type a path in the Cache symbols from symbol servers to this directory text box (for example: C:\SymbolsCache).
  3. Click OK.
  4. Since you are using the Microsoft public symbol server, an End User License Agreement dialog box might appear as you initially access the symbols. Click Yes to accept the agreement and download symbols to your local cache.
The data at the symbol file locations is for downloading only; the data cannot be browsed.
The initial downloading of symbols from the symbol file location could take a substantial amount of time (often 20 to 30 minutes or more). 

Opening an error report and finding the exception

Although Visual Studio can read error reports that contain information about managed code and unmanaged code, for managed code you must use Microsoft's SOS tool. For more information on the SOS tool, see How to use SOS on the MSDN Web site.
The process for opening and debugging an error report (dump file) differs slightly depending on whether you're using Visual Studio 2008 or Visual Studio 2010.
To open and debug an error report using Visual Studio 2008, perform the following steps:
  1. Start Visual Studio.
  2. Click the File menu, click Open, then click Project. The Open Project dialog box appears.
  3. Locate and select the dump file (it usually has a .dmp extension).
  4. Click OK.
  5. Press F5 to start debugging. The No Debugging Information dialog box appeas, as you cannot debug the actual ArcMap application. See the following screen shot:

  1. Click Yes to continue debugging. A Microsoft Visual Studio dialog box appears with a description of the error. See the following screen shot:

  1. Click Break.
  2. In the Visual Studio application, see the Stack Frame drop-down menu. The following screen shot shows the crashcommand.dll example in red, indicating that is where the error occurred.

  1. On the Debug menu, point to Windows, and click Call Stack to display similar information.
  2. If the source code is available, double-click the .dll in either the Stack Frame drop-down list or the Call Stack window to go to the line of code that caused the crash. If the source code is not available, a message will appear indicating that.
To open and debug an error report using Visual Studio 2010, perform the following steps:
  1. On the File menu, click Open, then click File. The Open File dialog box appears.
  2. Locate and select the dump file (it usually has a .dmp extension).
  3. Click OK. The Dump File Summary (or MiniDump File Summary) window appears. In this window, you can view debugging summary information for the dump file, set the symbol path, start debugging, and copy the summary information to the clipboard.
  4. In the Actions section, click Debug with Native Only or Debug with Mixed to start debugging. The No Debugging Information dialog box appears, as you cannot debug the actual ArcMap application. See the following screen shot:


  5. Click Yes to continue debugging. A Microsoft Visual Studio dialog box appears with a description of the error. See the following screen shot:


  6. Click Break on the Microsoft Visual Studio dialog box. You can then view the Call Stack and the .dll containing the error.
  7. If the source code is available, double-click the .dll in either the Stack Frame drop-down list or Call Stack window to go to the line of code that caused the crash. If the source code is not available, a message will appear indicating that. See the following screen shot:

For more information on opening an error report, see How to save and open dump files on the MSDN Web site.
For additional information on registry settings, see Error report registry settings in this help system.

Minimum requirements

  • Visual Studio 2008 Standard, Pro, or Team
  • Visual Studio 2010 Pro, Premium, or Ultimate
  • Access to Microsoft Symbol Servers
  • Access to Esri ArcGIS Symbol Servers
  • Access to your local symbol file (.pdb) location






Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced
ArcReader ArcReader