Using dump files
Previous Top Next


When you enable " Generate stack/memory dumps for exceptions", Thinstall will try to create a .dmp file for each unhandled exception that occurs inside of your application.

Crash dump files can be used to determine information about an exception event from a remote end-user PC, including:

· Call stack for a crash
· A List of DLLs loaded into memory at the time of a crash (both virtual and real DLLs)
· Information about the current thread and local variables.

Where are my crash dump files placed?
By default, Thinstall will create a sequence of crash dump files in your application directory. You can change the path of where crash dump files are placed by editing the log output filename. If your users run as restricted users and your application is installed to c:\program files, then they will not have permission to create crash dump files in c:\program files. In this case, you may want to modify the log output filename to something like %AppData%\thinstall.log. See filename macros for more details.

How do I look at a crash dump?
Use the program windbg.exe provided with Microsoft's free Debugging Tools for Windows .

How can I see .NET exceptions and call stacks?
Microsoft provided a windbg.exe plugin for .NET called Son of Strike (SOS). This MSDN article details more information about SOS:
Bugslayer: Mini Dump Snapshots and the New SOS -- MSDN Magazine March 2005


Quick steps:
1. Download and Install Debugging Tools for Windows
and Microsoft Platform SDK
1. Load windbg.exe
2. File->Open Crash Dump
3. File -> Symbol File Path (based on your current version of .NET and the platform SDK)
For example for .NET 2.0 and Visual Studio 2005 Enter C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\symbols
4. Click reload, then OK
5. View -> Command
6. For .NET 1.1 enter ".load C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\sos.dll"
For .NET 2.0 enter ".load C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\sos.dll"
7. Enter "!clrstack" to show the .NET call stack, or enter "!clrstack"

Example CLR stack
0012f060 03fb8efe System.IO.__Error.WinIOError(Int32, System.String)
0012f0c0 036ff00b System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean)
0012f144 036feba0 System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess)
0012f158 03921755 t.Util.HitsLogger.LoadUnreportedLogEntries(System.String)
0012f18c 039215f7 t.Util.HitsLogger.Start()
0012f198 03920970 t.Hosting.HostingController.Main(System.String[])
0012f2a8 03920122 t.Hosting.HostMain.Main(System.String)
0012f468 7977baad [ContextTransitionFrame: 0012f468]
0012f494 7977baad [GCFrame: 0012f494]
0012f5e0 7977baad [ComMethodFrame: 0012f5e0]


Save your source code & PDB files!

PDB files are generated by Visual Studio when you compile an application or DLL. The PDB files contains information about how to map instruction addresses into source code lines. In order to accurately determine which line a crash occured on, you will need to save a copy of your original source code and PDB files for a specific release version. Before each release of your software, make it a habit to save a copy of your source code tree and PDB files.

Supported Platforms

Thinstall uses dbghelp.dll to generate dump files. dbghelp.dll is not present on all versions of Windows and several versions of dbghelp.dll exist. To ensure crash dumps can be generated for Windows operating systems that do not have dbghelp.dll already installed, you should add a copy of dbghelp.dll to your Thinstall project.

dbghelp.dll is not supported on Windows NT, so crash dumps will not be generated on this platform.
dbghelp.dll does support Windows 95,98,ME,2k,XP, and higher.