the title almost says it all. I have a program which consists of thousands of lines. Recently I started
getting messages that the heap is corrupted. Visual Studio 2008 is the messenger of doom delivering
the news. As I understand, the problem could be almost anywhere but if we presume for the moment
that the DLLs aren't the problem, is it possible to corrupt heap with only a few function calls and without
any dynamic memory allocation?
---------- Post added at 02:31 PM ---------- Previous post was at 02:20 PM ----------
And in addition, if anyone knows what the following is symptomatic of, I'll declare you my personal saviour :)
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
const int size = 2 << 15;
int* mem = new int(size);
memset(mem, 0, size); // Crash executing this statement!
return 0;
}
With value 15, it'll result in crash with notification: "Unhandled exception at 0x01652aad in myprog.exe: 0xC0000005: Access violation writing location 0x003c0000."With 14, it'll crash later on and for other reasons (it appears).
Is this something that would be the result of heap corruption?
I personally have never faced heap corruption so I'm not sure ..


Sign In
Create Account


Back to top










