> lua_pushstring(L, NULL); // Shouldn't work, should it? Although the manual doesn't say it, this equivalent to lua_pushnil(L); See http://www.lua.org/source/5.1/lapi.c.html#lua_pushstring > However, the application exits Are you sure it exists at that point? Build Lua with LUA_USE_APICHECK turned on. See luaconf.h.