[Tarantool-patches] [PATCH luajit] x86/x64: Add more red zone checks to assembler backend.

Sergey Kaplun skaplun at tarantool.org
Fri Jan 17 11:31:27 MSK 2025


Hi, Sergey!
Thanks for the review!
Fixed your comments below.

Branch is force-pushed.

On 16.01.25, Sergey Bronnikov wrote:
> Hi, Sergey,
> 
> thanks for the patch! See comments below.
> 
> 
> On 16.01.2025 16:35, Sergey Kaplun wrote:
> 
> 
> <snipped>
> 
> > diff --git a/test/tarantool-tests/lj-1116-redzones-checks.test.lua b/test/tarantool-tests/lj-1116-redzones-checks.test.lua
> > new file mode 100644
> > index 00000000..70062ec9
> > --- /dev/null
> > +++ b/test/tarantool-tests/lj-1116-redzones-checks.test.lua
> > @@ -0,0 +1,118 @@
> > +local tap = require('tap')
> > +-- Test file to demonstrate mcode area overflow during recording a
> > +-- trace with the high FPR pressure.
> > +-- See also,https://github.com/LuaJIT/LuaJIT/issues/1116.
> > +--
> > +-- XXX: Test fails only with GC64 enabled before the commit.
> I would rephrase: XXX: Test fails with reverted fix and enabled GC64.

Rephrased as you suggested. See the iterative patch below.

> > +local test = tap.test('lj-1116-redzones-checks'):skipcond({
> > +  ['Test requires JIT enabled'] = not jit.status(),
> > +})
> > +
> > +test:plan(1)
> > +

<snipped>

> > +--
> > +-- [1]:https://wiki.osdev.org/X86-64_Instruction_Encoding#REX_prefix
> > +
> > +_G.a = 0
> > +_G.b = 0
> > +_G.c = 0
> > +_G.d = 0
> > +_G.e = 0
> > +_G.f = 0
> > +_G.g = 0
> > +_G.h = 0
> > +-- Skip `i`.
> 
> I didn't get it.

Updated the commit:

===================================================================
diff --git a/test/tarantool-tests/lj-1116-redzones-checks.test.lua b/test/tarantool-tests/lj-1116-redzones-checks.test.lua
index 70062ec9..4f4f5870 100644
--- a/test/tarantool-tests/lj-1116-redzones-checks.test.lua
+++ b/test/tarantool-tests/lj-1116-redzones-checks.test.lua
@@ -3,7 +3,7 @@ local tap = require('tap')
 -- trace with the high FPR pressure.
 -- See also, https://github.com/LuaJIT/LuaJIT/issues/1116.
 --
--- XXX: Test fails only with GC64 enabled before the commit.
+-- XXX: Test fails with reverted fix and enabled GC64 mode.
 local test = tap.test('lj-1116-redzones-checks'):skipcond({
   ['Test requires JIT enabled'] = not jit.status(),
 })
@@ -54,7 +54,7 @@ _G.e = 0
 _G.f = 0
 _G.g = 0
 _G.h = 0
--- Skip `i`.
+-- Skip `i` -- it is used for the loop index.
 _G.j = 0
 _G.k = 0
 _G.l = 0
===================================================================

> 
> 
> <snipped>

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list