Make sure to include the custom lua_neutralize_longjmp function when using the system lua library. diff -Nrup a/hslua.cabal b/hslua.cabal --- a/hslua.cabal 2013-10-05 13:24:23.000000000 +0200 +++ b/hslua.cabal 2013-10-21 21:51:56.031113660 +0200 @@ -30,7 +30,8 @@ Library Exposed-modules: Scripting.Lua, Scripting.Lua.ConfigFile Hs-source-dirs: src if flag(system-lua) - Pkgconfig-depends: lua + Pkgconfig-depends: lua + C-sources: src/ntrljmp.c else C-sources: src/lapi.c, src/lauxlib.c, src/lbaselib.c, src/lcode.c, src/ldblib.c, src/ldebug.c, src/ldo.c, src/ldump.c, src/lfunc.c,