2

I have a Visual Basic 6 application that I've recently changed to use a couple of C++ DLLs I've written in Visual Studio 2008. The application works fine on my PC, but when we install it on one of our test PCs it tends to crash during shutdown - we see the Win 7 message "Your application has failed" or whatever it is.

I know Win 7 stores data that can be used to analyse the crash. I've got the source code and .PDB files from the build so I should be able to use that, but I can't figure out where Win 7 stores the data from the crash. The Event Viewer shows the crash but doesn't have any data and the directory C:\Windows\Minidump doesn't exist.

Where do the crash files get put?

parsley72
  • 8,449
  • 8
  • 65
  • 98
  • Your question is better suited for asking at serverfault.com or superuser.com – SoftwareGeek May 23 '10 at 03:25
  • 4
    Why? StackOverflow's for programming questions. – parsley72 May 24 '10 at 06:22
  • Any reason you can't switch to VB.net? Is this a dependency problem? (I know Visual Studio 2008 has a run-time, but maybe you're not using it?) That said, I'm right there with you as to problems only with C++, so I'll be sure to post or cross-post if I find something good... (probably watson + minidump + symbols etc which I've forgotten in my attempted lack of masochism) – ebyrob Mar 12 '18 at 16:26
  • Note: If configured to look online for a solution, there's a screen that pops up on crash. If you don't hit cancel but wait for it, there's a question whether it's OK to send. If you pause there and get "more information" there is a section of the dialog which shows 3 file names related to the crash. The one with the *.mdmp extension has your minidump. (Of course the second the dialog closes MS will erase it, so grab it quick!) – ebyrob Mar 12 '18 at 17:15
  • This was 8 years ago but VB6 isn't the same as VB.net, it would have required a complete rewrite. – parsley72 Mar 12 '18 at 20:59

4 Answers4

3

Microsoft has documentation here which works back to Vista Service Pack 1: https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx

There is a registry key with 4 sub-values that control generic crashes:

# HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps

DumpType   # 1 = mini-dump, 2 = full dump, 0 = custom dump
DumpCount  # Maximum number of dump files to keep before purging
DumpFolder # Full path to folder to store dump files (no trailing slash)
DumpFlags  # Usually 0, flags only used if DumpType is 0

Once these registry values are in place crash files should be immediately written no matter what happens to whatever dialog might be displayed.

Note: Registry sub-keys with executable name can be used to control crash behavior for only one specified process.

ebyrob
  • 667
  • 7
  • 24
0

Why don't you make your program save minidump wherever you want when the crash happens? I'm not familiar with VB, but try to use SetUnhandledExceptionFilter() and MiniDumpWriteDump().

TAbdiukov
  • 1,185
  • 3
  • 12
  • 25
young
  • 2,163
  • 12
  • 19
  • Wouldn't you want to create the mini-dump on the user's computer to work with any executable program without installing developer tools (like the SDK)? How would you do it? – ebyrob Mar 12 '18 at 16:46
0
  • Get minidump for crash
  • Get WDK , Using Debugging Tools for Windows

  • Use Windbg to open crash dump

  • use command !analyze

    The !analyze extension displays information about the current exception or bug check.

  • Read more about window debugging

Creating Dump:

You can configure windbg as defaut debugging tool by giving command "windbg -I" in run.

Also Dr. Watson tool can do this for you.

Satbir
  • 6,358
  • 6
  • 37
  • 52
  • Are you saying the user has to configure WinDbg as the default debugging tool (or Dr Watson) in order to create a crash dump? Doesn't Windows do this by default? – parsley72 May 24 '10 at 08:32
  • There are two ways: 1. use Crash Dump to postmortem the issue 2. Use windbg as default debugger , When your process will crash it will open with windbg automatically and you can catch the culprit – Satbir May 24 '10 at 13:59
  • you can create dump programatically also ...read this thread http://stackoverflow.com/questions/1547211/how-to-create-minidump-for-my-process-when-it-crashes – Satbir May 24 '10 at 14:04
  • **Get minidump for crash** Without the SDK on the end-users computer no special tools. How do you do this? – ebyrob Mar 12 '18 at 16:46
0

You can even use a carsh reporting mechanism and get the locally saved dump file, then debug it using Visual Studio. There are pretty much freely available resources in Visual C++, but not much in VB.

Izza
  • 2,389
  • 8
  • 38
  • 60
  • Dr. Watson perhaps? Okay, so some tool may be needed on the end-user's machine to do this. Which one? How should it be set up? – ebyrob Mar 12 '18 at 16:47