Detect/Redirect core dumps (when a software crashes) on Windows
Asked Answered
S

2

0

For my work, I need to create a service that will detect an abnormal program termination and, instead of displaying a message to the user (default behavior), send the generated core dump to a remote server.

I'm pretty sure this can be done, but I have absolutely no clue on where to start. Is there any API/registry settings for this ?

Thank you.

Sandwich answered 26/5, 2010 at 8:3 Comment(3)
Why the close vote ? My question is 100% programming related oOSandwich
Why do you not setup WinDbg so that it creates automatically a minidump on a crash? And then you just can work with this file. Why do you need API?Moonier
@skwllsp: Why ? Because as I stated, I didn't know what to do at all. Glad I don't need an API, that's a good thing. I will take a look at WinDbg: i never used it. Thanks.Sandwich
H
4

One method is to install an Unhandled Exception Filter and then write a minidump from it which you can then upload to some place of your choosing. I wouldn't totally disregard Windows Error Reporting -- that's an addition to any crash reporting of your own. If your application is for public release then registering for Windows Error Reporting is well worthwhile as you get information about which crashes users are encountering in the wild and when crashes have been fixed you can add a response code to point them to a new version or other relevant information.

Another tool that may be useful depending on how your application is deployed in your organisation is to run Adplus on a user's machine which will collect together crash dumps. This is more useful for one-off crashes that seem to affect an individual user but aren't reproducible in a development environment.

Some other useful links:

Hogue answered 26/5, 2010 at 8:58 Comment(2)
Also, once you have the minidumps back on your own machine, set up a symbol server with all the pdb files from your build and then in windbg the !analyze -v command is your friendHogue
Another option worth consideration is the Desktop Error Monitoring programme if this is for internal software tools: blogs.msdn.com/b/wer/archive/2010/05/30/…Hogue
S
0

It seems my question was either obvious or stupid (both ?) but anyway, i found some interesting pages after some researches.

Here are the links I found useful:

Sandwich answered 26/5, 2010 at 8:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.