[Tarantool-patches] [PATCH 1/2] test: disable JIT for Lua Fun totable function

Igor Munkin imun at tarantool.org
Fri Jun 19 23:40:47 MSK 2020


JIT compiler can generate invalid trace for <totable> function breaking
its semantics (see LuaJIT/LuaJIT#584). Since interpreter works fine and
produces right results, disabling JIT for this function (and all its
subfunctions) stops execution failures.

Relates to LuaJIT/LuaJIT#584
Fixes #4252

Signed-off-by: Igor Munkin <imun at tarantool.org>
---
 test/box-tap/key_def.test.lua | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/box-tap/key_def.test.lua b/test/box-tap/key_def.test.lua
index d7dbf5b88..ce7a3cb63 100755
--- a/test/box-tap/key_def.test.lua
+++ b/test/box-tap/key_def.test.lua
@@ -4,6 +4,14 @@ local tap = require('tap')
 local ffi = require('ffi')
 local json = require('json')
 local fun = require('fun')
+
+-- Fix for gh-4252: to prevent invalid trace assembling (see
+-- LuaJIT/LuaJIT#584) disable JIT for fun.totable function and
+-- method (these functions are different GCfunc objects) and all
+-- their subfunctions.
+jit.off(fun.totable, true)
+jit.off(fun.iter({}).totable, true)
+
 local key_def_lib = require('key_def')
 
 local usage_error = 'Bad params, use: key_def.new({' ..
-- 
2.25.0



More information about the Tarantool-patches mailing list