views:

61

answers:

2

I am getting weird problem, the crash happens at random times, for example i managed to use the 3d app for a while without crashing, then most of the times it crashes always when i suddenly render a lot of objects at same time.

I have recently noticed that changing the huge texture surface on this ATI card will crash my whole computer when using huge texture sizes and a lot of them and switching from one to another in one frame. So it is a possibility i have broken ATI card or just buggy one. But it is imporobable since i've added some code lately and now i have noticed this crash first time. I didnt use any special opengl calls, just the good old glbegin() glend() glcolor() etc...

If i comment out the line where it crashed previously, for example glBegin(GL_QUADS) ... glEnd() Then next time i get crash on different openGL function call at different place of my code, for example glColor4f() and then i comment that out, and the next crash i get at glClear() at totally different part of the rendering code!

What could be causing these? Im using ATI card, and i am aware some opengl calls may crash the program if they are using improper values, like glLineWidth(4) will crash some ATI cards on a random line of openGL code because the max line width is 3!

Edit:

When i run the program in debug mode with ApplicationVerifier, it throws me this line:

if(!(PixelFormat = ChoosePixelFormat(hDC, &pfd))){

I dont understand, what could possibly be wrong on it?

pfd:

static PIXELFORMATDESCRIPTOR pfd = {
   // *correct amount of elements*
};
A: 

Such random behaviour is usually the symptom of a stack/heap corruption. You should check that you're not corrupting the heap and/or the stack. Buggy drivers is also a option, since crashing on a invalid value is a bug, that should not crash and instead produce a GL error.

Matias Valdenegro
How do i check that heap corruption...
Newbie
Use Valgrind, see http://en.wikipedia.org/wiki/Valgrind
Matias Valdenegro
That desnt support windows >_>
Newbie
A: 

IMO, chances are pretty good that the crash in OpenGL is only a symptom, and the real problem lies elsewhere. In general, your description sounds more or less typical for resource misuse (e.g., memory leakage, using a dangling pointer, trashing the heap, etc.)

Something like a driver bug is certainly possible -- in fact a graphics driver is big and complex enough that some bugs are probably almost inevitable. The obvious test for that would be to run other code that uses OpenGL and see if it works dependably. It's always possible that you're using an execution path that contains a bug, but is so obscure almost nothing else uses it so the bug isn't otherwise triggered -- but given that the crash isn't happening in a fixed location, that seems fairly unlikely (still possible, just unlikely). If a graphics driver has a bug (especially one serious enough to cause crashes, not just mis-rendering), it usually becomes known pretty quickly.

Jerry Coffin
Seems like you are right... i slipped through the big textures in the debug folder >_> no longer crashes! But still doesnt help with the application verifier tool error line, i have no idea whats that about :7
Newbie