[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [LuaJIT FFI] Crashing when exiting after loading SOIL DLL
- From: Mike Pall <mikelu-1112@...>
- Date: Fri, 30 Dec 2011 00:07:00 +0100
> I'm having issues with loading SOIL (
> http://www.lonesock.net/soil.html ) via LuaJIT 2 beta 9 FFI. The
> library works and loads textures, however, when the script finishes,
> the luajit interpreter crashes. Upon termination, the windows
> "luajit.exe has stopped working" window appears, with the following
> Fault Module Name: libgcc_s_dw2-1.dll
Well, it crashes in libgcc, which is kind of unusual.
Some C libraries do not react well if their DLL is explicitly
unloaded (which is caused by closing the Lua state). What happens
if you use os.exit(0) at the end of your script?
Another possibility is that you've made some mistake in using the
library that corrupted some memory, which causes a crash later on.
Try to reduce your program until it no longer crashes.
> I've searched for a solution on Google, but didn't find anything
> relevant. I've updated MinGW, but no help. GDB didn't provide any
> special output, other than the fact that the program exited with
> return code 03.
You can install WinDbg and turn on 'just-in-time debugging'
(google for it, doesn't have anything to do with a JIT compiler).
Then whenever you get a crash, WinDbg automatically starts up and
you can look at a backtrace. However, I doubt the info is very
helpful for a crash inside libgcc ...