Access Violation Errors - Can Memory Leaks cause these?

Discussion in 'C++' started by nmehring@gmail.com, May 29, 2008.

  1. Guest

    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!CMapPtrToPtr::GetValueAt
    STATUS_ACCESS_VIOLATION_c0000005_MyBaseClass.dll!CGlobal::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?

    Nicole
     
    , May 29, 2008
    #1
    1. Advertising

  2. Guest

    On May 29, 3:06 pm, "" <> wrote:
    > 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!CMapPtrToPtr::GetValueAt
    > STATUS_ACCESS_VIOLATION_c0000005_MyBaseClass.dll!CGlobal::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.
     
    , May 29, 2008
    #2
    1. Advertising

  3. seljuk Guest

    On 29 Mayýs, 23:06, "" <> wrote:
    > 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!CMapPtrToPtr::GetValueAt
    > STATUS_ACCESS_VIOLATION_c0000005_MyBaseClass.dll!CGlobal::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?
    >
    > Nicole


    It seems like a memory allocation problem. You are trying to use a
    memory place which is not allocated or already released. I think you
    have to check your object creation/release sections.
     
    seljuk, May 29, 2008
    #3
  4. Guest

    I suspect this part of the question may belong in a different
    newsgroup, but I will ask here so you can provide your opinion from an
    MFC standpoint.

    This user's operating system was built up from an existing image.
    They say they have tried reapplying the image, and have also replaced
    her workstation (and applied an image) to the workstation. Is it
    possible that a problem in the OS image is causing these flakey
    sporadic memory allocation errors in our MFC app?

    Any suggestions as to which newsgroup may be more appropriate for a
    question like this?
     
    , May 30, 2008
    #4
  5. Lionel B Guest

    On Fri, 30 May 2008 09:09:12 -0700, wrote:

    > I suspect this part of the question may belong in a different newsgroup,
    > but I will ask here so you can provide your opinion from an MFC
    > standpoint.


    This whole thread belongs in a different newsgroup. MFC is *not* on topic
    here. Please see:

    http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.9

    Which contains suggestions for more appropriate groups.

    --
    Lionel B
     
    Lionel B, May 30, 2008
    #5
  6. Jim Langston Guest

    wrote:
    > 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!CMapPtrToPtr::GetValueAt
    > STATUS_ACCESS_VIOLATION_c0000005_MyBaseClass.dll!CGlobal::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?


    It may be that the application is running out of memory, either physical
    memory or paged memory. Check how much memory that computer has compared to
    the ones that run your application fine.

    --
    Jim Langston
     
    Jim Langston, May 31, 2008
    #6
  7. Guest

    On May 30, 8:48 pm, "Jim Langston" <> wrote:
    > wrote:
    > > 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!CMapPtrToPtr::GetValueAt
    > > STATUS_ACCESS_VIOLATION_c0000005_MyBaseClass.dll!CGlobal::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?

    >
    > It may be that the application is running out of memory, either physical
    > memory or paged memory.  Check how much memory that computer has compared to
    > the ones that run your application fine.
    >
    > --
    > Jim Langston
    > - Hide quoted text -
    >
    > - Show quoted text -


    The OS Image was not the problem. The errors were caused by a bug,
    specifically trying to ask DAO to move to a record which the program
    thought existed, but did not exist. I suspect that the symbol
    information was inaccurate so the dump file analysis was inaccurate.

    Replicating the issue required a very specific long sequence of user
    actions combined with some special options and some minor user
    errors. I found the issue by having someone unfamiliar with our
    software test for a bit while recording his actions. He replicated
    the bug in 6 minutes, but could never replicate it again after that
    point because he only made the user errors the first time. Having
    lost a couple weeks of my life to this problem, next time around I am
    going to try an inexperienced tester much sooner!
     
    , Jun 11, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Novice
    Replies:
    28
    Views:
    5,171
    Jon Skeet
    Jul 22, 2003
  2. Kyle Teague
    Replies:
    3
    Views:
    671
    David White
    Nov 26, 2003
  3. Bengt Richter

    time.mktime memory access violation bug

    Bengt Richter, Nov 18, 2003, in forum: Python
    Replies:
    6
    Views:
    716
    Bengt Richter
    Nov 21, 2003
  4. Bit byte

    Memory (read) access violation handling in C

    Bit byte, Jun 18, 2006, in forum: C Programming
    Replies:
    4
    Views:
    629
    Dave Thompson
    Jun 26, 2006
  5. Replies:
    4
    Views:
    138
Loading...

Share This Page