Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A portion of Luvi code is embedded into the binary as bytecode. This poses an issue in builds with shared libluv (and therefore shared luajit) where the version of Lua(JIT) used to compile Luvi may be different from the version present on the target machine.
Both LuaJIT and PUC Lua 5.2 provide mechanisms to emit an error when this occurs. In PUC Lua this is done via
luaL_checkversion(L)
which throws a Lua error when it fails. We call this as soon as we create a new state to ensure that the error is fatal.In LuaJIT this is done via an exported symbol
LUAJIT_VERSION_SYM
that matches the version of LuaJIT during compilation. The dynamic loader will fail if this symbol cannot be found in the LuaJIT dynamic library.These checks happen on a best effort basis: some distributions (like Ubuntu) use patched versions of LuaJIT that is missing
LUAJIT_VERSION_SYM
, andluaL_checkversion(L)
was implemented in 5.2, and as such is missing in 5.1.