From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 107136ECE2; Tue, 24 Nov 2026 10:47:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 107136ECE2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1795506455; bh=dNDYYLxL+HSmrC1AZDKmkQxkVIR2oUXUvL7LCtlVeKs=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=qJMYQsP/b/0cl4ao3HGXOgdRfos8TUjdmbYczD8KS1B9C/DSfX40qRcx5yG6vZgLT QxCqFk9w0di+xtqUCne/9hn+VoWwma1dJKKGgh6tnXFkO+25LY1ppI8wZkosYOYLow YZTCP/g9GlCQcn1Rn3FMd10NNOFEQ9Lf2hBIWWgQ= Received: from send243.i.mail.ru (send243.i.mail.ru [95.163.59.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6A9746ECE2 for ; Tue, 24 Nov 2026 10:47:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6A9746ECE2 Received: by exim-smtp-56bb8ff957-x4ltn with esmtpa (envelope-from ) id 1xVlFU-0000000046j-0swv; Tue, 24 Nov 2026 10:47:32 +0300 Date: Tue, 24 Nov 2026 10:49:50 +0300 To: Sergey Bronnikov Message-ID: References: <20261123070910.1354298-1-skaplun@tarantool.org> <72041486-fcbd-470d-abaf-18240c4f518b@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <72041486-fcbd-470d-abaf-18240c4f518b@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD90028F27364C53ECEB6FF8847DD3FBD7CBFA6D08936E901EE182A05F5380850404C228DA9ACA6FE27CD70449E80D34B793DE06ABAFEAF67056643634CDC69BD75DF937CE4C6D093A193525CDB3F0CE26E X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE737AE489DBC023F2AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB5533756603DA5D6BE41EFC0D7F468CBF3A27A826346D454AAC506BE5EF360803327D3540389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE71D0063F52110EA4A731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A576B4D83A9FC358A25002B1117B3ED696D1B6569544635C9ECA7E60A991436CA23610D81D389A125CDE35189EBF2DEA28FEA14CD2CD220BB99C5DF10A05D560A9880EC71AF561E0AAD9143641EC25BB397F8B616C48B79C55 X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6590799B86012B901CA4A4A26BBCEC91158D16635B93FE81CDEEA488B535CC6DED572A70D308B7D64C6B8341EE9D5BE9A0A6FF868C77D3049A405CB097BA505BE42C7A1B901188319A16536EB022892E5344C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXOcIETfglQORZ0zpDET4Zrk3igikrdHlWDT6GZebCGuXDLEd9SnCO68= X-Mailru-Sender: 689FA8AB762F73937C9FA53A4753B313B3D551D8C4B821BD40089184013DD6AE6448A5355E508993E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix external C call stack check when using LUAJIT_MODE_WRAPCFUNC. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! See my answer below. On 23.11.26, Sergey Bronnikov wrote: > Hi, Sergey! > > Thanks for the patch! Please see the comment below. > > Sergey > > On 11/23/26 10:09, Sergey Kaplun wrote: > > From: Mike Pall > > > > Thanks to Peter Cawley. > > > > (cherry picked from commit 14e2917e7ab3d6f043d6604298bfa66470c6f47d) > > > > Enabling and disabling wrapped C function mode [1] unconditionally > > changes the bytecode to `BC_FUCC[W] 0 0`. The first operand (RA) is > > unused for x86/x64 VMs, but other VMs use it like the minimum available > > stack slots required for the function call (`LUA_MINSTACK` by default on > > VM startup). Hence, these bytecode rewriting lead to the different > > timing of the STACKOV error being raised (before the call or during the > > invocation of the C function). > > > > This patch makes the behaviour consistent across VMs by modifying only > > the opcode without changing its operands. Hence the `LUA_MINSTACK` > > value of the first operand is preserved. > > > > [1]:https://luajit.org/ext_c_api.html#mode_wrapcfunc > > > > Sergey Kaplun: > > * added the description and the test for the problem > > > > Part of tarantool/tarantool#13442 > > --- > > > > Branch:https://github.com/tarantool/luajit/tree/skaplun/lj-1047-fix-funccw-arm64 > > Related issues: > > *https://github.com/LuaJIT/LuaJIT/issues/1047 > > *https://github.com/tarantool/tarantool/issues/13442 > > > > Side note: CI on macOS x86_64 is red due to runner issues. > > > > src/lj_dispatch.c | 4 +- > > .../lj-1047-fix-funccw-arm64.test.c | 105 ++++++++++++++++++ > > 2 files changed, 107 insertions(+), 2 deletions(-) > > create mode 100644 test/tarantool-c-tests/lj-1047-fix-funccw-arm64.test.c > > It is not clear why the test (or patch) is arm64-specific. > > Either explain in the commit message or remove suffix. It is already explained in the first paragraph. > > -- Best regards, Sergey Kaplun