Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Myspace button
Linkedin button
Webonews button
Delicious button
Digg button
Flickr button
Stumbleupon button
Newsvine button

Posts tagged: dbghelp

How to speed up Memory Validator by changing DbgHelp version

By , September 6, 2015 9:26 am

Recently we’ve had a few customers contact to tell us they have experienced a dramatic reduction in speed when using C++ Memory Validator.

We found this puzzling as we hadn’t really noticed this. We investigate and found that some parts of our code were hitting the disk a bit too much. To address this we implemented a buffered file read/write system so that we hit the disk once rather than many times. For our test case (which was a substantial program being monitored) this worked wonders. Performance improved enormously. Smiles all round.

But our customers still reported problems. This was puzzling. We started logging everything in one particular code path (which we knew was the problem). Nothing obvious. Next step, start timing all the logging. But just before we got to that we did a simple test. We iterated through each version of DbgHelp.dll that C++ Memory Validator can supply – if you remember we let you specify which Visual Studio version you used and we supply a version of DbgHelp.dll that ships and works for that (not all DbgHelp.dll are equal!).

Imagine our surprise when we found that DbgHelp.dll (6.11.1.404) shipped prior to Visual Studio 2013 are blazingly fast and the DbgHelp.dll we supply for use with Visual Studio 2013/2015 (6.3.9431.0) are slow. If you’re paying attention you’ll also notice the DbgHelp.dll version number has decreased rather than increased – ask Microsoft, we have no idea why they decreased the version number with more recent releases.

For now, until we can get a new release out to address this anomaly we recommend that you ignore choosing the Visual Studio you are using and deliberately choose Visual Studio 2012. This will select DbgHelp 6.11.1.404 and you should find the usual blazing speeds you are used to are restored.

To change the version of DbgHelp used, open the settings dialog, go to Symbol Lookup then change the version in the combo box. Click OK.

Any problems, as usual, please contact support.

Share

DbgHelp search path

By , June 26, 2013 9:54 am

The problem

One of the problems using DbgHelp.dll to read the symbols for your Visual Studio application is that sometimes your symbols do not load.

There are typically three broad classes of failure when trying to load symbols from a PDB file:

  1. Missing PDB file.
  2. PDB file located in the wrong place. You think the PDB is present but DbgHelp.dll can’t find it.
  3. An incorrect PDB file. You think the PDB is correct but it’s actually from a different build.

You think you have the symbols in the right place but the symbols don’t load. You double check, you may even move some files around in desperation, and still the symbols do not load. This is a source of great frustration and a waste of time. What can you do about that?

The solution

With the latest release of our C++ software tools we’ve update the Diagnostic tab to include a combo box that allows you to choose what to display on the diagnostic tab. You can view everything (the default) or just specific types of information. One of those types is DbgHelp debug. When this is selected the diagnostic tab will only show you information which is the debugging output from the DbgHelp.dll. You can see every message that DbgHelp.dll issued, including each path that DbgHelp.dll looked into to find a PDB file and whether it found a PDB, or the PDB was mismatched or the PDB was found but only with COFF symbols or if the PDB was found with public/private symbols and lines.

We display the output for each module in alternating colours. This makes it easier to identify messages for one DLL compared to another DLL.

Here are some examples of symbol load success and failure:

Correct symbol file

DbgHelp.dll search path correct symbols found

DbgHelp searches in various places looking for mvExample.pdb.
Eventually mvExample.pdb is found in e:\om\c\memory32\mvExample\DebugNonLink6_0\mvExample.pdb.
DbgHelp loads private symbols and lines. (The alternate outcome is that DbgHelp loads public symbols).

Outcome: Success. Symbols are loaded.

Missing symbol file

DbgHelp.dll search path no symbols found

DbgHelp has the search path set then searches in various places looking for mvExample.pdb.
mvExample.pdb never gets found on the search path. SymSrv then looks for additional locations for mvExample.pdb. None are found.
DbgHelp does find some COFF symbols in the executable. Unfortunately COFF symbols do not contain filename or line number information.

Outcome: Failure. The PDB file could not be found. Some default symbols are loaded but are not of much use.

When a PDB file can’t be found you can examine the search path used by DbgHelp.dll and then check where your PDB file is to ensure that your PDB file is on the DbgHelp search path. You can either move your PDB file onto the search path or you can update the File Locations part of the settings dialog to include a path to your PDB file.

Mismatched symbol file

DbgHelp.dll search path mismatched symbols found

DbgHelp searches in various places looking for mvExample.pdb.
Eventually mvExample.pdb is found in e:\om\c\memory32\mvExample\DebugNonLink6_0\mvExample.pdb.
DbgHelp attempts to load the symbols but fails because the symbols are for a different build of the software. The checksum inside the PDB file does not match the module.

DbgHelp does find some COFF symbols in the executable. Unfortunately COFF symbols do not contain filename or line number information.

Outcome: Failure. A PDB file was found but it was not the correct PDB file. Some default symbols are loaded but are not of much use,

When an incorrect PDB file is found you can examine the search path used by DbgHelp.dll and then either update the PDB file to be the correct PDB file or if the PDB file is being found because the search path is incorrect you can update the search path in the File Locations part of the settings dialog to prevent the wrong PDB file being found.

Things to check

  • Ensure the PDB file found is the correct PDB file for the build. If you are copying builds from a build server be sure to copy the correct PDB files as well.
  • Check the File Locations PDB paths to ensure that all the possible paths for PDB files are listed in the correct order so that if multiple paths have a PDB file with the same name that the correct PDB file is found first.
Share

Panorama Theme by Themocracy