SDL_Quit() called inside a DLL using MINGW gives page fault on W98?

Hi all

I recently developed a small program in Rh9 usind SDL 1.2.6 that worked
correctly. Compiled in W98 using MINGW as an .EXE it also runs correctly.

However, compiling the program as a DLL and then calling the DLL works, but on
executing an exit(); inside the DLL code it always aborts with a page fault.
I traced the problem to the atexit(sdl_quit) line. I removed this and the
program now runs without a page fault.

My question: Is it a known occurrence that doing sdl_quit() inside a DLL under
Windows causes a page fault? Or do I have a memory leak somewhere that does
not emerge in Linux but only on Windows? If I have a memory leak or
something, why does the code, ran inside an EXE, NOT cause a page fault?

Or is this a “feature” of a DLL, i. e. at_exit() code is not allowed inside
it?

Thanks!–

Stefan Viljoen
Software Support Technician
Polar Design Solutions

I’m not exactly sure about your setup, but I’ve had weird atexit() problems
on Win32 alot. One thing that has seemed to work with me is to pass
SDL_INIT_NOPARACHUTE to SDL_Init(). It’s kinda a hack, since I still
haven’t figured out why passing it fixes the problems I was having, or even
what was causing the problems in the first place. (BTW, I know somebody’s
gonna say it, so I’m gonna head them off: these crashes happen nomatter how
simple I make the SDL app, or how I muck with the compile settings, and it
happens in MinGW, Cygwin, and MSVC++7).

If this doesn’t help, perhaps you can re-define the way you need your
project setup (as I mentioned, I couldn’t parse what your exact setup is,
so…) to not require the .DLL.

  • Alex “Silicon” Lyman> ----- Original Message -----

From: rylan@intekom.co.za (Stefan Viljoen)
To:
Sent: Monday, April 26, 2004 7:05 AM
Subject: [SDL] SDL_Quit() called inside a DLL using MINGW gives page fault
on W98?

Hi all

I recently developed a small program in Rh9 usind SDL 1.2.6 that worked
correctly. Compiled in W98 using MINGW as an .EXE it also runs correctly.

However, compiling the program as a DLL and then calling the DLL works,
but on
executing an exit(); inside the DLL code it always aborts with a page
fault.
I traced the problem to the atexit(sdl_quit) line. I removed this and the
program now runs without a page fault.

My question: Is it a known occurrence that doing sdl_quit() inside a DLL
under
Windows causes a page fault? Or do I have a memory leak somewhere that
does
not emerge in Linux but only on Windows? If I have a memory leak or
something, why does the code, ran inside an EXE, NOT cause a page fault?

Or is this a “feature” of a DLL, i. e. at_exit() code is not allowed
inside
it?

Thanks!


Stefan Viljoen
Software Support Technician
Polar Design Solutions


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.659 / Virus Database: 423 - Release Date: 4/15/2004