Visual C++ program crashed, but no dumpfile generated. why?

前端 未结 1 1293
青春惊慌失措
青春惊慌失措 2020-12-20 00:11

I have a very strange situation. I\'m running IOCP Server Program programmed by Visual studio 2010 in C++.

It uses \'minidump\', so When there is a logical bug like

相关标签:
1条回答
  • 2020-12-20 00:25

    Well, of course you don't know because you don't have a minidump to look at. You should do the absolute minimum when the SetUnhandledExceptionFilter callback fires. The process is in a perilous state. It crashed. Locks might be held, the heap locks are particularly troublesome. You can't expect MiniDumpWriteDump() to succeed.

    What you need is a little guard process that waits on a named event. Start it up as early as possible in your main() function and pass it your process ID. The guard process waits on both that event and your process handle. In your exception callback, just signal the event and immediately sleep for a long time. That wakes up the guard process, it calls MiniDumpWriteDump() plus whatever else is necessary to let you know about the crash. And kills your main program.

    0 讨论(0)
提交回复
热议问题