lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Alex wrote:
> I'm having issues with loading SOIL (
> ) 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
> information:
> [...]
>   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 ...