How can I configure windows to generate a core dump from an application?
Asked Answered
E

7

22

How can I configure windows to generate a core dump from an application?

I'm using Win xp, and the application is build with Visual Studio 2003.

Enate answered 12/1, 2011 at 18:37 Comment(0)
I
14

Microsoft has a free tool called Userdump.exe which will do this.

It's pretty simple to use that tool to create a dump (.dmp) file for a process that shuts down with an exception or to create a dump file for a hanging process

Indolent answered 12/1, 2011 at 18:44 Comment(1)
thank you for the answer. It's been the most adequate for my situation.Enate
B
9

Just to throw in some other suggestions:

  • ProcDump that is part of the MS SysInternals suite (it captures crashes but also does a load more, can take dumps if CPU usage spikes for an amount of time, etc)
  • You can put code into your exe using MiniDumpWriteDump to save out dumps youself (which I've done in a few tools). You have control over the name and location (i.e. network path). There's some sample code here
Bcd answered 12/1, 2011 at 19:16 Comment(1)
ProcDump is a good tool. I'll use Userdump.exe instead because the tool will be installed in a customer's machine, and Userdump seems easier to teach how to use.Enate
V
4

You can open Task Manager (by right clicking the task bar), find your process in the processes tab, right-click it and select Create Dump File.

Vlissingen answered 7/7, 2014 at 8:40 Comment(0)
S
3

You can use adplus to produce a crash dump for a running application. The command may look something like this:

C:\Program Files\Debugging Tools for Windows\adplus.vbs -hang -do -o c:\ -quiet -pn theprocess.exe

You can also attach to a process with windbg and run this command:

.dump /ma c:\somepath\filename.dmp
Stabile answered 12/1, 2011 at 18:40 Comment(0)
C
3

You might try using WinDbg as described here.

Contort answered 12/1, 2011 at 18:45 Comment(0)
E
0

I refer you to the follows MS KB article on the subject. You would typically debug the dump file using one of the Windows debugging tools, e.g. WinDbg. There are many articles on the web describing how to do this.

Errolerroll answered 12/1, 2011 at 18:45 Comment(1)
Hefferman, I was looking for something to automate the generation of a core dump, but I will use WinDbg to analyze the generated dumps.Enate
S
0

I know the AP was about Win XP but that is highly outdated so I'm posting an answer anything above Windows Server 2008 and Windows Vista with Service Pack 1.

Use WER (Windows Error Reporting) to generate a dump file when your application is crashing. It is available also on the user's computer.

Only one registry key need to be added:

(as an expandable string)
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\DumpFolder

I set that to %LOCALAPPDATA%\CrashDumps.
Optionally, you can filter to your own application by defining a subkey or limiting the number of dump files to keep. See the link above for all the possibilities.

Straphanger answered 27/9, 2023 at 14:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.