GL Bug

Ok Sam, i know ive refered to this bug a couple times and each time you asked me if i tried with the latest cvs snapshot but i was always too lazy to try it…until now (;

yes, im still getting an error on sdl_quit() with the cvs snapshot as of yesterday.

System Specs:
Im using MSVC++6.0 in windows 2000. I have a voodoo3 3000 video card.

What my error is is that if i set the video mode with SDL_OPENGL, it throws a fit when i reach SDL_Quit. It says (in my compiler status window):

HEAP[SDLGLTest.exe]: Invalid Address specified to RtlFreeHeap( 130000, 1d1368 )
The program ‘E:\My Documents\SDL\SDLGLTest\Debug\SDLGLTest.exe’ has exited with code 0 (0x0).

This has been happening in my program so i tested it with the example program at http://sdldoc.csn.ul.ie/guidevideoopengl.php and i get the same results. Then i decided to just have it set a GL vmode and quit to make doubly sure it wasnt just bad code interfacing with SDL. Same problem. I get this no matter what resolution, fullscreen or windowed.

Im not quite sure how id trace the code into SDL’s code since i compiled it into a DLL, but if you need more info or some test code ran or anything let me know and im more than happy to oblige.

Atrix Wolfe wrote:

ok well i figured out how to trace into the code…so heres some info
ive gathered.

ok…from SDL_Quit it gets into VideoQuit…
from there it goes into here:

/* Clean up the system video */
video->VideoQuit(this);
from there (which is DX5_VideoQuit)
it goes here:

WIN_GL_ShutDown(this);

from there (WIN_GL_ShutDown) it goes here:

this->gl_data->wglDeleteContext(GL_hrc);

and this is where it dies, as i try to trace into that function.

Im not sure if this helps but it looks highly suspect if its a
pointer, but not if its a handle. When it dies…

this->gl_data->GL_hrc==0x00010000

hope this helps (:

OK, commenting out the wglDeleteContext line, i make it all the back
into the program and it gives that heap error at an exit(0)
statement. Looks like some kinda mem corruption to me ::shrug::

First of all, next time when you add details, please add them as replies
in the thread and not as new topics.

I also traced the crash down to the wglDeleteContext line, and I also
have a Voodo card and Windows XP (=2k=NT).
I saw a similar problem when using GLScene (http://www.glscene.org/) -
where it was solved by just avoiding releasing (i.e. “deleting”) context
stuff if it doesn’t work… :slight_smile:

The problem is in the Voodoo OpenGL driver for Windows 2000/XP. There
are no and will be no new drivers, because 3dfx is gone, and the hackers
that post “new” drivers on VoodooFiles.com probably won’t fix it because
they need the drivers’ source code for that.
For a Voodoo card, removing that line still makes it crash later, and in
other cards - the problem isn’t there altogether.

I don’t know how to solve this besides to get another card. I’m using
Delphi, so this problem anly appears when I’m debugging the problem via
the IDE - not while running normally, but I don’t know how it’s with
VC++. What you can try is to put exception catching code around SDL_Quit
(don’t know the syntax of that in C…).

Hope this helps,
RK.