<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>A smorgasbord of technical tips brought to you by Mark D M Jackson.

  var _gaq = _gaq || [];
  _gaq.push([‘_setAccount’, ‘UA-25851204-1’]);
  _gaq.push([‘_trackPageview’]);

  (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
  })();</description><title>InfoPurge Programming Tips</title><generator>Tumblr (3.0; @infopurge)</generator><link>http://infopurge.tumblr.com/</link><item><title>Setting up a Symbol Server</title><description>&lt;h3&gt;Setting up a Symbol Server&lt;/h3&gt;
&lt;ol&gt;&lt;li&gt;Overview.&lt;/li&gt;
&lt;li&gt;Set your projects up to generate symbol files (PDB - Program DataBase).&lt;/li&gt;
&lt;li&gt;Set your release build or daily build to add PDBs and product binaries to a symbol store.&lt;/li&gt;
&lt;li&gt;Change debugger configuration to point to use a symbol server to access the symbol store (and the Microsoft online symbol store).&lt;/li&gt;
&lt;li&gt;How the debugger locates symbol files.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;!-- more --&gt;&lt;br/&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In order to effectively debug problems reported by customers in release versions of your products, you will need to generate and store the symbol files (PDB files - program database) for all DLLs and EXEs that comprise the product. This applies to debugging both live applications and crash dumps. &lt;br/&gt;[Note that you must create the PDBs at the same time as the product binaries because the debugger uses timestamp and GUID information to match PDB files to binaries during debugging and these will change when you rebuild - even if the source code is the same.] &lt;br/&gt;Native code symbol files contain full annotations of the binary including: source filenames and line numbers, functions (static, private and public), types, variable names, Frame Point Omission (FPO) data etc. Managed symbol files contain less debug information because most of the symbol information is available in the assembly file metadata.&lt;br/&gt;You can either store the symbols with the rest of the product in your &amp;#8220;release directory&amp;#8221; or you can store the symbols (and binaries) in a symbol store located on a PC on your intranet for easy access by all members of the programming team. The latter case is described here.&lt;br/&gt;You can configure your daily build or automated release procedure to automatically add symbols to the symbol store after a successful build.&lt;br/&gt;&lt;br/&gt;When debugging, you configure Visual Studio or WinDbg to access the Symbol Store using a symbol server (symserv.dll).&lt;br/&gt;&lt;br/&gt;In addition to product specific symbols, you will also need matching symbols for the system DLLs that were loaded on the customer&amp;#8217;s machine at the time a dump file was generated. Microsoft provides an online symbol server containing symbols for these system DLLs.&lt;br/&gt;You may also need copies of the various .NET version DLLs in order to debug managed applications.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Generating Symbol Files&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For C# and VB.NET:&lt;/strong&gt; View the project properties. Select Build tab - then scroll down and click the Advanced button. In the Advanced Build Settings dialog make sure that Debug Info is set to &amp;#8220;pdb-only&amp;#8221; for release builds and &amp;#8220;full&amp;#8221; for debug builds. Full allows the debugger to attach to the process when it is running. From the command line use /debug:full or /debug:pdbonly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For C++:&lt;/strong&gt; View the project properties. Select C/C++. Select the General property page. For the Debug Information Format option select Program Database. From the command line use /Zi.&lt;/p&gt;
&lt;p&gt;The PDB file will be called project.pdb and will be placed in the project output folder along with the binary (EXE or DLL).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setting up a Symbol Store&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To ensure that you always have the correct symbol files matching the binaries you are debugging you should set up a company Symbol Store. &lt;br/&gt;You then add your binaries and symbols to the symbol store during your daily builds or at least during your release builds.&lt;br/&gt;Your build server machine is a good candidate for the location of your symbol server.&lt;br/&gt;The symbol server tools are part of the Debugging Tools For Windows. Make sure you use the latest version of the debugging tools and check for updates regularly.&lt;/p&gt;
&lt;p&gt;To create a Symbol Store.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Download the Debugging Tools for Windows from &lt;a target="_blank" href="http://www.microsoft.com/whdc/Devtools/Debugging/default.mspx"&gt;&lt;a href="http://www.microsoft.com/whdc/Devtools/Debugging/default.mspx" target="_blank"&gt;http://www.microsoft.com/whdc/Devtools/Debugging/default.mspx&lt;/a&gt;&lt;/a&gt; and install on the server.&lt;/li&gt;
&lt;li&gt;Create a folder to store the symbols (e.g. c:\SymStore)&lt;/li&gt;
&lt;li&gt;Share this folder on the network so other users can reach it.&lt;/li&gt;
&lt;li&gt;Add the symstore command to your daily build or release batch files. e.g. to add files recursively (/r) from the product root folder (/f r:\rootproductfolder) to the symbol store folder (/s c:\symstore) with the product name (/t &amp;#8220;MyApp&amp;#8221;) with a specified version (/v &amp;#8220;%1&amp;#8221;) and comment (/c &amp;#8220;Daily Build&amp;#8221;) use&amp;#8230;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;symstore add /r /f r:\rootproductfolder /s c:\SymStore /t &amp;#8220;MyApp&amp;#8221; /v &amp;#8220;%1&amp;#8221; /c &amp;#8220;Daily Build&amp;#8221;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This example uses /v &amp;#8220;%1&amp;#8221; where the symstore command is in a DOS batch file. %1 is just parameter 1 passed into the batch file. If you are running inside an MSBUILD file then use &amp;#8220;$(Version)&amp;#8221; or something similar. The main point here is that you use a different version (e.g. the build number of the product) each time you add files to the symstore. This way you can easily identify versions that can be deleted from the symbol store should the symbol store become bloated over time.&lt;/p&gt;
&lt;p&gt;For detailed options to the symstore command see &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms681378(VS.85).aspx"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms681378" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/ms681378&lt;/a&gt;(VS.85).aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Debugger access to the symbol store&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Install Debugging Tools for Windows if you are using WinDbg. Visual Studio should come with a version of symsrv.dll.&lt;/p&gt;
&lt;p&gt;Visual Studio - Select Tools \ Options \ Debugging \ Symbols. Add &amp;#8220;&lt;a target="_blank" href="http://msdl.microsoft.com/download/symbols"&gt;&lt;a href="http://msdl.microsoft.com/download/symbols" target="_blank"&gt;http://msdl.microsoft.com/download/symbols&lt;/a&gt;&lt;/a&gt;&amp;#8221; and &amp;#8220;&lt;a target="_blank" href="javascript:void(0);"&gt;&amp;#92;MyServer\SymStore&lt;/a&gt;&amp;#8221;. Include a local cache for speed (e.g. c:\localstore). Symbol files and binaries downloaded from the symbol servers are cached in c:\localstore for future use. If c:\localstore gets too large you can either delete the whole folder or use AgeStore.exe (part of Debugging Tools for Windows) to remove files older than a particular date.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lrv73vn9Y61r0dgwn.jpg" width="390" height="205"/&gt;&lt;/p&gt;
&lt;p&gt;WinDbg - Select File \ Symbol File Path and include: &lt;strong&gt;&lt;em&gt;SRV*c:/localstore*http://msdl.microsoft.com/download/symbols;SRV*c:\localstore*&amp;#92;MyServer\SymStore&lt;/em&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lrv768SNIv1r0dgwn.jpg" width="388" height="193"/&gt;&lt;/p&gt;
&lt;p&gt;You can append additional paths on the end delimited by a semicolon.&lt;br/&gt;This command says: SRV* (shorthand for symsrv*symsrv.dll) - indicates that this part of the path is a symbol server reference and the debugger should use symsrv.dll to access the remote symbol store. The*c:\localstore*&amp;#8221; indicates that downloaded symbols and binaries should be cached in the specified folder for future use.&lt;br/&gt;&lt;a target="_blank" href="http://msdl.microsoft.com/download/symbols"&gt;&lt;a href="http://msdl.microsoft.com/download/symbols" target="_blank"&gt;http://msdl.microsoft.com/download/symbols&lt;/a&gt;&lt;/a&gt; is the location of the Microsoft public symbol store and &lt;a target="_blank" href="javascript:void(0);"&gt;&amp;#92;MyServer\SymStore&lt;/a&gt; is the location of your local store.&lt;br/&gt;Various cascading cache options are available. For more information see the Symbol Store help files contained in Debugging Tools for Windows.&lt;/p&gt;
&lt;p&gt;Also, in WinDbg you should add the same paths to the File \ Image File Path dialog.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;strong&gt;How the debugger finds the right symbol file&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The linker (compiler for managed code) embeds the path to the PDB file into the exe or DLL along with a GUID and timestamp. You can see this header using dumpbin.exe (part of the windows SDK). From a command prompt type dumpbin /headers myapp.exe &amp;gt;headers.txt. Then open headers.txt in notepad and you should see something like&amp;#8230;&lt;/p&gt;
&lt;p&gt;Debug Directories&lt;br/&gt;Time Type Size RVA Pointer&lt;br/&gt;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&lt;br/&gt;4B73E828 cv 48&amp;#160;00002BC8&amp;#160;1BC8 Format: RSDS, {2AB1D3E2-6F7F-43EB-903B-CA57510C08D5}, 2, c:\dev\myapp.pdb&lt;/p&gt;
&lt;p&gt;The debugger will search the following folders.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;The folder where the assembly was loaded (exe or dll).&lt;/li&gt;
&lt;li&gt;The folder specified in the Debug Directories section of the assembly (c:\dev\myapp.pdb in the example above).&lt;/li&gt;
&lt;li&gt;Any folders that you add to the symbol search path (see next section).&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Tools.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Dumpbin.exe - Dumps (native code) information contained in a binary file (DLL, EXE, COM).&lt;/li&gt;
&lt;li&gt;SymChk.exe - part of Debugging Tools For Windows - you can use to determine if a PDB has public or private symbols present.&lt;/li&gt;
&lt;li&gt;SymStore.exe - part of Debugging Tools For Windows - used to create a symbol store and add/remove files.&lt;/li&gt;
&lt;li&gt;AgeStore.exe - part of Debugging Tools For Windows - can be used to delete files in a directory heirarchy (e.g. a local symbol cache) older than a particular age.&lt;/li&gt;
&lt;li&gt;SymSrv.dll - must be installed on the same machine as the debugger.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;More Information.&lt;br/&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/b8ttk8zy.aspx"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/b8ttk8zy.aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/b8ttk8zy.aspx&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;a target="_blank" href="http://www.microsoft.com/whdc/Devtools/Debugging/default.mspx"&gt;&lt;a href="http://www.microsoft.com/whdc/Devtools/Debugging/default.mspx" target="_blank"&gt;http://www.microsoft.com/whdc/Devtools/Debugging/default.mspx&lt;/a&gt;&lt;/a&gt; - See the help file description of symbol servers.&lt;br/&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms681378(VS.85).aspx"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms681378" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/ms681378&lt;/a&gt;(VS.85).aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This blog was transferred from the StackHash product web site. StackHash is now an OpenSource code project at &lt;a title="StackHash in CodePlex" target="_blank" href="http://stackhash.codeplex.com/"&gt;codeplex&lt;/a&gt;.&lt;/p&gt;</description><link>http://infopurge.tumblr.com/post/10475955523</link><guid>http://infopurge.tumblr.com/post/10475955523</guid><pubDate>Wed, 21 Sep 2011 09:51:00 +0100</pubDate><category>windbg</category><category>Visual Studio</category><category>debugging</category><category>pdb</category><category>symbol server</category><category>symbol store</category></item><item><title>Integrate creation of WinQual mapping files with your build</title><description>&lt;p&gt;If you use WinQual you&amp;#8217;ll be familiar with running the &lt;a target="_blank" href="http://go.microsoft.com/fwlink?LinkId=57324"&gt;Microsoft Product Feedback Mapping Tool&lt;/a&gt; each time you ship your product. You might not have discovered that the tool includes &lt;a target="_blank" href="https://winqual.microsoft.com/Help/default.htm#dp_appmap.htm"&gt;command line&lt;/a&gt; support, which means you can create mapping files as part of your build.&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;Run appmap.exe /? for a list of command line options:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;-s - Folder containing files to be mapped&lt;/li&gt;
&lt;li&gt;-d - Output product map xml file&lt;/li&gt;
&lt;li&gt;-n - Product name&lt;/li&gt;
&lt;li&gt;-v - Product version&lt;/li&gt;
&lt;li&gt;-l - Log file&lt;/li&gt;
&lt;li&gt;-e - Skip scanning subdirectories&lt;/li&gt;
&lt;li&gt;-f - Allow tool to overwrite output file&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The snippet below shows an MSBuild target that invokes appmap.exe for StackHash (each time our release installer is built):&lt;/p&gt;
&lt;pre&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;ItemGroup&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;FilesToMap&lt;/span&gt; &lt;span&gt;Include&lt;/span&gt;&lt;span&gt;="R:\Path\StackHash.exe"&lt;/span&gt; &lt;span&gt;/&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;FilesToMap&lt;/span&gt; &lt;span&gt;Include&lt;/span&gt;&lt;span&gt;="R:\Elsewhere\StackHashUtilities.dll"&lt;/span&gt; &lt;span&gt;/&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;FilesToMap&lt;/span&gt; &lt;span&gt;Include&lt;/span&gt;&lt;span&gt;="..."&lt;/span&gt; &lt;span&gt;/&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;/&lt;/span&gt;&lt;span&gt;ItemGroup&lt;/span&gt; &lt;span&gt;&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;Target&lt;/span&gt; &lt;span&gt;Name&lt;/span&gt;&lt;span&gt;="CreateWinQualMap"&lt;/span&gt;&lt;br/&gt;&lt;span&gt;DependsOnTargets&lt;/span&gt;&lt;span&gt;="BuildInstaller"&lt;/span&gt;&lt;br/&gt;&lt;span&gt;Condition&lt;/span&gt;&lt;span&gt;=" '$(Configuration)' != 'Debug' "&lt;/span&gt; &lt;span&gt;&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;Message&lt;/span&gt; &lt;span&gt;Text&lt;/span&gt;&lt;span&gt;="Creating WinQual Product Mapping File"&lt;/span&gt; &lt;span&gt;/&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;Exec&lt;/span&gt; &lt;span&gt;Command&lt;/span&gt;&lt;span&gt;="DEL /q R:\StackHash\AppMap\*.*"&lt;/span&gt; &lt;span&gt;/&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;Exec&lt;/span&gt; &lt;span&gt;Command&lt;/span&gt;&lt;span&gt;="COPY %(FilesToMap.Identity) R:\StackHash\AppMap"&lt;/span&gt; &lt;span&gt;/&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;Exec&lt;/span&gt; &lt;span&gt;Command&lt;/span&gt;&lt;span&gt;="R:\3rdparty\Microsoft\appmap.exe &lt;br/&gt; -s R:\StackHash\AppMap &lt;br/&gt; -d R:\StackHash\WinQualMapFiles\$(VerText).xml &lt;br/&gt; -n StackHash &lt;br/&gt; -v $(VerText) &lt;br/&gt; -e &lt;br/&gt; -f"&lt;/span&gt; &lt;span&gt;/&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;/&lt;/span&gt;&lt;span&gt;Target&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The FilesToMap item group lists all of the product EXE and DLL files that should be included in the mapping. The first two commands in the target clear out a scratch folder and then fill it with these files. This is because our files are located in various folders so we need to pull them together for mapping. The third command invokes appmap.exe — note that $(VerText) is set to the full product version and that the line is broken up for clarity (it should be a single line of XML).&lt;/p&gt;
&lt;p&gt;Every release build of StackHash now has a matching product mapping file.&lt;/p&gt;
&lt;p&gt;You probably don&amp;#8217;t want to upload the mapping files for each build, but it&amp;#8217;s good to have the archive so you can quickly map a beta or release candidate if you want to start collecting crash reports. If you want to automate uploading the mapping file &lt;a target="_blank" href="http://feedback.stackhash.com/forums/44145-stackhash-beta-feedback/suggestions/700520-provide-a-method-to-map-maintain-binary-produ"&gt;vote for adding this feature to StackHash&lt;/a&gt;, and check out &lt;a target="_blank" href="http://code.google.com/p/winqual-client/"&gt;this tool&lt;/a&gt; on Google Code.&lt;/p&gt;
&lt;p&gt;[Blog post by Rob Ellison - taken from &lt;a title="StackHash in CodePlex" target="_blank" href="http://stackhash.codeplex.com/"&gt;StackHash&lt;/a&gt;]&lt;/p&gt;</description><link>http://infopurge.tumblr.com/post/10475838629</link><guid>http://infopurge.tumblr.com/post/10475838629</guid><pubDate>Wed, 21 Sep 2011 09:41:00 +0100</pubDate></item><item><title>The format of a minidump (mdmp) file.</title><description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This blog describes the basic structure and contents of a minidump file for those that want a brief overview without having to trawl the header files. A mdmp file is generated when an application crash (known as an exception) occurs in a Windows application. It contains varying amounts of information that can help the application developer determine the reason for the crash. Minidumps are normally analyzed using a debugger (windbg or Visual Studio) using symbol data that the programmer has access to.&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;A minidump created following an application crash is optionally sent to the Microsoft Windows Error Reporting (WinQual) site by the user where it is added to a database ready for the application developer to download and debug, either manually or with a productivity tool such as &lt;a title="StackHash in CodePlex" target="_blank" href="http://stackhash.codeplex.com/"&gt;StackHash&lt;/a&gt;. A minidump can be generated manually for a live application using a debugger or by loading Task Manager, right clicking the application and selecting &lt;em&gt;Create Dump File&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;You can analyze the structure of a dump file using the dumpchk.exe utility that comes with &lt;em&gt;Debugging Tools for Windows&lt;/em&gt; by simply opening an MSDOS prompt in the folder containing the minidump and typing:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;dumpchk -v some.mdmp &amp;gt;log.txt&lt;br/&gt;notepad log.txt&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Much of the detailed structure of the minidump file can be found in the header files ImageHlp.h and dbghelp.h which are installed as part of the Windows SDK. A full description of all fields can be found in the DbgHelp API documentation. Other resources include the toolhelp API and the ApplicationVerifier help.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll update this blog over time as I discover anything non-obvious about the stream data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Minidump header file&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The file starts with a header section (_MINIDUMP_HEADER) identifying the contents of the file. A dump file contains a number of Streams of data. Each Stream contains a particular type of information as follows.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;ThreadListStream(3) - Identifies the threads that were alive in the application at the time of the crash.&lt;/li&gt;
&lt;li&gt;ModuleListStream(4) - List of modules (DLLs and EXEs) that were loaded in the address space of the application.&lt;/li&gt;
&lt;li&gt;MemoryListStream(5) - Dump of various parts of memory that existed at the time of the crash.&lt;/li&gt;
&lt;li&gt;ExceptionStream(6) - Contains information about the exception that occurred in the application (if any).&lt;/li&gt;
&lt;li&gt;SystemInfoStream(7) - Contains information about the machine on which the application was running.&lt;/li&gt;
&lt;li&gt;ThreadExListStream(8) - Similar to the ThreadListStream but contains BackingStore information (Intel Itanium only).&lt;/li&gt;
&lt;li&gt;Memory64ListStream(9) - Memory blocks from a 64 bit machine.&lt;/li&gt;
&lt;li&gt;CommentStreamA(10) - ANSI string describing the dump.&lt;/li&gt;
&lt;li&gt;CommentStreamW(11) - UNICODE string describing the dump.&lt;/li&gt;
&lt;li&gt;HandleDataStream(12) - Contains additional information about system level handles for processes, threads and mutants.&lt;/li&gt;
&lt;li&gt;FunctionTableStream(13) - Contatins a number of function tables each describing 1 or more functions.&lt;/li&gt;
&lt;li&gt;UnloadedModuleListStream(14) - Includes a list of modules that were recently unloaded, if this information is maintained by the operating system.&lt;/li&gt;
&lt;li&gt;MiscInfoStream(15) - Contains general system wide information such as process up time, processor information and timezone.&lt;/li&gt;
&lt;li&gt;MemoryInfoListStream(16) - Contains memory region description information. It corresponds to the information that would be returned for the process from the VirtualQuery function.&lt;/li&gt;
&lt;li&gt;ThreadInfoListStream(17) - Contains thread state information.&lt;/li&gt;
&lt;li&gt;HandleOperationListStream(18) - Contains a list of operations performed on selected OS handles.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;An example header and stream directory is shown below.&lt;/p&gt;
&lt;p&gt;Minidump Header&lt;br/&gt;===========&lt;br/&gt;Signature: MDMP&lt;br/&gt;Version: A793(5128)&lt;br/&gt;Number of Streams: 9&lt;br/&gt;Stream RVA: 20&lt;br/&gt;Checksum: 0&lt;br/&gt;TimeDateStamp/Reserved: 4B7CD4F6&lt;br/&gt;Flags: 21&lt;br/&gt;(00000001) MiniDumpWithDataSegs &lt;br/&gt;(00000020) MiniDumpWithUnloadedModules&lt;/p&gt;
&lt;p&gt;Stream Directory&amp;#8230;&lt;br/&gt;Stream 0: type ThreadListStream (3), size 00000394, RVA 00000184&lt;br/&gt;Stream 1: type ModuleListStream (4), size 00002818, RVA 00000518&lt;br/&gt;Stream 2: type UnloadedModuleListStream (14), size 000000CC, RVA 00002D30&lt;br/&gt;Stream 3: type MemoryListStream (5), size 00000154, RVA 00009B22&lt;br/&gt;Stream 4: type ExceptionStream (6), size 000000A8, RVA 000000DC&lt;br/&gt;Stream 5: type SystemInfoStream (7), size 00000038, RVA 0000008C&lt;br/&gt;Stream 6: type MiscInfoStream (15), size 00000018, RVA 000000C4&lt;br/&gt;Stream 7: type UnusedStream (0), size 00000000, RVA 00000000&lt;br/&gt;Stream 8: type UnusedStream (0), size 00000000, RVA 00000000&lt;/p&gt;
&lt;p&gt;The following sections describe some of the main stream types in more detail.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ThreadListStream(3) and ThreadExListStream(8)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The ThreadList stream identifies the threads that were alive in the application at the time of the crash. A thread is the basic unit that is scheduled by the operating system (OS). An application may have 1 or more threads. The OS allocates processor time for each thread to run in turn depending on its priority. Each thread has:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;ThreadId - Uniquely identifes the thread.&lt;/li&gt;
&lt;li&gt;SuspendCount - Indicates whether the thread is suspended (a number greater than 0 indicates it is).&lt;/li&gt;
&lt;li&gt;PriorityClass - Determines the system wide scheduling priority class of the thread (IDLE, BELOW_NORMAL, NORMAL, ABOVE_NORMAL, HIGH, REALTIME) and is specified as a thread behaviour requirement when the thread is created.&lt;/li&gt;
&lt;li&gt;Priority - Within a process, threads can be given different priorities. e.g. a user input thread might be given a higher priority than a computationally intensive thread so that the latter doesn&amp;#8217;t make user input unresponsive for long periods. (IDLE, LOWEST, BELOW_NORMAL, NORMAL, ABOVE_NORMAL, HIGHEST, TIME_CRITICAL).&lt;/li&gt;
&lt;li&gt;Thread Environment Block (TEB) - Contains per-thread context information used by the Windows components running in user mode (e.g. Windows subsystem and the Application Image Loader). This field contains the address of the TEB (as opposed to its contents). A typical value is 0x7FFDF000.&lt;/li&gt;
&lt;li&gt;Stack - Start address on the stack as well as the location of the stack information in the file.&lt;/li&gt;
&lt;li&gt;ThreadContext - Locates the architecture specific thread context data including the thread&amp;#8217;s volatile register contents, stacks and private storage area.&lt;/li&gt;
&lt;li&gt;BackingStore - Only valid for ThreadExListStream. Contains backing store information for the thread on Itanium machines.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The following is an example of the first 2 threads of a thread stream.&lt;/p&gt;
&lt;p&gt;StreamType: ThreadListStream&lt;br/&gt;Location: Length: 394, Rva: 184&lt;br/&gt;NumberOfThreads: 19&lt;br/&gt;RVA: 0188 ThreadId:000003C4 SuspendCount:1 PriorityClass:0 Priority:0 TEB:000000007FFDF000 Stack: (Address: 12F2A8 Length: D58, Rva: E776) ThreadContext: (Length: 2CC, Rva: 5708)&lt;br/&gt;RVA: 01B8 ThreadId:000004EC SuspendCount:1 PriorityClass:0 Priority:0 TEB:000000007FFDE000 Stack: (Address: ABFE38 Length: 1C8, Rva: F4CE) ThreadContext: (Length: 2CC, Rva: 59D4)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ThreadInfoListStream(17)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The ThreadInfoList stream contains dynamic information about threads including information about how long the thread has been running and how much time the thread spent in user and kernel mode.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;ThreadId - Uniquely identifies the thread.&lt;/li&gt;
&lt;li&gt;DumpFlags - Indicates if the thread had exited at the time of the dump. Also defines the progress during the attempt to dump the thread information.&lt;/li&gt;
&lt;li&gt;DumpError - Status of the dump.&lt;/li&gt;
&lt;li&gt;CreateTime - The time when the thread was created, in 100-nanosecond intervals since January 1, 1601 (UTC).&lt;/li&gt;
&lt;li&gt;ExitTime - The time when the thread exited, in 100-nanosecond intervals since January 1, 1601 (UTC).&lt;/li&gt;
&lt;li&gt;KernelTime - The time executed in kernel mode, in 100-nanosecond intervals.&lt;/li&gt;
&lt;li&gt;UserTime - The time executed in user mode, in 100-nanosecond intervals.&lt;/li&gt;
&lt;li&gt;StartAddress - The starting address of the thread.&lt;/li&gt;
&lt;li&gt;Affinity - The processor affinity mask. This is a bit mask indicating the processors that the thread is allowed to run on. This will normally be the same as the owning process and is usually allocated by the OS.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;HandleOperationListStream(18)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Some operating systems can track the last operations performed on a handle. Application Verifier can enable this for some versions of Windows. Application Verifier is a tool that can be downloaded from Microsoft to detect unusual behaviour in native Win32 applications. The recorded information for each handle includes the ProcessId and ThreadId of the thread accessing the handle; the OperationType (Open, Close or BadRef); and the back trace identifying the code addresses that made the access. An example of an open and close operation on a handle is shown below.&lt;/p&gt;
&lt;p&gt;SizeOfHeader: 10&lt;br/&gt;SizeOfEntry: 120&lt;br/&gt;NumberOfEntries: 1000&lt;br/&gt;Reserved: 0&lt;/p&gt;
&lt;p&gt;HeapHandle: B24&lt;br/&gt;ProcessId: 1A5C&lt;br/&gt;ThreadId: 1B94&lt;br/&gt;OperationType: 2-OperationDbCLOSE&lt;br/&gt;Spare0: 0&lt;br/&gt;BackTraceInfo: Depth: 10&lt;br/&gt;Index: 0&lt;br/&gt;ReturnAddresses: FFFFF80002FEB254 FFFFF80002CD6993&amp;#160;7715F7AA 7FEF57D6237&amp;#160;7FEF57D6368&amp;#160;7FEF57DB26C 772086C8&amp;#160;7716ED9A 7714B80D 771444CE 7FEEF1F7048&amp;#160;7FEFD12A4CC 7FEF3325E91&amp;#160;7FEF3326035&amp;#160;7FEF3323596&amp;#160;7FEF706A317&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&lt;/p&gt;
&lt;p&gt;HeapHandle: B24&lt;br/&gt;ProcessId: 1A5C&lt;br/&gt;ThreadId: 1B94&lt;br/&gt;OperationType: 1-OperationDbOPEN&lt;br/&gt;Spare0: 0&lt;br/&gt;BackTraceInfo: Depth: 10&lt;br/&gt;Index: 0&lt;br/&gt;ReturnAddresses: FFFFF80002FDA617 FFFFF80002FE4360 FFFFF80002CD6993&amp;#160;7715FC0A 7FEF57D60DF 7FEF57D6368&amp;#160;7FEF57DB26C 772086C8&amp;#160;7716ED9A 7714B80D 771444CE 7FEEF1F7048&amp;#160;7FEFD12A4CC 7FEF3325E91&amp;#160;7FEF3326035&amp;#160;7FEF3323596&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&amp;#160;0 0&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ModuleListStream(4)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The ModuleList stream contains a list of modules (DLLs and EXEs) that were loaded in the address space of the application. The presence of unrecognised modules, such as viruses or virus checkers that have been injected into the application address space may indicate a problem. The absence of some DLLs may help identify how far the application got in its processing before it failed if delayed loading of DLLs was enabled. The list of modules is used when identifying the instruction addresses contained in other streams. An address lying within the range ImageBase to (ImageBase + ImageSize) means the instruction refers to code in that module. For each module the following information is listed.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;ImageBase - Base address in memory of the image.&lt;/li&gt;
&lt;li&gt;ImageSize - Size of the image.&lt;/li&gt;
&lt;li&gt;Name - Full path and filename of the DLL or EXE file.&lt;/li&gt;
&lt;li&gt;VersionInfo - Full version information for the file including: FileVersion; ProductVersion; OS the file was designed for (e.g. Win32); FileType - e.g. DLL, EXE.&lt;/li&gt;
&lt;li&gt;CheckSum - Hash of bytes in the file.&lt;/li&gt;
&lt;li&gt;TimeStamp - Date and Time of file creation.&lt;/li&gt;
&lt;li&gt;CodeViewRecord - This record may contain a symbol filename (PDB or DBG) and GUID that a debugger can use to locate the correct symbol file matching the binary file. The CodeView data is part of the original DLL or EXE file and is extracted from the Portable Executable - (PE = COFF) format.&lt;/li&gt;
&lt;li&gt;MiscRecord - This contains miscellaneous symbol information.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;An example of module data extracted from the module stream is shown below.&lt;/p&gt;
&lt;p&gt;Base: 7E410000 Size: 91000 Rva: 3098&amp;#160;C:\WINDOWS\system32\user32.dll CheckSum: 8FC76 TimeDateStamp: 4802A11B&lt;br/&gt;FileVersionInfo: &lt;br/&gt;Signature: FEEF04BD&lt;br/&gt;StrucVersion: 1.0&lt;br/&gt;FileVersion: 5.1.2600.5512&lt;br/&gt;ProductVersion: 5.1.2600.5512&lt;br/&gt;FileFlagsMask: 3F&lt;br/&gt;FileFlags: 00&lt;br/&gt;FileOS: 40004 VOS_NT_WINDOWS32&lt;br/&gt;FileType: 2 VFT_DLL&lt;br/&gt;FileSubtype: 0&lt;br/&gt;FileDateMS: 0&lt;br/&gt;FileDateLS: 0&lt;/p&gt;
&lt;p&gt;CodeView record: Length: 23, Rva: 8D91&lt;br/&gt;52&amp;#160;53&amp;#160;44&amp;#160;53 B7&amp;#160;41&amp;#160;8A D1&amp;#160;7F 4E 8C 45 AA AC 18&amp;#160;47 RSDS?A???N?E???G&lt;br/&gt;E2 D8 BF 02&amp;#160;02&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;75&amp;#160;73&amp;#160;65&amp;#160;72&amp;#160;33&amp;#160;32&amp;#160;2E 70&amp;#160;?????????user32.p&lt;br/&gt;64&amp;#160;62&amp;#160;00 db&lt;/p&gt;
&lt;p&gt;CodeView Signature: RSDS&lt;br/&gt;CodeView GUID: B7&amp;#160;41&amp;#160;8A D1&amp;#160;7F 4E 8C 45 AA AC 18&amp;#160;47 E2 D8 BF 02&amp;#160;&lt;br/&gt;CodeView Age: 2&lt;br/&gt;CodeView PDB FileName: user32.pdb&lt;/p&gt;
&lt;p&gt;Misc record: Length: 0, Rva: 0&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UnloadedModuleListStream(14)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Includes a list of modules that were recently unloaded, if this information is maintained by the operating system. For Windows Server 2003 and Windows XP: The operating system does not maintain information for unloaded modules until Windows Server 2003 with SP1 and Windows XP with SP2. An example of the data stored in the UnloadedModuleList is shown below.&lt;/p&gt;
&lt;p&gt;StreamType: UnloadedModuleListStream&lt;br/&gt;Location: Length: CC, Rva: 2D30&lt;br/&gt;NumberOfModules: 8&lt;br/&gt;Base: 78080000-78091000 Size: 11000 NameRva: 5354 MSVCRT40.dll CheckSum: F7C0 TimeDateStamp: 48025155&lt;br/&gt;Base: 747B0000-747F7000 Size: 47000 NameRva: 5372 msnsspc.dll CheckSum: 4D6A9 TimeDateStamp: 4802A16A&lt;br/&gt;&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MemoryListStream(5) and Memory64ListStream(9)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The memory stream contains blocks of memory whose contents might be useful for debugging a crash. They include portions of the stack.&lt;/p&gt;
&lt;p&gt;21 memory ranges&lt;br/&gt;range# RVA Address Size&lt;br/&gt;0&amp;#160;00009C76&amp;#160;7c90e494&amp;#160;00000100&lt;br/&gt;1&amp;#160;00009D76&amp;#160;7c97e000&amp;#160;00004a00&lt;br/&gt;2&amp;#160;0000E776&amp;#160;0012f2a8&amp;#160;00000d58&lt;br/&gt;3&amp;#160;0000F4CE 00abfe38&amp;#160;000001c8&lt;br/&gt;4&amp;#160;0000F696&amp;#160;00c8fcd0&amp;#160;00000330&lt;br/&gt;&amp;#8230;&lt;/p&gt;
&lt;p&gt;StreamType: MemoryListStream&lt;br/&gt;Location: Length: 154, Rva: 9B22&lt;br/&gt;NumberOfMemoryRanges: 21&lt;br/&gt;Address: 7C90E494 Length: 100, Rva: 9C76&lt;br/&gt;C6 EB FF FF EB 0B 5B 59&amp;#160;6A 00&amp;#160;51&amp;#160;53 E8&amp;#160;09 F5 FF&amp;#160;??????[Yj?QS????&lt;br/&gt;FF 83 C4 EC 89&amp;#160;04&amp;#160;24 C7&amp;#160;44&amp;#160;24&amp;#160;04&amp;#160;01&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;89&amp;#160;??????$?D$?????&lt;br/&gt;5C 24&amp;#160;08 C7&amp;#160;44&amp;#160;24&amp;#160;10&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;54 E8&amp;#160;63&amp;#160;00&amp;#160;00 \$?D???T?c&lt;br/&gt;00 C2&amp;#160;08&amp;#160;00&amp;#160;55&amp;#160;8B EC 83 EC 50&amp;#160;89&amp;#160;44&amp;#160;24&amp;#160;0C 64 A1&amp;#160;???U????P?D$?d?&lt;br/&gt;&lt;br/&gt;Address: 7C97E000 Length: 4A00, Rva: 9D76&lt;br/&gt;63&amp;#160;6F 73&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00 cos????????????&lt;br/&gt;6C 6F 67&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00 E0&amp;#160;3F log????????????&lt;br/&gt;70&amp;#160;6F 77&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00 pow???????????&lt;br/&gt;73&amp;#160;69&amp;#160;6E 00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00 sin????????????&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MemoryInfoListStream(16)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This stream contains memory region description information. It corresponds to the information that would be returned for the process from the VirtualQuery function. VirtualQuery retrieves information about a range of pages in the virtual address space of the calling process.&lt;/p&gt;
&lt;p&gt;SizeOfHeader: 10&lt;br/&gt;SizeOfEntry: 30&lt;br/&gt;NumberOfEntries: 8C67&lt;/p&gt;
&lt;p&gt;BaseAddress: 1981000 AllocationBase: 1980000 AllocationProtect: 1(PAGE_NOACCESS) RegionSize: 69000 State: 1000(MEM_COMMIT) Protect: 4(PAGE_READWRITE) Type: 20000(MEM_PRIVATE)&lt;br/&gt;BaseAddress: 10000 AllocationBase: 10000 AllocationProtect: 4(PAGE_READWRITE) RegionSize: 2000 State: 1000(MEM_COMMIT) Protect: 4(PAGE_READWRITE) Type: 20000(MEM_PRIVATE)&lt;br/&gt;BaseAddress: 12000 AllocationBase: 0 AllocationProtect: 0(0) RegionSize: E000 State: 10000(MEM_FREE) Protect: 1(PAGE_NOACCESS) Type: 0(0)&lt;br/&gt;BaseAddress: 40000 AllocationBase: 40000 AllocationProtect: 2(PAGE_READONLY) RegionSize: 2000 State: 1000(MEM_COMMIT) Protect: 2(PAGE_READONLY) Type: 40000(MEM_MAPPED)&lt;br/&gt;BaseAddress: 19EA000 AllocationBase: 1980000 AllocationProtect: 1(PAGE_NOACCESS) RegionSize: 1000 State: 2000(MEM_RESERVE) Protect: 0(0) Type: 20000(MEM_PRIVATE)&lt;br/&gt;&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SystemInfoStream(7)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The SystemInfo stream contains details of the hardware and operating system that the application was running on.&lt;/p&gt;
&lt;p&gt;StreamType: SystemInfoStream&lt;br/&gt;Location: Length: 38, Rva: 8C&lt;br/&gt;ProcessorArchitecture: 0 - PROCESSOR_ARCHITECTURE_INTEL&lt;br/&gt;ProcessorLevel: 15&lt;br/&gt;ProcessorRevision: 20226&lt;br/&gt;NumberOfProcessors: 1&lt;br/&gt;ProductType: 1 - VER_NT_WORKSTATION&lt;br/&gt;Version: 5.1.2600&lt;br/&gt;PlatformId: VER_PLATFORM_WIN32_NT&lt;br/&gt;ServicePack: Service Pack 3&lt;br/&gt;SuiteMask: 300 - VER_SUITE_SINGLEUSERTS, VER_SUITE_PERSONAL&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ExceptionStream(6)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The exception stream contains information about any exception that may have occurred in the application. An exception is a condition that gave rise to an application crash. Inner exceptions may also be present by following the ExceptionRecord field. The ExceptionAddress probably points into one of the modules in the ModuleStream so the exact position of the crash inside the binary file should be determinable.&lt;/p&gt;
&lt;p&gt;StreamType: ExceptionStream&lt;br/&gt;Location: Length: A8, Rva: DC&lt;br/&gt;ThreadId: 3C4&lt;br/&gt;ExceptionCode: CFFFFFFF-Application Hang&lt;br/&gt;ExceptionFlags: 0-EXCEPTION_CONTINUABLE&lt;br/&gt;ExceptionAddress: 7C90E514&lt;br/&gt;ExceptionRecord (InnerException): 0&lt;br/&gt;NumberOfExceptionParams: 0&lt;/p&gt;
&lt;p&gt;Location: Length: 0, Rva: 0&lt;/p&gt;
&lt;p&gt;Common ExceptionCode values include&lt;/p&gt;
&lt;p&gt;EXCEPTION_ACCESS_VIOLATION = 0x0C0000005,&lt;br/&gt;EXCEPTION_ARRAY_BOUNDS_EXCEEDED = 0x0C000008C,&lt;br/&gt;EXCEPTION_BAD_COMPRESSION_BUFFER = 0x0C0000242,&lt;br/&gt;EXCEPTION_BREAKPOINT = 0x080000003,&lt;br/&gt;EXCEPTION_CALLBACK_POP_STACK = 0x0C0000423,&lt;br/&gt;EXCEPTION_DATATYPE_MISALIGNMENT = 0x080000002,&lt;br/&gt;EXCEPTION_FLOAT_DENORMAL_OPERAND = 0x0C000008D,&lt;br/&gt;EXCEPTION_FLOAT_DIVIDE_BY_ZERO = 0x0C000008E,&lt;br/&gt;EXCEPTION_FLOAT_INEXACT_RESULT = 0x0C000008F,&lt;br/&gt;EXCEPTION_FLOAT_INVALID_OPERATION = 0x0C0000090,&lt;br/&gt;EXCEPTION_FLOAT_OVERFLOW = 0x0C0000091,&lt;br/&gt;EXCEPTION_FLOAT_STACK_CHECK = 0x0C0000092,&lt;br/&gt;EXCEPTION_FLOAT_UNDERFLOW = 0x0C0000093,&lt;br/&gt;EXCEPTION_FLOAT_MULTIPLE_FAULTS = 0x0C00002B4,&lt;br/&gt;EXCEPTION_FLOAT_MULTIPLE_TRAPS = 0x0C00002B5,&lt;br/&gt;EXCEPTION_GUARD_PAGE_VIOLATION = 0x080000001,&lt;br/&gt;EXCEPTION_ILLEGAL_FLOAT_CONTEXT = 0x0C000014A,&lt;br/&gt;EXCEPTION_ILLEGAL_INSTRUCTION = 0x0C000001D,&lt;br/&gt;EXCEPTION_INSTRUCTION_MISALIGNMENT = 0x0C00000AA,&lt;br/&gt;EXCEPTION_INVALID_HANDLE = 0x0C0000008,&lt;br/&gt;EXCEPTION_INVALID_LOCK_SEQENCE = 0x0C000001E,&lt;br/&gt;EXCEPTION_INVALID_OWNER = 0x0C000005A,&lt;br/&gt;EXCEPTION_INVALID_PARAMETER = 0x0C000000D,&lt;br/&gt;EXCEPTION_INVALID_PARAMETER_1 = 0x0C00000EF,&lt;br/&gt;EXCEPTION_INVALID_SYSTEM_SERVICE = 0x0C000001C,&lt;br/&gt;EXCEPTION_INVALID_THREAD = 0x0C000071C,&lt;br/&gt;EXCEPTION_INTEGER_DIVIDE_BY_ZERO = 0x0C0000094,&lt;br/&gt;EXCEPTION_INTEGER_OVERFLOW = 0x0C0000095,&lt;br/&gt;EXCEPTION_IN_PAGE_ERROR = 0x0C0000006,&lt;br/&gt;EXCEPTION_KERNEL_APC = 0x00100,&lt;br/&gt;EXCEPTION_LONGJUMP = 0x080000026,&lt;br/&gt;EXCEPTION_NO_CALLBACK_ACTIVE = 0x0C0000258,&lt;br/&gt;EXCEPTION_NO_EVENT_PAIR = 0x0C000014E,&lt;br/&gt;EXCEPTION_PRIVILEGED_INSTRUCTION = 0x0C0000096,&lt;br/&gt;EXCEPTION_SINGLE_STEP = 0x080000004,&lt;br/&gt;EXCEPTION_STACK_BUFFER_OVERRUN = 0xC0000409,&lt;br/&gt;EXCEPTION_STACK_OVERFLOW = 0xC00000FD,&lt;br/&gt;EXCEPTION_SUCCESS = 0x00000,&lt;br/&gt;EXCEPTION_THREAD_IS_TERMINATING = 0x0C000004B,&lt;br/&gt;EXCEPTION_TIMEOUT = 0x00102,&lt;br/&gt;EXCEPTION_UNWIND = 0x0C0000027,&lt;br/&gt;EXCEPTION_UNWIND_CONSOLIDATE = 0x080000029,&lt;br/&gt;EXCEPTION_USER_APC = 0x000C0,&lt;br/&gt;EXCEPTION_WAKE_SYSTEM_DEBUGGER = 0x080000007,&lt;br/&gt;EXCEPTION_APPLICATION_HANG = 0xcfffffff,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CommentStreamA(10) and CommentStreamW(11)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;These stream contains a string used for documentation purposes. For CommentStreamA, this is an ANSI string and for CommentStreamW this is a Unicode (double byte) string.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;HandleDataStream(12)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A handle is a pointer to a data structure containing information about a consumed system resource such as a process, thread, registry key, event and mutant. The Handle stream, if present, contains data associated with these high level system handles. The HandleId, TypeName, ObjectName, Attributes, GrantedAccess, HandleCount and PointerCount are stored for each handle. Most of these fields are specific to the type of handle that is being stored.&lt;/p&gt;
&lt;p&gt;Extended object information may also exist for a handle. The extended information may be present for threads, mutants and process handles. This data varies depending on the architecture of the machine. More than 1 extended block may exist for each handle as shown in the example below.&lt;/p&gt;
&lt;p&gt;StreamType: HandleDataStream&lt;br/&gt;Location: Length: 7B8, Rva: B44AAC&lt;br/&gt;SizeOfHeader: 10&lt;br/&gt;SizeOfDescriptor: 28&lt;br/&gt;NumberOfDescriptors: 31&lt;br/&gt;Reserved: 0&lt;/p&gt;
&lt;p&gt;Handle: 4&lt;br/&gt;TypeNameRva: B44000&lt;br/&gt;TypeName: Key&lt;br/&gt;ObjectNameRva: B4400C&lt;br/&gt;ObjectName: \REGISTRY\MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options&lt;br/&gt;Attributes: 0&lt;br/&gt;GrantedAccess: 9&lt;br/&gt;HandleCount: 2&lt;br/&gt;PointerCount: 3&lt;/p&gt;
&lt;p&gt;Handle: 40&lt;br/&gt;TypeNameRva: B443EE&lt;br/&gt;TypeName: Mutant&lt;br/&gt;ObjectNameRva: 0&lt;br/&gt;ObjectName: &lt;br/&gt;Attributes: 0&lt;br/&gt;GrantedAccess: 1F0001&lt;br/&gt;HandleCount: 2&lt;br/&gt;PointerCount: 3&lt;br/&gt;Next: B44400 InfoType: 3-MiniMutantInformation2 SizeOfInfo: 8&lt;br/&gt;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;????????&lt;/p&gt;
&lt;p&gt;Next: 0 InfoType: 2-MiniMutantInformation1 SizeOfInfo: 8&lt;br/&gt;01&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;00&amp;#160;47&amp;#160;00 G???????&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;FunctionTableStream(13)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The function table stream contains a number of function tables, one for each module. Each function table contains one or more function entry.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MiscInfoStream(15)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The MiscInfo contains miscellaneous information pertaining mainly to the process and processor. The amount of information stored has changed over time so different OS&amp;#8217;s may contain different information. Information includes&amp;#8230;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;ProcessId - ID of the crashing process.&lt;/li&gt;
&lt;li&gt;ProcessCreationTime - Time the process was started.&lt;/li&gt;
&lt;li&gt;ProcessUserTime - Time the process (all of its threads) has spent running user mode code.&lt;/li&gt;
&lt;li&gt;ProcessKernelTime - Time the process (all of its threads) has spent running kernel mode code.&lt;/li&gt;
&lt;li&gt;ProcessorMaxMhz - The maximum specified clock frequency of the system processor.&lt;/li&gt;
&lt;li&gt;ProcessorCurrentMhz - The processor clock frequency, in MHz. This number is the maximum specified processor clock frequency multiplied by the current processor throttle.&lt;/li&gt;
&lt;li&gt;ProcessorMhzLimit - The limit on the processor clock frequency, in MHz. This number is the maximum specified processor clock frequency multiplied by the current processor thermal throttle limit.&lt;/li&gt;
&lt;li&gt;ProcessorMaxIdleState - The maximum idle state of the processor.&lt;/li&gt;
&lt;li&gt;ProcessorCurrentIdleState - The current idle state of the processor.&lt;/li&gt;
&lt;li&gt;ProcessIntegrityLevel - (low,medium,high,system). Lower integrity programs have more limited access to the file system and other system resources.&lt;/li&gt;
&lt;li&gt;ProcessExecuteFlags -&lt;/li&gt;
&lt;li&gt;ProtectedProcess - The process is to be run as a protected process. The system restricts access to protected processes and the threads of protected processes.&lt;/li&gt;
&lt;li&gt;TimeZoneId and TimeZoneInformationTimeZone - under which the machine is running.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;br/&gt;An example Misc information sections follows&amp;#8230;&lt;/p&gt;
&lt;p&gt;StreamType: MiscInfoStream&lt;br/&gt;Location: Length: 18, Rva: C4&lt;br/&gt;SizeOfInfo: 18&lt;br/&gt;ValidFieldFlags: 3-MINIDUMP_MISC1_PROCESS_ID, MINIDUMP_MISC1_PROCESS_TIMES&lt;br/&gt;ProcessId: 394&lt;br/&gt;ProcessCreateTime: 4B7CD46A&lt;br/&gt;ProcessUserTime: 0&lt;br/&gt;ProcessKernelTime: 1&lt;/p&gt;</description><link>http://infopurge.tumblr.com/post/10445418822</link><guid>http://infopurge.tumblr.com/post/10445418822</guid><pubDate>Tue, 20 Sep 2011 17:53:00 +0100</pubDate></item><item><title>Setting up a Source Server</title><description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In order to effectively debug dump files from end users, it is necessary to have access to product symbols. Product symbols are generated during the product build and are normally contained in PDB (or DBG) files. When using a debugger to analyze a dump file, a PDB matching the exact version of the binary file (DLL or EXE) is required.&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;The PDB must contain additional information in order to access the correct version of source files for source level debugging. This extra source code version information is contained in a data Stream called “srcsrv” within the PDB and must be added as an additional step after the main build is complete. This additional step is called Source Indexing.&lt;/p&gt;
&lt;p&gt;A full description of source indexing can be found in the srcsrv.doc in the srcsrv subfolder of Debugging Tools for Windows. This blog summarises the main steps required to set up source debugging.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configuring the Build Environment&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The following components must be installed on the build machines.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Debugging Tools for Windows. Install the latest version that is available (&lt;a title="http://msdn.microsoft.com/en-us/windows/hardware/gg463009" target="_blank" href="http://msdn.microsoft.com/en-us/windows/hardware/gg463009"&gt;&lt;a href="http://msdn.microsoft.com/en-us/windows/hardware/gg463009" target="_blank"&gt;http://msdn.microsoft.com/en-us/windows/hardware/gg463009&lt;/a&gt;&lt;/a&gt;). This contains the actual source indexing tools in a \srcsrv subfolder of the installation folder.&lt;/li&gt;
&lt;li&gt;Perl 5.6 or above. Some of the source indexing tools are written in Perl and thus require a version of Perl to be installed. See &lt;a target="_blank" href="http://www.perl.org/"&gt;&lt;a href="http://www.perl.org" target="_blank"&gt;http://www.perl.org&lt;/a&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Set the PATH environment variable to include the \srcsrv subfolder of the Debugging Tools for Windows installation folder e.g. C:\Program Files\Debugging Tools for Windows (x64)\srcsrv.&lt;/li&gt;
&lt;li&gt;Set the PATH environment variable to include the Perl installation folder (if not already done by the installer).&lt;/li&gt;
&lt;li&gt;Copy the file srcsrv.ini from the \srcsrv subfolder to a common location (company network share or folder containing the project build files) where it can be accessed by the build scripts and edit it to include a line in the [variables] section for your source control system. e.g.&lt;/li&gt;
&lt;/ol&gt;&lt;blockquote&gt;
&lt;pre&gt;[variables]







MYSERVER=sourcecontrolmachine:1666.



&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Build Changes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The following diagram shows the main components required during a build.&lt;/p&gt;
&lt;p&gt; &lt;img src="http://media.tumblr.com/tumblr_lrtotzAgPE1r0dgwn.jpg" width="520" height="339"/&gt;&lt;/p&gt;
&lt;p&gt;Running msbuild on an automated build file (e.g. mybuild.proj) will at some stage invoke the linker to produce the product binary and symbol files (e.g. myapp.exe and myapp.pdb) in one or more output folders, usually based on build configuration. e.g. c:\myproduct\debug and c:\myproduct\release.&lt;/p&gt;
&lt;p&gt;A new target needs to be added to mybuild.proj to call the Source Indexing utility (ssindex.cmd) with parameters particular to your source control system (e.g. Perforce, SourceSafe etc…). e.g. for Perforce the new target might look something like this.&lt;/p&gt;
&lt;pre&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;Target&lt;/span&gt; &lt;span&gt;Name&lt;/span&gt;&lt;span&gt;="SourceIndexing” DependsOnTargets="&lt;/span&gt;&lt;span&gt;ProductBuild&lt;/span&gt;"&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;Message&lt;/span&gt; &lt;span&gt;Text&lt;/span&gt;&lt;span&gt;="Source indexing pdb files"&lt;/span&gt;&lt;span&gt;/&amp;gt;&lt;/span&gt; &lt;br/&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;Exec&lt;/span&gt; &lt;span&gt;Command&lt;/span&gt; = &lt;span&gt;"ssindex.cmd /ini=r:\srcsrv.ini /source=r:\ /symbols=&lt;br/&gt; r:\ProductOut\$(Configuration) /debug /system=p4 /dieonerror"&lt;/span&gt;&lt;span&gt;/&amp;gt;&lt;/span&gt; &lt;br/&gt;&lt;span&gt;&amp;lt;/&lt;/span&gt;&lt;span&gt;Target&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;The target must depend on the main product build so it doesn’t get executed until the main build is complete.&lt;/li&gt;
&lt;li&gt;If the product contains a number of output folders then the ssindex.cmd command can be called multiple times.&lt;/li&gt;
&lt;li&gt;The /ini option points to the network share containing the srcsrv.ini file containing the master list of source control systems and their location.&lt;/li&gt;
&lt;li&gt;The /symbols option should point to the folder containing the build symbol files (PDB).&lt;/li&gt;
&lt;li&gt;The /system option specifies the source control system in use. In this case P4 for Perforce.&lt;/li&gt;
&lt;li&gt;The /source option should point to the top of the source code tree on the local machine.&lt;/li&gt;
&lt;li&gt;Type ssindex.cmd –?? for help with other options.&lt;/li&gt;
&lt;li&gt;The /Debug switch should always be used as ssindex.cmd can otherwise fail to index PDBs without providing any error or warning messages (for example if your Perforce workspace includes forward slashes indexing will fail and with debug output enabled you&amp;#8217;ll see a &amp;#8220;&lt;em&gt;zero source files found&lt;/em&gt;&amp;#8221; message).&lt;/li&gt;
&lt;li&gt;Source code indexing varies by source control provider and so you will need to review the documentation and the command line help from ssindex.cmd to tune your settings.&lt;/li&gt;
&lt;li&gt;By default, the source indexing tool adds an entry to the PDB for each source file. This entry contains the version number of the file used to build the component. This is taken from the source control system as the latest version of that file that has been checked in. The PDB can be marked with a LABEL rather than a specific file version by using the /label switch. Note that the label must exist for this to work. See the section below on labelling for more information.&lt;/li&gt;
&lt;li&gt;Important Note: Source Indexing with Source Safe only works with labels, so you must label the source before source indexing. See labelling section below.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Ssindex.cmd produces output as follows…&lt;/p&gt;
&lt;pre&gt;ssindex.cmd [STATUS] : Server ini file: r:\srcsrv.ini 



ssindex.cmd [STATUS] : Source root    : r:\ 



ssindex.cmd [STATUS] : Symbols root   : r:\ProductOut\Debug 



ssindex.cmd [STATUS] : Control system : P4 



ssindex.cmd [STATUS] : P4 program name: p4.exe 



ssindex.cmd [STATUS] : P4 Label       : &amp;lt;N/A&amp;gt; 



ssindex.cmd [STATUS] : Old path root  : &amp;lt;N/A&amp;gt; 



ssindex.cmd [STATUS] : New path root  : &amp;lt;N/A&amp;gt; 



ssindex.cmd [STATUS] : Partial match  : Not enabled 



-------------------------------------------------------------------------------- 



ssindex.cmd [STATUS] : Running... this will take some time...   



ssindex.cmd [INFO  ] : ... indexing r:\ProductOut\Debug\MyApp.pdb 



ssindex.cmd [INFO  ] : ... wrote C:\Users\Me\AppData\Local\Temp\



index16A62.stream to r:\ProductOut\Debug\MyApp.pdb ...&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;SrcTool for testing.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can use srctool.exe (from Debugging Tools for Windows) to test that the PDBs are in fact correctly set up with source file version information.&lt;/p&gt;
&lt;p&gt;Type srctool –d:c:\src &amp;lt;pdbfilename&amp;gt; to see a list of source files and their version numbers. A line similar to the one that follows will be displayed for each indexed source file. The output is in 2 parts: the original filename (r:\MyApp\main.cs); and the command that is to be run on the source control system to get the specified version (in this case Perforce). The –o switch specifies the output path where the source file is to be copied. You can override this on the command line (as I have) with the –d option. The –q switch requests a particular version of the file from source control. Note that this is the command for Perforce and that for other source control systems the command will be different, but essentially it will contain an output location and required version.&lt;/p&gt;
&lt;p&gt;[r:\MyApp\main.cs] cmd: p4.exe -p myserver:1666 print -o &amp;#8220;c:\src\P4SERVER\depot\MyApp\main.cs\2\main.cs&amp;#8221; -q &amp;#8220;//depot/MyApp/main.cs#2&amp;#8221;&lt;/p&gt;
&lt;p&gt;To test the source indexing is correct you can extract the files with the –x option. e.g. srctool –x –d:c:\src &amp;lt;pdbfilename&amp;gt; will extract the source code to subfolders of c:\src. This will produce output like this (note that c:\src must exist) where version 4 of main.cs has been copied from source control.&lt;/p&gt;
&lt;pre&gt;c:\src\P4SERVER\depot\MyApp\main.cs\4\main.cs







MyApp.pdb: 1 source files were extracted&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Using Labels&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The ssindex.cmd defaults to updating the PDB with the latest version of the file that has been checked in to source control. i.e. if the PDB contains a filename r:\MyApp\main.cs as a listed source file, then //depot/MyApp/main.cs#2 might be added to the PDB indicating that version 2 of the file was used to build the product.&lt;/p&gt;
&lt;p&gt;However, source control systems often allow labelling of the source tree. If the build process labels the source tree then you can use the /label switch to add the label to the PDB for that file instead of the file version number. Note that the label must exist. In this case SrcTool outputs something like…&lt;/p&gt;
&lt;p&gt;[r:\MyProduct\main.cs] cmd: p4.exe -p myserver:1666 print -o &amp;#8220;c:\src\P4SERVER\depot\MyProduct\main.cs\MyLabel1.2.3.4\&lt;span&gt;AtomCab.cs&amp;#8221; -q &lt;/span&gt;&lt;span&gt;//depot/MyProduct/main.cs@MyLabel1.2.3.4&lt;/span&gt;]&lt;/p&gt;
&lt;p&gt;If the same build file is used on developer machines and the release build machine, the project files should be set up to use version numbers on developer machines and labelling on the main build machine. This assumes that the labelling of source code only takes place during a build of a release candidate.&lt;/p&gt;
&lt;p&gt;Important Note: Source Indexing with Source Safe only works with labels, so you must label the source prior to source indexing if you are using Source Safe.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Source Level Debugging&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When performing debugging on a dump file using Visual Studio, Windbg or cdb, the debugger will locate the correct binary and pdb files from your local symbol server or network share based on the symbol path and binary paths that have been configured.&lt;/p&gt;
&lt;p&gt;To tell the debugger to retrieve the correct source files, add “SRV*c:\source” to the source path (.srcpath or environment variable _NT_SOURCE_PATH).&lt;/p&gt;
&lt;p&gt;For Visual Studio, click Tools -&amp;gt; Options -&amp;gt; Debugging -&amp;gt; General and tick “Enable Source Server Support”.&lt;/p&gt;
&lt;p&gt;The debugger will then call into the source server DLL (srcsrv.dll) to extract the correct source files from your source control system to a local cache folder (c:\source) based on the source index information contained in the PDB. i.e. the PDB will be downloaded first; the PDB srcsrv stream data is then extracted and passed to srcsrv.dll by the debugger; and then srcsrv.dll is called again for each PDB to get the correct source files from the appropriate source control system (remember the PDB contains the command required to extract the appropriate version from source control).&lt;/p&gt;
&lt;p&gt;For automated processing of WinQual errors see the &lt;a title="StackHash in CodePlex" target="_blank" href="http://stackhash.codeplex.com/"&gt;StackHash Open Source project&lt;/a&gt;.&lt;/p&gt;</description><link>http://infopurge.tumblr.com/post/10441052096</link><guid>http://infopurge.tumblr.com/post/10441052096</guid><pubDate>Tue, 20 Sep 2011 14:18:00 +0100</pubDate><category>debugging</category><category>source server</category><category>windbg</category><category>pdb</category></item><item><title>Debugging a managed dump file with sos and psscor.</title><description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The debuggers that come for free with Debugging Tools for Windows are native code debuggers. Out of the box, they don&amp;#8217;t understand managed code or the Common Language Runtime (CLR) internal data structures.&lt;/p&gt;
&lt;p&gt;In the early days of .NET, Microsoft developed a debugger extension DLL they called Strike to aid debugging the .NET framework and CLR. This DLL was originally intended for internal use within Microsoft. However, they soon realized that it would be invaluable as a debugging aid for the wider .NET programming community, so they changed its name to Son Of Strike (SOS.DLL) and released it as part of the CLR binary distribution.&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;SOS.DLL is closely tied to another DLL (mscordacwks.dll) that provides the data access (DAC) layer to the CLR. Mscordacwks.dll abstracts the internal workings of the CLR and its data structures into a more consistent interface.&lt;/p&gt;
&lt;p&gt;In the following sections it is assumed that you have the debugger symbol and binary paths set up to include the Microsoft public symbol server. &lt;br/&gt;e.g. SRV*c:\localstore*http://msdl.microsoft.com/download/symbols&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;.NET and CLR Versions&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There is some confusion surrounding the difference between the CLR and .NET Framework versions. The CLR is the basic core engine that provides the virtual environment in which .NET framework applications are compiled and executed. The .NET framework is a collection of higher level object libraries that are used to simplify the programming task: e.g. LINQ, WCF, WPF, etc&amp;#8230;&lt;/p&gt;
&lt;p&gt;A new release of the .NET framework adds new layers of objects but is not always accompanied by a new release of the CLR, although a patch of the existing CLR version may be necessary to support a new framework release. The following table identifies the main .NET releases to date and the corresponding version of the CLR that they are built upon.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Framework &amp;#8212; Date &amp;#8212; CLR Version &amp;#8212; CLR DLL&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1.0       2002-02-13     1.0  mscorwks.dll&lt;/p&gt;
&lt;p&gt;1.1       2003-04-24     1.0  mscorwks.dll&lt;/p&gt;
&lt;p&gt;2.0       2005-11-07     2.0  mscorwks.dll&lt;/p&gt;
&lt;p&gt;3.0       2006-11-06     2.0  mscorwks.dll&lt;/p&gt;
&lt;p&gt;3.5       2007-11-19     2.0  mscorwks.dll&lt;/p&gt;
&lt;p&gt;4.0       2010-04-12     4.0  clr.dll&lt;/p&gt;
&lt;p&gt;As you can see, Framework versions 2.0, 3.0 and 3.5 all utilize the 2.0 CLR contained primarily in mscorwks.dll. Framework version 4.0 uses the version 4.0 CLR contained principally in clr.dll.&lt;/p&gt;
&lt;p&gt;You can therefore identify the version(s) of the CLR loaded in a dump file using the &lt;em&gt;list modules&lt;/em&gt; command &lt;strong&gt;&lt;em&gt;lm&lt;/em&gt;&lt;/strong&gt;. &lt;br/&gt;e.g.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;lm v m mscorwks&lt;/em&gt; &lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;start end module name &lt;br/&gt;000007fe`f0170000&amp;#160;000007fe`f0b1e000 mscorwks (deferred) &lt;br/&gt;Image path: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll &lt;br/&gt;Image name: mscorwks.dll &lt;br/&gt;Timestamp: Sat Feb 05&amp;#160;02:55:00&amp;#160;2011 (4D4CBC04) &lt;br/&gt;CheckSum: 009A0D7A &lt;br/&gt;ImageSize: 009AE000&amp;#160;&lt;br/&gt;File version: 2.0.50727.4959&amp;#160;&lt;br/&gt;Product version: 2.0.50727.4959&amp;#160;&lt;br/&gt;File flags: 0 (Mask 3F) &lt;br/&gt;File OS: 4 Unknown Win32&amp;#160;&lt;br/&gt;File type: 2.0 Dll &lt;br/&gt;File date: 00000000.00000000&amp;#160;&lt;br/&gt;Translations: 0409.04b0&amp;#160;&lt;br/&gt;CompanyName: Microsoft Corporation &lt;br/&gt;ProductName: Microsoft® .NET Framework &lt;br/&gt;InternalName: mscorwks.dll &lt;br/&gt;OriginalFilename: mscorwks.dll &lt;br/&gt;ProductVersion: 2.0.50727.4959&amp;#160;&lt;br/&gt;FileVersion: 2.0.50727.4959 (win7RTMGDR.050727-4900) &lt;br/&gt;FileDescription: Microsoft .NET Runtime Common Language Runtime - WorkStation &lt;br/&gt;LegalCopyright: © Microsoft Corporation. All rights reserved. &lt;br/&gt;Comments: Flavor=Retail&lt;/p&gt;
&lt;p&gt;or for CLR version 4.0&lt;/p&gt;
&lt;p&gt;&lt;em&gt;lm v m clr&lt;strong&gt; &lt;br/&gt;&lt;/strong&gt;&lt;/em&gt;start end module name &lt;br/&gt;000007fe`e8760000&amp;#160;000007fe`e90c6000 clr (deferred) &lt;br/&gt;Image path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll &lt;br/&gt;Image name: clr.dll &lt;br/&gt;Timestamp: Thu Feb 10&amp;#160;04:21:10&amp;#160;2011 (4D5367B6) &lt;br/&gt;CheckSum: 0095F083&amp;#160;&lt;br/&gt;ImageSize: 00966000&amp;#160;&lt;br/&gt;File version: 4.0.30319.225&amp;#160;&lt;br/&gt;Product version: 4.0.30319.225&amp;#160;&lt;br/&gt;File flags: 8 (Mask 3F) Private &lt;br/&gt;File OS: 4 Unknown Win32&amp;#160;&lt;br/&gt;File type: 2.0 Dll &lt;br/&gt;File date: 00000000.00000000&amp;#160;&lt;br/&gt;Translations: 0409.04b0&amp;#160;&lt;br/&gt;CompanyName: Microsoft Corporation &lt;br/&gt;ProductName: Microsoft® .NET Framework &lt;br/&gt;InternalName: clr.dll &lt;br/&gt;OriginalFilename: clr.dll &lt;br/&gt;ProductVersion: 4.0.30319.225&amp;#160;&lt;br/&gt;FileVersion: 4.0.30319.225 (RTMGDR.030319-2200) &lt;br/&gt;PrivateBuild: DDBLD252&amp;#160;&lt;br/&gt;FileDescription: Microsoft .NET Runtime Common Language Runtime - WorkStation &lt;br/&gt;LegalCopyright: © Microsoft Corporation. All rights reserved. &lt;br/&gt;Comments: Flavor=Retail&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Loading SOS.DLL&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We have seen in the previous section that the CLR will already be listed as a loaded module in a managed dump. To perform managed debugging, SOS.DLL must now be loaded manually using the .load command. However, SOS.dll is tightly bound to a particular version of mscordacwks.dll and mscorwk.dll. This means that the version of SOS.DLL matching the exact version of MSCORWKS.DLL (or CLR.DLL for version 4.0), that is already loaded in the dump file, is required.&lt;/p&gt;
&lt;p&gt;If the source of the dump file can be contacted, then the required .NET CLR DLLs (SOS.DLL and MSCORDACWKS.DLL), can be copied from that machine. If not, then you are pretty much out of luck unless you happen to have a machine with the same version of .NET installed already. Alternatively, you can build up a library of .NET versions for debugging by installing the earliest version of .NET you are interested in and then applying patch after patch from the Microsoft download site.&lt;/p&gt;
&lt;p&gt;When you attempt to load a version of SOS.DLL into the debugger by using the .load c:\dotnetversions&amp;#46;..\sos.dll command, the debugger will load sos.dll which will then attempt to find the correct version of mscordacwks.dll and consequently mscorwks.dll. If this does not match the version of mscorwks.dll already loaded in the dump file, then the debugger will output an error such as that shown below.&lt;/p&gt;
&lt;p&gt;Failed to load data access DLL, 0x80004005&amp;#160;&lt;br/&gt;Verify that&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;you have a recent build of the debugger (6.2.14 or newer)&lt;/li&gt;
&lt;li&gt;the file mscordacwks.dll that matches your version of mscorwks.dll is &lt;br/&gt;in the version directory&lt;/li&gt;
&lt;li&gt;or, if you are debugging a dump file, verify that the file &lt;br/&gt;mscordacwks_&amp;lt;arch&amp;gt;_&amp;lt;arch&amp;gt;_&amp;lt;version&amp;gt;.dll is on your symbol path.&lt;/li&gt;
&lt;li&gt;you are debugging on the same architecture as the dump file. &lt;br/&gt;For example, an IA64 dump file must be debugged on an IA64&amp;#160;&lt;br/&gt;machine.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;You can also run the debugger command .cordll to control the debugger&amp;#8217;s &lt;br/&gt;load of mscordacwks.dll. .cordll -ve -u -l will do a verbose reload. &lt;br/&gt;If that succeeds, the SOS command should work on retry.&lt;/p&gt;
&lt;p&gt;If you are debugging a minidump, you need to make sure that your executable &lt;br/&gt;path is pointing to mscorwks.dll as well.&lt;/p&gt;
&lt;p&gt;This tight link between SOS and the CLR makes debugging dump files using SOS quite frustrating&amp;#8230; step in psscor.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Psscor&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Psscor contains a superset of commands from sos.dll. However, its biggest benefit is that the matching up of precise versions with the CLR, as for SOS.DLL, is no longer necessary. Psscor comes in 2 versions matching the CLR MAJOR version number.&lt;/p&gt;
&lt;p&gt;psscor2.dll - used to debug all CLR 2.0 versions (i.e. framework 2, 3 and 3.5) for x86, AMD64 and IA64. &lt;br/&gt;psscor4.dll - used to debug all CLR 4.0 versions (i.e. framework 4.0) for x86 and AMD64.&lt;/p&gt;
&lt;p&gt;AMD64 is used for Intel x64 debugging.&lt;/p&gt;
&lt;p&gt;As stated above, the version of the CLR loaded in the dump file can be determined using the lm command. To determine the architecture of the target machine you can use the vertarget command. The example below shows a x64 dump.&lt;/p&gt;
&lt;p&gt;vertarget &lt;br/&gt;Windows 7 Version 7600 MP (8 procs) Free &lt;strong&gt;x64&amp;#160;&lt;br/&gt;&lt;/strong&gt;Product: WinNt, suite: SingleUserTS &lt;br/&gt;kernel32.dll version: 6.1.7600.16385 (win7_rtm.090713-1255)&lt;/p&gt;
&lt;p&gt;Now, all that is necessary is to load either psscor2.dll or psscor4.dll from the appropriate architecture install folder e.g.&lt;/p&gt;
&lt;p&gt;.load c:\psscor\psscor4\x64\psscor4.dll&lt;/p&gt;
&lt;p&gt;and then managed debugging can start.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;StackHash and Psscor&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;StackHash is an &lt;a title="StackHash in CodePlex" target="_blank" href="http://stackhash.codeplex.com/"&gt;open source&lt;/a&gt; project that allows you to create debugger scripts that are run automatically (or not) on dumps downloaded from WinQual. As of version 1.20, StackHash now automatically locates the correct version of psscor*.dll based on the architecture and CLR version of the dump. Psscor2 and psscor4 are both installed in the StackHash install folder.&lt;/p&gt;
&lt;p&gt;To load psscor.dll to do managed debugging, the StackHash service must be running on a 64 bit machine with both x86 and x64 bit versions of Debugging Tools for Windows installed and configured in the service profile settings.&lt;/p&gt;
&lt;p&gt;Within a debugger script you can just use the following command (note the absence of a 2 or 4 in the name of the DLL).&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;.&lt;/strong&gt;load psscor.dll&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;and StackHash will take care of loading the correct variant of psscor. The debugger script output will identify the version of psscor loaded. e.g.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;.load C:\Program Files\StackHash\psscor4\amd64\psscor4.dll&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sos - &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/bb190764.aspx"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb190764.aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/bb190764.aspx&lt;/a&gt;&lt;/a&gt; &lt;br/&gt;sos for dumps - &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/yy6d2sxs.aspx"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/yy6d2sxs.aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/yy6d2sxs.aspx&lt;/a&gt;&lt;/a&gt; &lt;br/&gt;psscor2 - &lt;a target="_blank" href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5c068e9f-ebfe-48a5-8b2f-0ad6ab454ad4"&gt;&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5c068e9f-ebfe-48a5-8b2f-0ad6ab454ad4" target="_blank"&gt;http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5c068e9f-ebfe-48a5-8b2f-0ad6ab454ad4&lt;/a&gt;&lt;/a&gt; &lt;br/&gt;psscor4 - &lt;a target="_blank" href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a06a0fea-a4d4-434e-a527-d6afa2e552dd"&gt;&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a06a0fea-a4d4-434e-a527-d6afa2e552dd" target="_blank"&gt;http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a06a0fea-a4d4-434e-a527-d6afa2e552dd&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://infopurge.tumblr.com/post/10440604637</link><guid>http://infopurge.tumblr.com/post/10440604637</guid><pubDate>Tue, 20 Sep 2011 13:50:00 +0100</pubDate><category>psscor</category><category>sos</category><category>psscor2</category><category>windbg</category><category>debugging</category></item><item><title>How does cdb access the Microsoft Symbol Server from within a Windows Service.</title><description>&lt;p&gt;This blog addresses some of the issues related to running cdb from within a Windows Service.&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;strong&gt;What is cdb?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Cdb is the user mode command line debugger that comes as part of the Debugging Tools for Windows toolset which can be downloaded from Microsoft for free. Also contained in the Debugging Tools for Windows are the other kernel level debugger (kd) and windbg, which can be used to debug user applications and the Windows kernel. This blog refers to cdb.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Symbol Files.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Windows applications consist of executable files (.exe and .dll). Symbol files are built by the developer at the same time as the executable files and normally have the same name with a .pdb (program database) or .dbg (debug) extension. e.g. somefile.pdb might be the symbol file for somefile.dll. Symbol files contain additional information useful for debugging applications and it is imperative that developers create and store them for released versions of their products.&lt;/p&gt;
&lt;p&gt;Normally a developer would set up a symbol store to contain product specific symbol files which can then be accessed through a symbol server. For more information see &lt;a href="http://msdn.microsoft.com/en-us/library/ff558840(v=VS.85).aspx" target="_blank"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ff558840" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/ff558840&lt;/a&gt;(v=VS.85).aspx&lt;/a&gt;. This blog deals with the public Microsoft symbol server.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Symbol Path.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In order for cdb to display symbol information for stack traces etc&amp;#8230; it needs to be told the path from where to retrieve the symbol files.&lt;/p&gt;
&lt;p&gt;Symbols can be specified to the cdb command by setting up the _NT_SYMBOL_PATH environment variable, e.g.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;SET _NT_SYMBOL_PATH = SRV*c:\localcache*http://msdl.microsoft.com/download/symbols &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;or can be specified as a command line argument with the -z switch&lt;/p&gt;
&lt;p&gt;&lt;em&gt;cdb -z c:\test\dump.mdmp -y &amp;#8220;SRV*c:\localcache*http://msdl.microsoft.com/download/symbols&amp;#8221;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;The symbol path can contain multiple local folders separated by a semicolon. In the example above it represents a path to a remote symbol server thus:&lt;/p&gt;
&lt;p&gt;SRV* is short for symsrv*symsrv.dll and says use the DLL symsrv.dll (supplied in Debugging Tools for Windows) to access the Microsoft symbol server. Developers could create their own symbol server interface for connecting in a bespoke way to their own symbol server.&lt;/p&gt;
&lt;p&gt;The path following SRV*, i.e. c:\localcache, is the location where all downloaded symbols are stored locally and &lt;a href="http://msdl.microsoft.com/download/symbols" target="_blank"&gt;&lt;a href="http://msdl.microsoft.com/download/symbols" target="_blank"&gt;http://msdl.microsoft.com/download/symbols&lt;/a&gt;&lt;/a&gt; is the web address that symsrv.dll uses to access the public Microsoft symbol server.&lt;/p&gt;
&lt;p&gt;In summary, symsrv.dll downloads symbols (e.g. kernel32.dll) from &lt;a href="http://msdl.microsoft.com/download/symbols" target="_blank"&gt;&lt;a href="http://msdl.microsoft.com/download/symbols" target="_blank"&gt;http://msdl.microsoft.com/download/symbols&lt;/a&gt;&lt;/a&gt; and stores them in c:\localcache.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Compressed symbol file.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Microsoft symbol server stores many symbol file in compressed format to save space and download time. Symsrv.dll knows how to access and decompress these files to the local cache.&lt;/p&gt;
&lt;p&gt;Compressed versions of files are stored with the last extension character replaced with an underscore. e.g.&lt;/p&gt;
&lt;p&gt;kernel32.dll   (not compressed)&lt;br/&gt;kernel32.dl_   (compressed version)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Symbol Server Requests.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The following is an example URL request to the symbol server for the compressed version of the file kernel32.dll. The 49E037DDdc000 is taken from various version and timestamp information that uniquely identifies the version of the file required.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdl.microsoft.com/download/symbols/kernel32.dll/49E037DDdc000/kernel32.dl" target="_blank"&gt;&lt;a href="http://msdl.microsoft.com/download/symbols/kernel32.dll/49E037DDdc000/kernel32.dl" target="_blank"&gt;http://msdl.microsoft.com/download/symbols/kernel32.dll/49E037DDdc000/kernel32.dl&lt;/a&gt;&lt;/a&gt;_&lt;/p&gt;
&lt;p&gt;When downloaded and decompressed, the resultant kernel32.dll file will be stored as: &lt;br/&gt;c:\localcache\kernel32\49E037DDdc000\kernel32.dll&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;WinINet versus WinHTTP.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When running from a Command Prompt, cdb uses WinINet to access internet resources. &lt;br/&gt;When running from a Windows service, cdb uses WinHTTP to access internet resources.&lt;/p&gt;
&lt;p&gt;Microsoft says&amp;#8230; &amp;#8220;Microsoft Windows HTTP Services (WinHTTP) is targeted at middle-tier and back-end server applications that require access to an HTTP client stack. Microsoft Windows Internet (WinINet) provides an HTTP client stack for client applications, as well as access to the File Transfer Protocol (FTP), SOCKSv4, and Gopher protocols.&amp;#8221;&lt;/p&gt;
&lt;p&gt;If cdb is running within the Windows service environment, as it would be when lauched from StackHash, then it should (and does) use WinHttp.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Forcing cdb to use WinHTTP.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can force cdb to use WinHTTP from a Command Prompt by setting the following environment variable.&lt;/p&gt;
&lt;p&gt;SET DBGHELP_WINHTTP=AnythingOtherThanEmpty.&lt;/p&gt;
&lt;p&gt;You can turn this off again with&lt;/p&gt;
&lt;p&gt;SET DBGHELP_WINHTTP=&lt;/p&gt;
&lt;p&gt;Note you will have to retype these commands if you open a new command prompt.&lt;br/&gt;Setting cdb to operate in this way is useful if you are having problems accessing symbols when launching cdb from within a Windows Service environment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cdb with WinHTTP and Proxy Servers.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When running cdb using WinHttp, as described in the previous section, you will still be unable to access symbols on the Microsoft symbol server.&lt;br/&gt;Enabling HTTP trace in netsh winhttp (see appendix to this blog) uncovers the problem.&lt;/p&gt;
&lt;p&gt;09:40:06.299 ::&amp;#187;&amp;#187; WinHttp Version 6.0 Build 6.1.7600 &amp;#187;&amp;#187;Process cdb.exe [11000 (0x2af8)] started at 09:40:06.299&amp;#160;03/09/2011&lt;br/&gt;09:40:06.299 ::WinHttpOpen(&amp;#8220;Microsoft-Symbol-Server/6.12.0002.633&amp;#8221;, WINHTTP_ACCESS_TYPE_NAMED_PROXY (3), &amp;#8220;SymSrvBogusProxy&amp;#8221;, &amp;#8220;&amp;lt;local&amp;gt;&amp;#8221;, 0x0)&lt;/p&gt;
&lt;p&gt;As the trace exposes, WinHttp is trying to use a proxy SymSrvBogusProxy to access the internet.&lt;/p&gt;
&lt;p&gt;Microsoft have documented a related issue with SymProxy &lt;a href="http://msdn.microsoft.com/en-us/library/ff539229(VS.85).aspx" target="_blank"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ff539229" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/ff539229&lt;/a&gt;(VS.85).aspx&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;#8220;The default behavior of SymProxy is to use whatever HTTP proxy is designated by either ProxyCfg or Netsh. If no HTTP proxy is configured, SymProxy uses a dummy proxy to allow access to secure HTTP sites within your intranet. As a side effect, this technique prevents SymProxy from working with direct connections to the external Internet. If you wish to permit SymProxy to operate with a direct connection to the Internet, create a REG_DWORD value named NoInternetProxy in the Symbol Server Proxy key of your registry. Set the value of NoInternetProxy to 1 and verify that there is no HTTP proxy indicated by ProxyCfg.&amp;#8221;&lt;/p&gt;
&lt;p&gt;To disable the HTTP proxy for cdb and symsrv you need to set the following keys in the registry.&lt;/p&gt;
&lt;p&gt;For x32 version of cdb running on a x32 bit machine from the Windows Service environment.&lt;br/&gt;HKLM\Software\Microsoft\Symbol Server\NoInternetProxy DWORD 1.&lt;/p&gt;
&lt;p&gt;For x32 version of cdb running on a x32 bit machine from a Command Prompt.&lt;br/&gt;HKEY_CURRENT_USER\Software\Microsoft\Symbol Server\NoInternetProxy DWORD 1.&lt;/p&gt;
&lt;p&gt;For x32 version of cdb running on a x64 bit machine from the Windows Service environment.&lt;br/&gt;HKLM\Software\Wow6432Node\Microsoft\Symbol Server\NoInternetProxy DWORD 1.&lt;/p&gt;
&lt;p&gt;For x32 version of cdb running on a x64 bit machine from a Command Prompt.&lt;br/&gt;HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Symbol Server\NoInternetProxy DWORD 1.&lt;/p&gt;
&lt;p&gt;For x64 version of cdb running on a x64 bit machine from the Windows Service environment.&lt;br/&gt;HKLM\Software\Microsoft\Symbol Server\NoInternetProxy DWORD 1.&lt;/p&gt;
&lt;p&gt;For x64 version of cdb running on a x64 bit machine from a Command Prompt.&lt;br/&gt;HKEY_CURRENT_USER\Software\Microsoft\Symbol Server\NoInternetProxy DWORD 1.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;strong&gt;Http Proxy configuration.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For the above settings to work, you also need to ensure that there is no HTTP proxy configured. To do this&amp;#8230;&lt;/p&gt;
&lt;p&gt;Open an administrator command prompt (in elevated mode).&lt;br/&gt;Type netsh winhttp show proxy. The following should be displayed.&lt;/p&gt;
&lt;p&gt;Current WinHTTP proxy settings:&lt;/p&gt;
&lt;p&gt;    Direct access (no proxy server).&lt;/p&gt;
&lt;p&gt;On older XP systems use ProxyCfg to configure the proxy.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;The result of setting the registry and ensuring that no HTTP proxy has been configured should be that no proxy is used by WinHTTP and symbols are successfully downloaded.&lt;/p&gt;
&lt;p&gt;13:00:24.967 ::&amp;#187;&amp;#187; WinHttp Version 6.0 Build 6.1.7600 &amp;#187;&amp;#187;Process cdb.exe [7540 (0x1d74)] started at 13:00:24.967&amp;#160;03/02/2011&lt;br/&gt;13:00:24.968 ::WinHttpOpen(&amp;#8220;Microsoft-Symbol-Server/6.12.0002.633&amp;#8221;, WINHTTP_ACCESS_TYPE_NO_PROXY (1), &amp;#8220;&amp;#8221;, &amp;#8220;&amp;#8221;, 0x0)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Still problems accessing the Microsoft Symbol server?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you are using Version 6.11.1.404 of cdb or below, then the above solution may not work. The reason for this is that cdb attempts to retrieve the full version of the symbol file (kernel32.dll) which is unavailable (returns a 404 error File not found) but does not attempt then to retrieve the compressed version of the file (kernel32.dl_). &lt;br/&gt;To fix this issue, upgrade to the latest version of the Debugging Tools for Windows - 6.12.0002.633 at the time of writing.&lt;/p&gt;
&lt;p&gt;The symbol server needs to be able to access the local symbol store c:\localstore in the examples above. Make sure that the User Account that is running the cdb.exe has Full Access to the local store folder.&lt;/p&gt;
&lt;p&gt;This blog was transferred from the StackHash product web site. StackHash is now an OpenSource code project at &lt;a title="StackHash in CodePlex" target="_blank" href="http://stackhash.codeplex.com/"&gt;codeplex&lt;/a&gt;.&lt;/p&gt;</description><link>http://infopurge.tumblr.com/post/10438913681</link><guid>http://infopurge.tumblr.com/post/10438913681</guid><pubDate>Tue, 20 Sep 2011 11:55:00 +0100</pubDate><category>symbol server</category><category>windbg</category><category>debugging</category><category>cdb</category></item><item><title>What is StackHash?</title><description>&lt;p&gt;Windows Vista &amp;#8220;Problem Reports and Solutions&amp;#8221; in Control Panel (click &amp;#8220;Classic View&amp;#8221;) allows you to define how application crashes are handled by Windows. &lt;br/&gt;When you double click the item and select &amp;#8220;Change Settings&amp;#8221; you can configure Windows to &amp;#8220;Check for solutions automatically&amp;#8221; and in Advanced Settings, clicking &amp;#8220;Automatically send more information if it is needed to help solve problems&amp;#8221; will allow the transmission of more information to help the developer of the application fix issues.&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;When an application crashes, a Problem Report is sent to Microsoft. The developer of the application can log on to the Microsoft WinQual site and download problem report information associated with the applications they have developed. This information is used to help identify the cause of the error and hopefully fix it. If the error is identified and fixed, the developer posts a &amp;#8220;response&amp;#8221; on the Microsoft web site. This response may be that a new version or patch to the application is available to fix the issue, or it might be a description of a workaround. Either way, your PC will periodically check for fixes to previous problems on the Microsoft site and allert you if solutions are available.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;But how is the specific problem identified? &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Each application installed on your computer is probably made up of a number of modules.&lt;br/&gt;e.g. Application.exe might use some code inside Application.dll and Utilities.dll&lt;br/&gt;and these modules make use of general system modules e.g. user32.dll and kernel32.dll installed as part of the Windows Operating System.&lt;br/&gt;When an application runs, it loads into memory the modules that it uses (in this case, Application.exe, Application.dll, Utilities.dll, user32.dll and kernel32.dll) and the program begins to execute instructions (code) in those modules.&lt;br/&gt;To keep a track of which instruction is to be executed next, there is an Instruction Pointer (IP) which contains the address of the instruction currently being executed.&lt;/p&gt;
&lt;p&gt;There are a number of reasons why an application may crash when executing one of these instructions. These crashes are known as exceptions. If the program has jumped into an area of memory that doesn&amp;#8217;t contain any instructions for example, you may see an Invalid Operation exception. Or perhaps an instruction attempts to divide 10 by zero - this will cause a Divide By Zero exception.&lt;/p&gt;
&lt;p&gt;In our example, if Utilies.dll tried to divide a value by zero then the problem report data may look something like this.&lt;/p&gt;
&lt;p&gt;Problem Event Name: APPCRASH&lt;br/&gt;Application Name: application.exe&lt;br/&gt;Application Version: 2.0.02510.12346&lt;br/&gt;Application Timestamp: 42e4438e&lt;br/&gt;Fault Module Name: utilities.dll&lt;br/&gt;Fault Module Version: 1.0.02310.12345&lt;br/&gt;Fault Module Timestamp: 4549bdf8&lt;br/&gt;Exception Code: c0000094&amp;#160;&lt;br/&gt;Exception Offset: 000a102b&lt;br/&gt;OS Version: 6.0.6000.2.0.0.256.1&lt;br/&gt;Locale ID: 1033&lt;/p&gt;
&lt;p&gt;In this case the module is nicely identified as utilities.dll and the offset to the faulty instruction within the module is given as 000a102b and the reason for the crash is given as C0000094 (Divide By Zero). &lt;br/&gt;This, along with the version of the module, goes a long way to assist the developer of the application identify and fix the fault. It also allows the particular fault to be uniquely identified so that if another user has the same fault then their information is added to the pool of information associated with the fault - thereby increasing the chances of the developer finding the reason for the fault. e.g. if the only users in the world reporting the fault are in Greece (identified by the locale id) then perhaps there is a problem displaying Greek characters.&lt;/p&gt;
&lt;p&gt;But this information only uniquely identifies a fault if the module (utilities.dll) can be identified. Consider this next example.&lt;/p&gt;
&lt;p&gt;If our application erroneously jumps to an area of memory that does not contain any instructions and attempts to start executing code at that address, then the Instruction Pointer will now be pointing outside any identifiable module.&lt;br/&gt;i.e. it isn&amp;#8217;t in utilities.dll or any other modules that come as part of Windows. How then can the crash that results be uniquely identified? The Problem Reports and Solutions system in Windows attempts to &amp;#8220;invent&amp;#8221; a unique module name as follows.&lt;/p&gt;
&lt;p&gt;A program is made up of smaller units called functions. Functions call each other to do work (e.g. display an icon or work out some calculation). A called function may call other functions which themselves call other functions. The information about who has called whom is stored in what is known as a Stack. Every application thread has its own stack and, when a crash occurs, the stack contains useful information that identifies who was calling whom at the time of the crash. This stack information is combined into what is known as a Hash to create a &amp;#8220;semi&amp;#8221; unique number for the crash. The prefix StackHash_ is added to the number (which is in hexadecimal (base 16) form) giving a module name that appears in the crash information as shown below.&lt;/p&gt;
&lt;p&gt;Problem Event Name: APPCRASH&lt;br/&gt;Application Name: iexplore.exe&lt;br/&gt;Application Version: 7.0.6000.16757&lt;br/&gt;Application Timestamp: 48e4238e&lt;br/&gt;Fault Module Name: StackHash_1ea1&lt;br/&gt;Fault Module Version: 6.0.6000.16386&lt;br/&gt;Fault Module Timestamp: 4549bdf8&lt;br/&gt;Exception Code: c0000374&lt;br/&gt;Exception Offset: 000aa0fb&lt;br/&gt;OS Version: 6.0.6000.2.0.0.256.1&lt;br/&gt;Locale ID: 1033&lt;/p&gt;
&lt;p&gt;Therefore, StackHash is not a real module. It is a constructed name because the Instruction Pointer was pointing to a known module at the time of the crash. The number after the StackHash_ is a semi-unique number calculated at the time of the crash such that if the same crash occurred on multiple PCs then they have a reasonable chance to be correlated.&lt;/p&gt;
&lt;p&gt;For a programmer to successfully track down the cause of the problem, he needs either to be able to reproduce the problem or he needs a copy of the Stack at the time of the crash. The stack will be included in a minidump which is a file automatically generated and stored at the time of the crash and sent to Microsoft as part of the crash information if the PC is configured to do so.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Some of the reasons for StackHash crashes include&amp;#8230;&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;The application itself has a fault causing it to call a function in a piece of memory that does not contain any code as in the example above.&lt;/li&gt;
&lt;li&gt;A virus checker, virtual drive S/W, security systems (or other application) has injected a piece of code into the address space of the application that crashes for some reason. In this case there is no identifiable module so a StackHash_XXXX will be created.&lt;/li&gt;
&lt;li&gt;A virus has infected the machine and the virus code is executing in the context of the faulting application.&lt;/li&gt;
&lt;li&gt;There is a bug in the operating system or other shared component on the system.&lt;/li&gt;
&lt;li&gt;The application has become corrupted either by a disk error or virus.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;br/&gt;&lt;strong&gt;What to do if you get a StackHash? &lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;First configure Problems Reports and Solutions in Control panel to Check for Solutions automatically and Automatically send more information. Then check if there are fixes available for your application. If there are then download and install them.&lt;/li&gt;
&lt;li&gt;Make sure your Window Operating system has all the latest service packs, security updates and other fixes installed.&lt;/li&gt;
&lt;li&gt;Most applications have a Check for Updates feature. Use it to make sure you have the latest version of the S/W. Alternatively visit the company website and check for new versions and patches.&lt;/li&gt;
&lt;li&gt;Run an up-to-date virus checker on the machine and fix any issues. If a virus is detected in the application then you may need to reinstall the application.&lt;/li&gt;
&lt;li&gt;Re-install the application. Through Control Panel \ Programs \ Uninstall a program. Right click the application and click Uninstall / Change. This should launch the installer which may give the option to Repair the installation. If not then you will need to uninstall and reinstall - make sure you have the original installation discs available before uninstalling.&lt;/li&gt;
&lt;li&gt;Disable any Virtual Drive software that may be hooking in to the application. If the problem goes away, contact the developer of the Virtual Drive software.&lt;/li&gt;
&lt;li&gt;Disable any Virus checkers on your machine (temporarily) and run the application again. If the problem goes away, contact the developer of the Virus Checking software.&lt;/li&gt;
&lt;li&gt;Check if the problem is reproducible (after a reboot). If it is, then attempt to narrow down the exact steps that cause the fault, write them down and contact the support department for the company that developed the application providing as much information about the crash and what you have done so far to attempt to resolve the issue.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;This blog was transferred from the StackHash product web site. StackHash is now an OpenSource code project at &lt;a title="StackHash in CodePlex" target="_blank" href="http://stackhash.codeplex.com/"&gt;codeplex&lt;/a&gt;.&lt;/p&gt;</description><link>http://infopurge.tumblr.com/post/10438725843</link><guid>http://infopurge.tumblr.com/post/10438725843</guid><pubDate>Tue, 20 Sep 2011 11:41:00 +0100</pubDate><category>StackHash</category><category>debugging</category><category>windbg</category><category>cdb</category><category>winqual</category><category>windows error reporting</category></item></channel></rss>

