On May 29, 3:06*pm, "nmehr...@gmail.com" <nmehr...@gmail.comwrote:
I have an MFC app with 2000 users. *I have one user that experiences a
crash in our software anywhere from 1 to 5 times a week when opening a
particular module. *No other users have reported this particular crash
so I don't think anyone else is experiencing it but I know other users
are doing exactly what she is doing because it is our most popular
module.
I have analyzed the dmp files from several of this user's crashes
using windbg and all of the crashes seem to occur in widely different
places.
Here are 3 of them:
STATUS_ACCESS_VIOLATION_c0000005_MFC42.DLL!CMapPtr ToPtr::GetValueAt
STATUS_ACCESS_VIOLATION_c0000005_MyBaseClass.dll!C Global::GetID
HEAP_CORRUPTION_c0000005
I have noticed lately that the application has some memory leaks, but
it was my understanding that a Microsoft XP system (which is the OS
for this user) would not crash due to memory leaks. *Any takers on
that? *Can an Access Violation error be caused by a memory leak?
Much of that is system specific, and OT here, you should ask in a MS
newsgroup.
But that being said, memory leaks (eg. you forget to free a block of
allocated memory when you're done with it) by themselves do not
directly cause access violations or the equivalent, since all you've
done is lost track of some allocated memory. The segfault (or
whatever) can really only happen if you try to access memory that
*isn't* allocated.
OTOH, if you leak enough memory, you'll run out of memory to allocate
(either by running out of real/virtual memory on the system, or by
running out of address space for the process). And if your new/malloc/
whatever fails, and you don't handle that correctly (which is
unfortunately common) you can quickly find your dereferencing a bad
pointer, which does commonly segfault.
OTTH, since the system appears to be reporting heap corruption, you
may want to look for dangling pointers - IOW, pointers that point to
areas of memory that are freed - storing into such areas can easily
corrupt the heap on many systems. Or just stores via bad pointers in
general.
If you think you've got memory management problems, a tool like
Valgrind or Purify might be helpful.