Misc. errors

hi, theres 2 issues that im having with sdl and gl in win32 (im using msvc++ 6.0).

My first problem is thaty when im running a windowed sdl/gl app and i minimize it it crashes. Does anybody know a way to fix this?

My other problem is that whenever I run a sdl/gl app i notice when i am just running it in debug mode (since it can report memory leaks and stuff) i get the error:
HEAP[Client.exe]: Invalid Address specified to RtlFreeHeap( 130000, 145b30 )

I get this error even if i just do an sdl init and set a gl video mode then sdl_quit…just a barebones program. I also get this error when i run the simple gl source available for download from the SDL homepage.

Any ideas whats happening? At one point a person testing my app hit exit and their computer rebooted…mostly though it just crashed as it exited though with nothing visibly wrong.

hi, theres 2 issues that im having with sdl and gl in win32 (im using msvc++ 6.0).

My first problem is thaty when im running a windowed sdl/gl app and i minimize it it crashes. Does anybody know a way to fix this?

My other problem is that whenever I run a sdl/gl app i notice when i am just running it in debug mode (since it can report memory leaks and stuff) i get the error:
HEAP[Client.exe]: Invalid Address specified to RtlFreeHeap( 130000, 145b30 )

Have you run these in the debugger to find out where it’s crashing and
where it’s trying to free invalid memory?

Have you tried with the latest CVS snapshot to see if this has been fixed?
http://www.libsdl.org/cvs.php

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Make sure that you’re running with the multithreaded dll selected for your project and any subproject/dlls that it uses. I had similar strangeness with a VC6/SDL/GL project before I corrected that error.

Also try using something similar to this routine to verify that your heap is not corrupted:

#include <malloc.h>
// -----------------------------------------------------------------
// ‘msg’ should be some identifier of the calling context
// -----------------------------------------------------------------
void CheckTheHeap( CHAR *msg )
{
assert( msg );

INT32 heapstatus = _heapchk();
switch( heapstatus )
{
case _HEAPOK:
gApp->Print( “CHECKTHEHEAP:: %s: OK - heap is fine\n”, msg );
break;

case _HEAPEMPTY:
gApp->Print( “CHECKTHEHEAP:: %s: OK - heap is empty\n”, msg );
break;

case _HEAPBADBEGIN:
gApp->Print( “CHECKTHEHEAP:: %s: ERROR - bad start of heap\n”, msg );
exit( SYSERR );
break;

case _HEAPBADNODE:
gApp->Print( “CHECKTHEHEAP:: %s: ERROR - bad node in heap\n”, msg );
exit( SYSERR );
break;
}
}

-Blake----- Original Message -----
From: Atrix Wolfe
To: sdl at libsdl.org
Sent: Tuesday, July 23, 2002 9:59 AM
Subject: [SDL] misc. errors

hi, theres 2 issues that im having with sdl and gl in win32 (im using msvc++ 6.0).

My first problem is thaty when im running a windowed sdl/gl app and i minimize it it crashes. Does anybody know a way to fix this?

My other problem is that whenever I run a sdl/gl app i notice when i am just running it in debug mode (since it can report memory leaks and stuff) i get the error:
HEAP[Client.exe]: Invalid Address specified to RtlFreeHeap( 130000, 145b30 )

I get this error even if i just do an sdl init and set a gl video mode then sdl_quit…just a barebones program. I also get this error when i run the simple gl source available for download from the SDL homepage.

Any ideas whats happening? At one point a person testing my app hit exit and their computer rebooted…mostly though it just crashed as it exited though with nothing visibly wrong.

i have it set to multi threaded dll but that heap checking function will come in handy for debugging further. Thanx (:----- Original Message -----
From: Blake Senftner
To: sdl at libsdl.org
Sent: Tuesday, July 23, 2002 12:05 PM
Subject: Re: [SDL] misc. errors

Make sure that you’re running with the multithreaded dll selected for your project and any subproject/dlls that it uses. I had similar strangeness with a VC6/SDL/GL project before I corrected that error.

Also try using something similar to this routine to verify that your heap is not corrupted:

#include <malloc.h>
// -----------------------------------------------------------------
// ‘msg’ should be some identifier of the calling context
// -----------------------------------------------------------------
void CheckTheHeap( CHAR *msg )
{
assert( msg );

 INT32 heapstatus = _heapchk();
 switch( heapstatus )
 {
 case _HEAPOK:
    gApp->Print( "CHECKTHEHEAP:: %s: OK - heap is fine\n", msg );
    break;

 case _HEAPEMPTY:
    gApp->Print( "CHECKTHEHEAP:: %s: OK - heap is empty\n", msg );
    break;

 case _HEAPBADBEGIN:
    gApp->Print( "CHECKTHEHEAP:: %s: ERROR - bad start of heap\n", msg );
    exit( SYSERR );
    break;

 case _HEAPBADNODE:
    gApp->Print( "CHECKTHEHEAP:: %s: ERROR - bad node in heap\n", msg );
    exit( SYSERR );
    break;
 }

}

-Blake
----- Original Message -----
From: Atrix Wolfe
To: sdl at libsdl.org
Sent: Tuesday, July 23, 2002 9:59 AM
Subject: [SDL] misc. errors

hi, theres 2 issues that im having with sdl and gl in win32 (im using msvc++ 6.0).

My first problem is thaty when im running a windowed sdl/gl app and i minimize it it crashes.  Does anybody know a way to fix this?

My other problem is that whenever I run a sdl/gl app i notice when i am just running it in debug mode (since it can report memory leaks and stuff)  i get the error:
HEAP[Client.exe]: Invalid Address specified to RtlFreeHeap( 130000, 145b30 )

I get this error even if i just do an sdl init and set a gl video mode then sdl_quit...just a barebones program.  I also get this error when i run the simple gl source available for download from the SDL homepage.

Any ideas whats happening? At one point a person testing my app hit exit and their computer rebooted...mostly though it just crashed as it exited though with nothing visibly wrong.