PDA

View Full Version : What is "Access Violation"?



Terl
04-12-2001, 09:29 AM
When I run my OpenGL application I sometimes get this writtin 8000 times in the debug window:

First-chance exception in Game.exe (GDI32.DLL): 0xC0000005: Access Violation.

What does it mean?
How do I fix this error?

Thanks.

rts
04-12-2001, 09:36 AM
It means you're probably passing some bad pointer value to some GDI function... somewhere in GDI32.DLL it is accessing bad memory.


You fix it by not doing that! http://www.opengl.org/discussion_boards/ubb/smile.gif

HFAFiend
04-12-2001, 11:09 AM
yup...some pointer must be NULL

DFrey
04-12-2001, 11:13 AM
Nope. This is actually a bug in the GDI in Win9x. You can safely ignore it (even Quake3 produces those same access violations when run in the debugger).

[This message has been edited by DFrey (edited 04-12-2001).]

rts
04-12-2001, 11:24 AM
Heh.

I'm so glad I'm not a Winblows programmer...

Gabriel
04-12-2001, 11:54 AM
If it is so safe to ignore it why is it making the framerate drop of about 40 fps?

Gorg
04-12-2001, 01:47 PM
Originally posted by Gabriel:
If it is so safe to ignore it why is it making the framerate drop of about 40 fps?


On what do you base this assumption??

HFAFiend
04-13-2001, 11:38 AM
I've never gotten that error...is it nVidia hardware spesific or something? (I run a radeon 64mb vivo + thunderbird + win98)

fathom
04-13-2001, 02:12 PM
I get it sporadically. GF2 MX board. The debugger doesn't seem to choke, so I dunno where it's coming from. I've ignored it and it doesn't seem to affect performance (aside from all the damned messages spitting out.)

MikeC
04-13-2001, 06:26 PM
No, it's not NVidia specific. I've seen it many times with the MS and SGI software renderers. It's a GDI bug and appears pretty much at random. (To the point where it sometimes happens and sometimes doesn't, even with the same build.

Gabriel - I think the performance hit you're seeing is caused by MSVC's handling and reporting of the exception, not the exception itself. I've never been affected by it when running an app standalone.

Gabriel
04-13-2001, 08:09 PM
You are right Mike,
Thank you very much.

That was bugging me for months and I must admit that I never took the time to compare speed of an application from in and out of msvc debuger...

Sorry every body...

duckman
04-14-2001, 07:16 PM
Ok, I thoughth this wouldent come up in a advanced forum, but every ones got the right Idea. I might fill in the gaps though....

(I teach this ****, so heres what I tell my students)

when u get the first chance acess violation try rebuilding(rebuild all) the code. If problem persists You probabley have a minor pointer problem (a reference to invalid memory).

If the message repeats the pointer problem is stuck inside a loop.

The out put to the degug window and the failing of assurtions that cause this is what will slow down the frame rate. This is becuase it is taking up execution time.

generaly people who structure there code well, avoid the first chance eception stuff caused by the compiler.

If you do a" release build" you will not be effected by this.

this problam is not nvida specific its not even opengl specific, it not even win32 specific,
anything produced by msvs / msvc can have this.

DFrey
04-14-2001, 08:14 PM
Sorry duckman, you obviously are not familiar with the bug. This particular access violation is in Microsoft's GDI code. It sporadically occurs on Win9x machines when debugging OpenGL code. It is not a result of any error in one's OpenGL program. Any OpenGL program run in the MSVC debugger will, seemingly randomly, produce thousands of these access violations or none.

duckman
04-14-2001, 10:34 PM
Yes I am aware of the bug (Its a very common one after all)

Ive also seen the problem out of the gdi context (even in console apps)

but it isn't the only thing that can cause the problem.
(Thats what I was trying to get across)