One of my programs crashes periodically, but I don’t know why. I’m running it in debug mode, but nothing pops up. The program just suddenly exits. I’ve had other bugs that do throw an exception…but not this one. Is there a magical way of catching it or something?
Share
Presumably you’re running it from within Visual Studio and for some reason it’s not stopping in the debugger with an uncaught exception, in which case you could try catching the crash from outside of Visual Studio. See my answer at System.AccessViolationException from unmanaged code?, in particular how to capture a crash dump.
If it only crashes periodically, but within a reasonably short period of time, start with Sysinternals procdump. Start your executable from outside Visual Studio, then run:
and wait for it to harvest a crash dump – assuming it exits due to an unhandled exception – then load the crash dump into VS 2010 or WinDbg.