4

I have read the questions that already on StackOverflow, but I still can't make it work.

I have

  • a mini dump file from a customer
  • the exact same version of our code that the customer has got
  • in the debug directory, .pdb files for the code.

I tried putting the mini dump file in the debug directory, then opening it in Visual Studio 2010. I don't know if this was the correct thing to do, or what to do next.

"Start Debugging" is greyed out in the normal Debug menu.

There is a box with "Actions" in the top right hand corner of the Minidump File Summary tab. So I clicked on "Debug with Native Only" but all I get is "There is no source code available for the current location."

I must be missing something really simple - please can someone give me a hint?

user1725145
  • 3,993
  • 2
  • 37
  • 58
  • 1
    Do you have .pdb files that were created when the program was built? Just rebuilding the same source doesn't work, you need to keep .pdb files for every build. – Alex F Feb 20 '13 at 11:05
  • Also, you need to enable Microsoft Symbol Server in the Debugger options. – Alex F Feb 20 '13 at 11:06
  • @AlexFarber thank you for replying. Do you mean load the symbols for Microsoft libraries from the Microsoft Symbol Server? I have done that. – user1725145 Feb 20 '13 at 11:09
  • I am just checking the .pdb files (I didn't know that!). – user1725145 Feb 20 '13 at 11:10
  • Analyzing Crash dumps in Visual Studio http://stackoverflow.com/q/12252407/1888362 – Serg Feb 20 '13 at 12:02
  • @sergmat - thanks. I read this question, and it is helpful, but it still assumes a level of knowledge that I didn't have. I will try with the correct pdb files when I have got them. – user1725145 Feb 20 '13 at 12:06
  • @AlexFarber - Please see the addition to the question above. I think I understand the whole process a lot better now. Please can you add the point about the pdb files from the released build as an answer, and I will mark the question as answered? Or be kind enough to say if you think I am still going in the wrong direction :-) – user1725145 Feb 20 '13 at 13:34
  • Put the .pdb .exe .dmp files into that same directory. Open the .dmp in VS click on "Debug with Native Only" and "Find Source" dialog will appear. http://i.stack.imgur.com/R5wcz.png http://i.stack.imgur.com/TUMef.png – Serg Feb 20 '13 at 13:36
  • @sergmat - is that also valid for managed code? I now have .pdb .exe and .dmp files in the same directory, but when I click "Debug with Native Only," I don't get the "Find Source" dialog. – user1725145 Feb 20 '13 at 13:42
  • Try use [chkmatch](http://www.debuginfo.com/tools/chkmatch.html) to check whether an executable and debug information file match. Whith `-m` switch you may to make the executable and the debug information file match. – Serg Feb 21 '13 at 06:38
  • @sergmat - thanks. I am pursuing WinDbg at the moment, but will bear this in mind. – user1725145 Feb 22 '13 at 09:59

2 Answers2

3

Just to pull the various bits of information together into an answer:

Do you have .pdb files that were created when the program was built? Just rebuilding the same source doesn't work, you need to keep .pdb files for every build. – Alex Farber Feb 20 '13 at 11:05

"The debugger matches information like filename, timestamp and checksum when matching a PDB with a binary (DLL or exe)." (Saikat Sen, Codeproject article)

Following AlexFarber's hint, I copied the source code and release folder from the customer's build onto my computer (the whole build had been saved, including the .pdb and .exe files in the Release folder).

Then I copied the dump file into the release folder, and loaded the Microsoft symbols into the same folder.

Then I opened the dump file again into Visual Studio 2010.

I didn't see anything more helpful than before, which I assume is due to this - see the accepted answer on this SO question. I am using a C# and a .NET 2.0 assembly, and it seems that I can only view source code for a .NET 4.0 assembly.

I will try the WinDbg add-in called sos.dll recommended by Hans Passant on the same question next.

How to get round the need to use the pdb files from the same build:

I think you can get round this requirement for the same .pdb files if you use WinDbg. From virtualdub "If the debugger is stubborn and doesn't want to load symbols because it thinks they don't match, you can use .symopt+ 0x40 to set the "load anything" flag."

Also, if I understand correctly, you can use the chkmatch tool referred to by sergmat above, to match up the .exe and .pdb files.

Community
  • 1
  • 1
user1725145
  • 3,993
  • 2
  • 37
  • 58
2

As I understand it you have a minidump for a customer which I presume he is using a Release build of your application and a Debug PDB file.

That's your problem right there, Your PDB and the mini dump do not match. In order to view clear stack traces the PDB should have the same build configuration/platform as the one of the application that generated the dump file.

Zaid Amir
  • 4,727
  • 6
  • 52
  • 101