BugTrap icon indicating copy to clipboard operation
BugTrap copied to clipboard

An error with map erase that BugTrap seems cannot capture?

Open jnnpsubm opened this issue 8 years ago • 1 comments

`#include <Windows.h> #include "BugTrap\BugTrap.h" #include

#pragma comment(lib, "BugTrap\BugTrapU.lib") // Link to Unicode DLL

void SetupExceptionHandler();

int main() { SetupExceptionHandler(); BT_SetTerminate();

std::map<int, int> idMap;
idMap[0] = 1;

idMap.erase(idMap.begin());
idMap.erase(idMap.begin()); // BugTrap cannot capture this exception with my pc and environment
//int* ptr = 0; *ptr = 0; // BugTrap can capture this exception

return 0;

}

void SetupExceptionHandler() { BT_InstallSehFilter(); BT_SetFlags(BTF_DETAILEDMODE | BTF_EDITMAIL); }`

jnnpsubm avatar May 22 '17 09:05 jnnpsubm

It's not a bug, it's an OS feature :)

Heap exceptions treated as critical errors and handled by the kernel itself(send info to WER then terminate process) and didn't dispatched to the user mode.

Such behaviour can't be changed without dirty, OS specific hacks.

So WER reports is useful for debugging such errors.

NeoAnomaly avatar Oct 15 '17 08:10 NeoAnomaly