I'm trying to load a chunk of Lua from some text not stored on the file system. I added an element to package.loaders
to do this from C. As soon as I call lua_load
, in C, to load/execute the chunk, the application aborts, crashes, no exception was raised. The app is gone.
This is a pretty big problem. Right now I'm trying to debug this one problem, but what happens if this happens in production for real? I must be missing something. How do we write quality, production code without LuaJIT aborting the app? I'm missing something. What am I missing?
A related SO article suggested running the app with regular Lua. I did it and it worked fine. So something in LuaJIT doesn't like my code. I can't find it.
I may be asking two questions:
How to find the specific problem with this particular code right now. Works in regular Lua, fails in LuaJIT.
How do we use LuaJIT so that when it hits something it doesn't like, that it won't completely abort the entire process?
The crash in LuaJIT is in lib_package.c at lua_call(L, 1, 1); /* run loaded module */
which is around line 431
.