OnFatalException not called for crashes detected in MSVC Runtime

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
tinman
Earned a small fee
Earned a small fee
Posts: 20
Joined: Mon Jun 18, 2007 2:10 pm

OnFatalException not called for crashes detected in MSVC Runtime

Post by tinman »

Hello,

I am trying to use wxCrashReporter but find that it does not catch all types of fatal errors under MSW. I am using 3.1.0 and was using VS2008 32 bit but have since also tried VS2013 32bit and 64bit. I am running on Windows 7 64 bit.

The problem I have is that if I try to perform some invalid operation that the MS VC runtime detects then the application is terminated without OnFatalException() being called. If I run the debugrpt sample then I can generate the "Report for crash" and it is caught. However, if I add some dummy code, similar to a problem I had recently that is driving this addition, to the debugrpt sample:

Code: Select all

static void bar(const char *p)
{
    std::vector<int>    v(10, 0);
    v.insert(v.begin() + 50, 20);
Then one of a few things happens, making it difficult to decide whether to file a bug report for wxCrashReport not catching all fatal exceptions:
  • VS2008 application terminates with message "Microsoft Visual Studio C Runtime Library has detected a fatal error in debugrpt.exe" or the normal Windows application has crashed window.
  • VS2013 32 and 64 bit tend to not crash at the line of the insert - seems the VC runtime checks for this case and uses end of vector instead of using an invalid address.
Anyway, my question is, has anyone successfully managed to capture these kinds of invalid operations / crashes rather than having the MS VC runtime detect it and terminate without running the crash report?
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: OnFatalException not called for crashes detected in MSVC Runtime

Post by doublemax »

I can't give advice about this specific problem, but i highly recommend to use Crashrpt instead of wxCrashReporter: http://crashrpt.sourceforge.net
Use the source, Luke!
Post Reply