From: Mikhail Elhimov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit v2] dbg: remove wrong GC state
Date: Sat, 17 Oct 2026 11:39:43 +0300 [thread overview]
Message-ID: <f110858c-c2c6-4e11-b86f-6f5fc62429b0@vk.team> (raw)
In-Reply-To: <atIefmRiHZy3kH9g@root>
[-- Attachment #1: Type: text/plain, Size: 3507 bytes --]
Hi, Sergey!
Thanks for the review!
On 16.10.2026 15:54, Sergey Kaplun wrote:
> Hi, Mikhail!
> Thanks for the patch!
> LGTM, after adding the comment for the testing snippet, see below.
>
> On 16.10.26, Mikhail Elhimov wrote:
>> It has been copied by mistake from the LuaVela fork of LuaJIT.
>> ---
>> Changes in v2:
>> * Rebased ontohttps://lists.tarantool.org/pipermail/tarantool-patches/2026-October/030859.html to avoid conflicts
>>
>> This patch is to be applied afterhttps://lists.tarantool.org/pipermail/tarantool-patches/2026-October/030859.html
>>
>> Branch:https://github.com/tarantool/luajit/tree/elhimov/gh-noticket-dbg-remove-wrong-gcstate
>>
>> src/luajit_dbg.py | 3 +-
>> .../debug-extension-tests.py | 96 +++++++++++++++++--
>> 2 files changed, 87 insertions(+), 12 deletions(-)
>>
>> diff --git a/src/luajit_dbg.py b/src/luajit_dbg.py
>> index a685ecfa..8f7249ab 100644
>> --- a/src/luajit_dbg.py
>> +++ b/src/luajit_dbg.py
> <snipped>
>
>> diff --git a/test/tarantool-debugger-tests/debug-extension-tests.py b/test/tarantool-debugger-tests/debug-extension-tests.py
>> index bbd53dcc..735de2cb 100644
>> --- a/test/tarantool-debugger-tests/debug-extension-tests.py
>> +++ b/test/tarantool-debugger-tests/debug-extension-tests.py
> <snipped>
>
>> +class TestGCStateBase(TestCaseBase):
>> + extension_cmds = (
>> + 'lj-state\n'
>> + 'lj-gc\n'
>> + )
>> + lua_script = (
>> + 'local obj = newproxy(true)\n'
>> + 'getmetatable(obj).__gc = function() end\n'
>> + 'obj = nil\n'
>> + 'collectgarbage()\n'
>> + )
> It would be nice to add the comment here explaining why __all__ GC
> states are reachable through this Lua code:
> 1) `gc_mark_start()` (GCpause) is always present in the full GC cycle.
> 2) `propagatemark()` (GCSpropagate) is reachable because our build has
> FFI and the finalizer table is marked as a weak table, i.e. it is
> grey. Hence, the g->gc.gray list is not empty.
> 3) `atomic()` (GCSatomic) is always present in the full GC cycle.
> 4) `gc_sweep_str_chain()` (GCSsweepstring) is always present in the full
> GC cycle.
> 5) `gc_sweep()` (GCSsweep) is always present in the full GC cycle.
> 6) `gc_finalize()` is met due to the finalizer to userdata in the
> script.
Done
>> +
>> + @classmethod
>> + def setUpClass(cls):
>> + cls.pattern = (
>> + compose_lj_state_rx(cls.gc_state) +
>> + compose_gc_stats_rx(cls.gc_state)
>> + )
>> + super(TestGCStateBase, cls).setUpClass()
>> +
>> +
>> +class TestGCStatePause(TestGCStateBase):
>> + gc_state = GCS_PAUSE
>> + location = 'gc_mark_start'
>> +
>> +
>> +class TestGCStatePropagate(TestGCStateBase):
>> + gc_state = GCS_PROPAGATE
>> + location = 'propagatemark'
>> +
>> +
>> +class TestGCStateAtomic(TestGCStateBase):
>> + gc_state = GCS_ATOMIC
>> + location = 'atomic'
>> +
>> +
>> +class TestGCStateSweepString(TestGCStateBase):
>> + gc_state = GCS_SWEEPSTRING
>> + location = 'gc_sweep_str_chain'
>> +
>> +
>> +class TestGCStateSweep(TestGCStateBase):
>> + gc_state = GCS_SWEEP
>> + location = 'gc_sweep'
>> +
>> +
>> +class TestGCStateFinalize(TestGCStateBase):
>> + gc_state = 'FINALIZE'
>> + location = 'gc_finalize'
>> +
>> +
>> STACK_RX = (
>> r'-+ Redzone:\s+\d+ slots -+\n'
>> r'(' + RX_ADDR + r'\s+' + RX_FRAME + r' VALUE: nil\n?)*\n'
>> --
>> 2.43.0
>>
--
Best regards,
Mikhail Elhimov
[-- Attachment #2: Type: text/html, Size: 4810 bytes --]
next prev parent reply other threads:[~2026-10-17 8:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 7:20 [Tarantool-patches] [PATCH luajit] " Mikhail Elhimov via Tarantool-patches
2026-10-15 23:45 ` [Tarantool-patches] [PATCH luajit v2] " Mikhail Elhimov via Tarantool-patches
2026-10-16 12:54 ` Sergey Kaplun via Tarantool-patches
2026-10-17 8:39 ` Mikhail Elhimov via Tarantool-patches [this message]
2026-10-16 14:49 ` Sergey Bronnikov via Tarantool-patches
2026-10-17 8:32 ` [Tarantool-patches] [PATCH luajit v3] " Mikhail Elhimov via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f110858c-c2c6-4e11-b86f-6f5fc62429b0@vk.team \
--to=tarantool-patches@dev.tarantool.org \
--cc=m.elhimov@vk.team \
--cc=skaplun@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit v2] dbg: remove wrong GC state' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox