Access violation

Access violation

Here's another problem - when running my code I am getting an access violation. The problem is that this is occurring after the program has reached the END PROGRAM statement. Since this is not occurring on any executable line in the program, there is no way I can debug the cause of the problem, such as putting in print statements in the code. I have tried setting this up as a console application and also as a QuickWin application, but get the same result. Anyone out there ever encounter this problem, and, if so, any suggestions on tracking this down?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

A common cause of this symptom is corruption of the stack. I agree that this can be VERY difficult to debug. What I usually do in such cases is find out what instruction is generating the access violation and where it got the address (usually some prior load instruction. I then step through the program and see if the source of the address gets overwritten with something.

Another thing you can do is start commenting out sections of the program to see what section, when removed, causes the problem to go away. You can then narrow down the source of the error.

Steve

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today