From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tarantool-patches@dev.tarantool.org,
Sergey Kaplun <skaplun@tarantool.org>
Subject: [Tarantool-patches] [PATCH luajit 1/3][v3] MIPS64: Fix xpcall() error case.
Date: Thu, 12 Mar 2026 11:49:54 +0300 [thread overview]
Message-ID: <21ba90afd501808796831b7ab01c024d4ec8fed8.1773300611.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1773300611.git.sergeyb@tarantool.org>
From: Mike Pall <mike>
Thanks to François Perrad and Stefan Pejic.
(cherry picked from commit ea7071d3c30b6432bfe6f8a9d263e0285cec25e3)
The patch fixes `xpcall()` segfaults on MIPS64 architecture.
The similar patch for ARM64 has been backported (with the test)
previously, see the commit af889e4608e6eca495dd85e6161d8bcd7d3628e6
("ARM64: Fix xpcall() error case (really).").
Sergey Bronnikov:
* added the description
Part of tarantool/tarantool#12134
---
src/vm_mips64.dasc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/vm_mips64.dasc b/src/vm_mips64.dasc
index 44fba36c..da187a7a 100644
--- a/src/vm_mips64.dasc
+++ b/src/vm_mips64.dasc
@@ -1440,15 +1440,16 @@ static void build_subroutines(BuildCtx *ctx)
|. nop
|
|.ffunc xpcall
- | daddiu NARGS8:RC, NARGS8:RC, -16
+ | daddiu NARGS8:TMP0, NARGS8:RC, -16
| ld CARG1, 0(BASE)
| ld CARG2, 8(BASE)
- | bltz NARGS8:RC, ->fff_fallback
+ | bltz NARGS8:TMP0, ->fff_fallback
|. lbu TMP1, DISPATCH_GL(hookmask)(DISPATCH)
| gettp AT, CARG2
| daddiu AT, AT, -LJ_TFUNC
| bnez AT, ->fff_fallback // Traceback must be a function.
|. move TMP2, BASE
+ | move NARGS8:RC, NARGS8:TMP0
| daddiu BASE, BASE, 24
| // Remember active hook before pcall.
| srl TMP3, TMP3, HOOK_ACTIVE_SHIFT
--
2.43.0
next prev parent reply other threads:[~2026-03-12 8:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 9:05 [Tarantool-patches] [PATCH luajit 0/3][v3] Fix stack overflow in pcall/xpcall Sergey Bronnikov via Tarantool-patches
2026-03-12 8:49 ` Sergey Bronnikov via Tarantool-patches [this message]
2026-03-12 8:49 ` [Tarantool-patches] [PATCH luajit 2/3][v3] LJ_FR2: Fix stack checks in vararg calls Sergey Bronnikov via Tarantool-patches
2026-03-12 9:36 ` Sergey Kaplun via Tarantool-patches
2026-03-12 12:25 ` Sergey Bronnikov via Tarantool-patches
2026-03-12 12:47 ` Sergey Kaplun via Tarantool-patches
2026-03-12 8:49 ` [Tarantool-patches] [PATCH luajit 3/3][v3] Add stack check to pcall/xpcall Sergey Bronnikov via Tarantool-patches
2026-03-12 10:16 ` Sergey Kaplun 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=21ba90afd501808796831b7ab01c024d4ec8fed8.1773300611.git.sergeyb@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=estetus@gmail.com \
--cc=skaplun@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit 1/3][v3] MIPS64: Fix xpcall() error case.' \
/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