The MFC program I am debugging is printing this message in the "Output" window in Visual Studio 9.0:
HEAP[AppName.exe]: Invalid allocation size - 99999998 (exceeded 7ffdefff)
I'm pretty sure this is due to a bad "new", uninitialized variable or similar error.
The question is: how do I get the debugger to stop on this message so that I can view the stack trace and solve the problem?
Edit: The following snippets do not yield the same warning. They produce the Invalid allocation size: 4294967295 bytes.
style message instead.
int stupid = -1;
char *bob = new char[stupid];
And:
malloc(-1);
So, I suspect it's coming from within a system DLL with its own memory management or is using a different API.