Interuppt C Runtime error on minidump system

Basically minidump system does not dectect error that called from out - of - the - ragne error on STL or pure virtual function on run time.

Minidump only handles Structured Exception.Error on above are assimilating at C runtime library.

Therefore it has to pass to Structured Exception before it assimilated on C runtime library which mean you need to relay it for leaving error dump.

Here is how to leave error dump

"Pure virtual function called" relay error to minidump

void myPurecallHandler(void)
{
printf("In _purecall_handler.");
int* a = 0;
*a = 1; // Occuring chrash. relay to minidump.
}
int main()
{
/* pure virtual function called relay error handler to user defined function.
You need to put it for firstime when you start program. */
_set_purecall_handler(myPurecallHandler);
...
}

relay “out of the range error” on STL to mini dump system

  • Caution!!- You need to ignore retportType == _CRT_WARN because if _CrtSetReportHook use ATLTRACE, it may enter to fixed function.
int YourReportHook(int reportType, char *message, int *returnValue)
{
// Ignore _CRT_WARN or 0
if (reprotType != _CRT_WARN)
{
int* a = 0;
*a = 1; // Occuring crash. relay to minidump
}
return 1;
}
int main()
{
/* relay handler of C runtime library error to user defined function.
You need to put it for firstime when you start program. */
_CrtSetReportHook(YourReportHook);
std::vector<int> a;
a[1] = 0; // Testing error handler is relayed or not
}