From: Kirill Yukhin 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] core: fix cur_L restoration on error throw
Date: Thu, 19 Aug 2021 07:42:43 +0000 [thread overview]
Message-ID: <20210819074243.y6oezbujtffjmoiu@tarantool.org> (raw)
In-Reply-To: <20210816101949.25035-1-skaplun@tarantool.org>
Hello,
On 16 авг 13:19, Sergey Kaplun wrote:
> This change is a kind of revertion of commits
> ed412cd9f55fe87fd32a69c86e1732690fc5c1b0 ('Update cur_L on exceptional
> path') and 97699d9ee2467389b6aea21a098e38aff3469b5f ('Fix cur_L tracking
> on exceptional path').
>
> When an error is thrown on the coroutine that is not the one being
> currently executed, `cur_L` is not set up. Hence, when the running trace
> exits at assertion guard right after the error is caught, Lua state is
> restored from the incorrect `cur_L`. As a result the resulting stack is
> inconsistent and the crash occurs.
>
> Aforementioned patches fix the behaviour only for x86/x64
> architectures. This patch updates the `cur_L` within `lj_err_throw()` to
> the given lua_State, where the error is raised, since this is the only
> coroutine that can proceed later. Also, it removes unnecessary
> restorations of `cur_L` at C and FF exception handlers in the VM.
>
> Nevertheless, throwing an error at non-currently executed coroutine is a
> violation of Lua/C API. So, in the nearest possible future this patch
> should be replaced within the corresponding assert.
>
> Resolves tarantool/tarantool#6189
> Relates to tarantool/tarantool#6323
> Follows up tarantool/tarantool#1516
LGTM.
--
Regards, Kirill Yukhin
next prev parent reply other threads:[~2021-08-19 7:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 10:19 Sergey Kaplun via Tarantool-patches
2021-08-18 8:49 ` [Tarantool-patches] [PATCH luajit v2] " Sergey Kaplun via Tarantool-patches
2021-08-18 16:57 ` Igor Munkin via Tarantool-patches
2021-08-18 20:03 ` Sergey Kaplun via Tarantool-patches
2021-08-18 20:26 ` Igor Munkin via Tarantool-patches
2021-08-19 8:23 ` Igor Munkin via Tarantool-patches
2021-08-19 7:42 ` Kirill Yukhin via Tarantool-patches [this message]
2021-08-19 7:56 ` [Tarantool-patches] [PATCH luajit] " Vitaliia Ioffe 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=20210819074243.y6oezbujtffjmoiu@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=kyukhin@tarantool.org \
--cc=skaplun@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit] core: fix cur_L restoration on error throw' \
/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