tags:

views:

49

answers:

3

Is there any reason to not include pdb files in an installer? I have C++ logging functionality that walks the stack, and reports line numbers and file names. It would be great if my customers could send me logs with this information. However, they would need the pdb files. Is there any downside (other than installer package size) to deploying them?

+3  A: 

Two possible downsides:

  • The PDB file might make it easier for someone to reverse-engineer your application.
  • As a result of the previous, someone might come to expect to be able to call undocumented functions in your DLLs.

If those don't bother you, I can't see any downside. Note though that you don't really need this. As John Seigel says, you should be able to reconstruct the stack trace from a crash dump.

Billy ONeal
I also grab dumps, but I have some "unhandled excpetions" that are handleable. I have a top level loop where the iterations are completely independent. So its completely possible for one iteration to bomb out, and all of the other iterations to provide excellent information. In that case, I don't want to grab a minidump in case all of the hundreds of iterations blow up, but I still need a way to get the information. Thanks for the suggestions.
Steve
+2  A: 

You should be able to achieve "line numbers and file names" without PDB files. Try using _FUNCTION_, _LINE_, and _FILE_. Read more here:

http://msdn.microsoft.com/en-us/library/b0084kay.aspx

Brent Arias
that doesn't give you the pathway that caused the problem, only the location of the problem. The particular piece I'm dealing with 15-20 possible ways of getting to it. Only some of which can cause a problem. Sadly these problems seem to crop up at client sites. I do use those macros in the exception information, however
Steve
Have you used "StackWalk64"? I don't think it needs PDB files:http://msdn.microsoft.com/en-us/library/ms680650(VS.85).aspx
Brent Arias
@Mystagogue -I'm using stackwalk64, but if you want func names, addresses and line numbers you need the pdbs. Otherwise you just get the address of the executed instruction
Steve
A: 

Instead of shipping the PDB files, your error handling code can create minidumps. See function MiniDumpWriteDump. Minidumps are very small and can easily be send via e-mail. If you get the dump file from the customer, only you need the PDB files.

IMHO, it is a very good idea to catch asserts or unexpected errors in your application, create a minidump automatically and let your application send this dump to you. If you get really fancy, you build yourself an automated bug tracking database in which these minidumps are stored. Then, you can find out which bugs are most common and need to be fixed first. Accidentally, you will find out a lot about the environment your application runs in. Which operating system versions are most common, which virus scanners hook into your application etc.

Obviously, this requires the consent of your users since the minidump may contain private information (however little information there is on the stack). It is not trivial to implement a working error handler that can catch, e.g., stack overflow exceptions.

Sebastian