0xC0000005 Access Violation

Hi, i'm developing an application on embedded Visual C++ 4 sp4 under windows CE.NET, and everithing works fine, but after a while the program crashes in the next line

dataBloqueptr->data = new unsigned __int8 [total];

telling me that an 0xC0000005 Access Violation has happenned, the strange thing is that by the time the program crashes the line and the function that contains it have been executed a lot of times without problem.

So please, can you tell me how to debug this problem, and what does it means the error, i think there's a problem with memory allocation, but i have checked over and over and i'm pretty sure that i'm not using null pointers.

I also have noticed that when i debug my program step by step the error never appear, does this mean something

Thanks in Advance.




Answer this question

0xC0000005 Access Violation

  • D.A.C.

    This 00000005 messege will come up after installing Norton systemworks,it will shut down and show a driver error,this error is the apropos spyware C/.If for some reason you lose your desk top and toolbar,(LIKE I DID!),hit your control alt delete-hit the task until it shows your desktop items.Once you've done this,type in desktop,it should go to your desktop-and also bring back your toolbar as well.But here's what i found out,When you go to symantec web site.,to solve the aprrpos porblem,it will show you some very confuseing ways includeing,deleteing it manually.(PLEASE DO NOT DO THIS),also it will tell you to go to your registry,(PLEASE DO NOT DO THIS!)Click on the part it shows how to start your computer in safe mode.Print this out and follow it exact.Once your in safe mode,do a full system scan-it may take at least 2 hours,but make sure you monitor it.Once it's done,and shows the apropos hit the remove,it should remove all of it.If you go to the register and look for the other things Symantec tells you to look for.(YOU MAY OR MAY NOT FIND IT).PLEASE DON'T BOTHER WITH THIS (OR)try any other method.Okay after you remove the software,by the anti-virus.Hit run and "msconfig"-it should show you the option to restart in a regular mode.(DO THIS!).restart the computer,and bingo the apropos is gone!

  • SWB108

    Hi, Olafje, thanks a lot, this solved the problem and now i'm almost done with my application. Thanks again

  • Bendoke

    One thing that can go wrong is memory alignment.
    Acces to uneven memory adresses is not allowed within some ARM CPU.
    If you use pointers to memory blocks which acces unaligned meory define the as UNALIGNED.
    char * UNALIGNED tszMemoryCharBUF
    I had some problems with this and this is how I solved it.
    I also changed the default struct member alignment to 1 Byte in the project options.
    The UNALIGNED keyword will cause the compiler to optimize the memory acces.
    On normal deskstop CPU you dont have this problem as the processor fixes this.

    The uneven mermoy acces can give you problems anywhere in youre code!

    Hope this can Help


  • MattClayF

    Olafje,

    That's a good point. I've seen this. The errors that I saw with this problem were called "Unaligned memory" exceptions in eVC.



  • Jason Prell

    i have a similiar problem..

    when i switch from debug to release mode..

    then it give me this crash..

    the cause is because of PostMessage i used...

    but i dun know why PostMessage could cause this crash..

    issit because of the windows handler that i pass into the PostMessage is invalid



  • alll

    had the same problem with XP. Found out it had something to do with a norton alert concerning Spyware.Apropos.C. Finally fixed everything by running liveupdate then restarting in safe mode then doing a full system scan while in safe mode. Worked perfectly. let me know if this works for anyone else. Good Luck.

  • Eric Jarvi

    buckabucka wrote:
    This 00000005 messege will come up after installing Norton systemworks,it will shut down and show a driver error,this error is the apropos spyware C/.If for some reason you lose your desk top and toolbar,(LIKE I DID!),hit your control alt delete-hit the task until it shows your desktop items.Once you've done this,type in desktop,it should go to your desktop-and also bring back your toolbar as well.But here's what i found out,When you go to symantec web site.,to solve the aprrpos porblem,it will show you some very confuseing ways includeing,deleteing it manually.(PLEASE DO NOT DO THIS),also it will tell you to go to your registry,(PLEASE DO NOT DO THIS!)Click on the part it shows how to start your computer in safe mode.Print this out and follow it exact.Once your in safe mode,do a full system scan-it may take at least 2 hours,but make sure you monitor it.Once it's done,and shows the apropos hit the remove,it should remove all of it.If you go to the register and look for the other things Symantec tells you to look for.(YOU MAY OR MAY NOT FIND IT).PLEASE DON'T BOTHER WITH THIS (OR)try any other method.Okay after you remove the software,by the anti-virus.Hit run and "msconfig"-it should show you the option to restart in a regular mode.(DO THIS!).restart the computer,and bingo the apropos is gone!

    I have lost my toolbar and all my desktop icons. I can only access the Task Manager by pressing Ctrl, Alt and Del. But how do I 'hit the task' until my desktop icons reappear Any help would be appreciated.

    Thanks



  • Tom Kelley

    The access violation is given because you have accessed memory outside it's allowable bounds. Are you sure that the dataBloqueptr has been allocated correctly If not you would be attempting to set a parameter outside memory bounds.

  • Arun79

    hi

    i am having the same problem, code that works fine, stops working saying this access violation, it makes no sense, definitely its some memory problem, but what and how to solve, if you have found a solution, could you please tell me 2.

    Thanks
    Abhi


  • 0xC0000005 Access Violation