I have my application(VC MFC) run with gflags with Pageheap enabled to track down the page heap corruption.
Now the application has crashed and it shows this error, I could not interpret these lines (other than having a feel of resource inavailablity)
Can anyone throw a light on what exactly is the reason that has caused the crash of the app?
(info: Application is a multithreaded one about 500 threads running,in a multi - processor machine)
kernel32!RaiseException+53
msvcrt!_CxxThrowException+36
mfc42u!AfxThrowResourceException+19
mfc42u!AfxRegisterWndClass+ab
mfc42u!CAsyncSocket::AttachHandle+5c
mfc42u!CAsyncSocket::Socket+25
mfc42u!CAsyncSocket::Create+14
I wonder if this is your actual heap corruption issue, or if your program has just hit a resource limitation as a consequence of running with Pageheap.
I can't remember the exact details, but Pageheap incurs extra memory overhead, so much so that you can run out of memory much sooner than you would without Pageheap enabled.
With 500 threads running, you have a 1MB stack for each, plus any memory they've allocated dynamically along the way.
CAsyncSocket::AttachHandletriggersAfxThrowResourceExceptionif it can't create a window. It seems that your system is saturated due to Pageheap.Do you have to have 500 threads running to reproduce the problem? Maybe if you could lower that count a little, there would be more resources available.