tags:

views:

901

answers:

3

I am having a problem getting windbg to use the pdb files for my .Net dlls. the hang dump I am looking at is from a production build. but I have pdbs from a debug build of the same code.

I set the symbol path to include a local folder and the msft symbol server.

C:\websymbols\foo;srv*c:\websymbols*http://msdl.microsoft.com/download/symbols

I put all my pdb files in c:\websymbols\foo yet the managed stack listings contain no method names.

doing a reload tells me

.reload /f

   DBGHELP: No debug info for FOO.dll.  Searching for dbg file
SYMSRV:  c:\websymbols\foo\FOO.dbg\49B7F17C10000\FOO.dbg not found
SYMSRV:  c:\websymbols\FOO.dbg\49B7F17C10000\FOO.dbg not found
SYMSRV:  http://msdl.microsoft.com/download/symbols/FOO.dbg/49B7F17C10000/FOO.dbg not found
DBGHELP: .\FOO.dbg - file not found
DBGHELP: .\dll\FOO.dbg - path not found
DBGHELP: .\symbols\dll\FOO.dbg - path not found
DBGHELP: FOO.dll missing debug info.  Searching for pdb anyway
DBGHELP: Can't use symbol server for FOO.pdb - no header information available
DBGHELP: FOO.pdb - file not found
*** WARNING: Unable to verify checksum for FOO.dll
*** ERROR: Module load completed but symbols could not be loaded for FOO.dll
DBGHELP: FOO - no symbols loaded

when attaching windbg to the service in a test environment, managed stacks show up fine with method names. dumping the memory, and analyzing the dmp file locally I don't see the names in the managed stacks. What might I be doing wrong?

Thanks

+4  A: 

You need the exact same PDBs. Debug symbols will not work with a retail dump. And you need the pdb from exactly the same build. Whenever you release bits into the wild, your build team should store the private pdbs for referenc ein case you have to stare at a dump 6 months later...

Remus Rusanu
btw if you don't have the release bits pdb then you should make an enlistment and get the source tree as it was at the moment of the release then build with identical settings as the release build. Ideally your source tree should tag each relese and be easy to get the tree at a specific tag. If the build you get is identical bit-to-bit with the relese, the pdbs will load. Ultimately you can force the symbols in with /reload /f by specifying the size and timestamp explicitly, ovewrridding dbg's decision: http://msdn.microsoft.com/en-us/library/cc266830.aspx. Mileage will vary.
Remus Rusanu
Remus, the build process includes embedding a build-GUID in the resulting binaries, which is used for matching. Synchronizing the sources would not be enough.
Ofek Shilon
@Ofek: I did forced overload of symbols from unmatched build several times back in my glory days, with .reload /f and explicit address/size/timestamp. Windbg will barf, but accept the mismatched symbols. It seldom pays though and having the right symbols is *sooo* much better.
Remus Rusanu
With the same source code, but different builds, .reload /f /i forced windbg to accept the mismatched symbols.
John Naegle
+2  A: 

There's not much you can do about it now. As John Robbins says:

The most important thing all developers need to know: PDB files are as important as source code! ... I've been to countless companies to help them debug those bugs costing hundreds of thousands of dollars and nobody can find the PDB files for the build running on a production server. Without the matching PDB files you just made your debugging challenge nearly impossible.

You can try your luck with an evil tool called ChkMatch, fooling VS to accept whatever PDB you throw at it. Just know that chances are near-zero you'd get any meaningful stacks - the PE layout is extremely sensitive to code changes, and technically even two builds of identical source are not guaranteed to give the same PE.

[edit:] Sorry, just noticed you use WinDBG. In that case, as Remus says, .reload /f /i can achieve the same trick (with the same risks).

Ofek Shilon
A: 

ok, I asked the wrong question. I don't even need symbols for the .net code. (as Remus pointed out). So this is not the answer to my question, but it is the solution to my problem. Which seems to be related to the .Net build on the machine windbg is run on.

I get meaningful stack info when .chain tells me this C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos: image 2.0.50727.1433, API 1.0.0, built Tue Oct 23 20:41:30 2007 (same as on the server the dump was taken)

I don't get any info other than addresses from !clrstack when run on machines where .chain tells me C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos: image 2.0.50727.3053, API 1.0.0, built Fri Jul 25 07:08:38 2008

turnhose

related questions