Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>,
	Maxim Kokryashkin <m.kokryashkin@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] Fix maxslots when recording BC_TSETM.
Date: Mon, 28 Aug 2023 15:58:38 +0300	[thread overview]
Message-ID: <b73d5608-06b0-c434-b572-988fe3e1f9fd@tarantool.org> (raw)
In-Reply-To: <20230825150024.23247-1-skaplun@tarantool.org>

Hi, Sergey


thanks for the patch! LGTM

See a minor comment inline.


Sincerely yours,

Sergey


On 8/25/23 18:00, Sergey Kaplun wrote:
> From: Mike Pall <mike>
>
> Analyzed by Sergey Kaplun.
>
> (cherry-picked from commit 0cc5fdfbc0810073485150eb184dc358dab507d9)
>
> Recording of the `BC_TSETM` bytecode may keep too optimistic JIT
> maxslot. In that case, the slot above the top of the Lua stack may be
> considered used. When any VM event handler is called before the
> recording of the next instruction, this leads to an assertion failure in
> `rec_check_slots()`.
>
> This patch sets the `ra` as a maxslot, as far as the `ra` - 1 contains a
> table, which is always the highest slot after this bytecode. Also, it
> adds an assertion that we check slots below the top of the Lua stack.

I've discovered that bug is not reproduced when LUAJIT_ENABLE_TABLE_BUMP 
is enabled, by default it is disabled.

CFLAGS="-DLUAJIT_ENABLE_TABLE_BUMP" cmake -S . -B build 
-DCMAKE_BUILD_TYPE=Debug

cmake --build build --parallel

It is probably worth to mention in commit message. Feel free to ignore.



<snipped>


  reply	other threads:[~2023-08-28 12:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 15:00 Sergey Kaplun via Tarantool-patches
2023-08-28 12:58 ` Sergey Bronnikov via Tarantool-patches [this message]
2023-08-28 14:04   ` Sergey Kaplun via Tarantool-patches
2023-08-28 15:00 ` Maxim Kokryashkin via Tarantool-patches
2023-08-28 15:02   ` Sergey Kaplun via Tarantool-patches
2023-08-28 15:16     ` Maxim Kokryashkin via Tarantool-patches
2023-08-28 15:19       ` Sergey Kaplun via Tarantool-patches
2023-09-01 15:45 ` Igor Munkin 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=b73d5608-06b0-c434-b572-988fe3e1f9fd@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] Fix maxslots when recording BC_TSETM.' \
    /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