I am sure we have all seen access violations occur since we took ownership of our first x86 PC's. The infamous "Bluescreen", application crashes, it doesn't really matter, access violations are all over the place. For any of you that remember the good old Windows 9x days, a General Protection Fault and Invalid Page Fault are basically the same thing (and a segmentation fault too). To many people, the phrase 'access violation' is synonymous with "crash". But what exactly is an access violation?
To put it simply, an access violation occurs any time an area of memory is accessed that the program doesn't have access to. This can be due to bad code, faulty RAM or even a bad device driver. It really doesn't matter who the culprit is, the root issue is basically the same. For instance, memory location zero is reserved for the operating system, so any application that tries to access this address will crash with an access violation. The problem with this is that it is very easy to end up with a value of zero. If you set a pointer and initialize the value to NULL (which is 0), then try to access it, you will crash in this fashion. We call this a NULL Pointer and it is very common. The error you will receive should be similar to the following:Unhandled exception at 0x00032b15 in Application.exe: 0xC0000005: Access violation reading location 0x00000000