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

﹥>﹥吖頭↗ 提交于 2019-12-23 05:48:05

问题


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.


回答1:


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:

  • http://www.debuginfo.com/articles/effminidumps.html - some useful sample code
  • http://www.codeproject.com/KB/debug/postmortemdebug_standalone1.aspx



回答2:


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:

  • Track application crashes and disable Windows Error Reporting at the same time!
  • Disable error reporting


来源:https://stackoverflow.com/questions/2911097/detect-redirect-core-dumps-when-a-software-crashes-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!