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 80A6E51BE6C; Sat, 1 Jul 2023 15:17:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 80A6E51BE6C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1688213846; bh=Bber0B/wPL/NA6VJMF5F2xX8SMEasyY4obiWkRnO/n0=; 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=EJA1Ispx0n38EsloKB/CMy85b5g7pfXRKtHyNX5CDJufMfdwo/K4PdzvkN9zpt+Hz 7cQ7sZo1WmJ32IaJaBz7q+bgzRsfJOfVz34MqT4sp9OrZFtvlZDQtVXZLAPqVb+zkX CPHG+1cgeiE+nWJ3kwOo5ZcPDU4fQo0VpPz/3ayo= Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [95.163.41.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 54EB851BE6C for ; Sat, 1 Jul 2023 15:17:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 54EB851BE6C Received: by smtp33.i.mail.ru with esmtpa (envelope-from ) id 1qFZXY-00BYhw-Gy; Sat, 01 Jul 2023 15:17:24 +0300 Date: Sat, 1 Jul 2023 12:09:01 +0000 To: Sergey Kaplun Message-ID: References: <840ae735734b3b0074bb43659c7fb21f54664114.1687439049.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <840ae735734b3b0074bb43659c7fb21f54664114.1687439049.git.skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9F8F06A4ADC2A029E7CD0B7FACFF8455FAE263C2FED6FFDCB182A05F5380850409F74B39F671BFE9D2066266E9041F5369442FAB3F9437CB4C1E9A8C12E91AC18 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE712EB008F780777E9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E149C29A36E092738638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D845257F949478C4CC6DC81D2D80101C0A117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520C65AC60A1F0286FE618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EED76C6ED7039589DEC5236E9430F51F07D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE34AB4081B6A6C2E07302FCEF25BFAB345C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947C2FFDA4F57982C5F42E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89FB26E97DCB74E625235872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A587D3CBA59DB21CFF971BCFFA4C8B06A1F94E638B0EE0B757F87CCE6106E1FC07E67D4AC08A07B9B01F9513A7CA91E555CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF36208144471A02CFF98AA87DDC5584976AF21AB1AE3C99140E14C2523FE380D8E5D0AE1B904842155622055276C82EC689205C294C6AB6644703E2B3C9354C36A74DFFEFA5DC0E7F02C26D483E81D6BEECAEF3E2CCC1ED8C383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojMJXPKWcdXi7yWEd4b8CZkQ== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D5311408930A51F0B69ACAE08E8DAFE6E28450918F5B311A850E2326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] Another fix for lua_yield() from C hook. 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, Thanks for the patch! LGTM, considering the fixes made to resolve the comments left by Max. On 22.06.23, Sergey Kaplun wrote: > From: Mike Pall > > Reported by Jason Carr. > > (cherry picked from commit dd0f09f95f36caf1f2111c10fec02748116003bb) > > This commit is the follow up for the previous commit ("Fix lua_yield() > from C hook."). In GC64 mode stack slot for a GC thread object is still > miscalculated during creating a continuation frame for `lua_yield()`. > This happens due to tricky usage of the previous slot instead of the > given one in `setframe_gc()` macro. > > This patch changes the semantics of `setframe_gc()` macro to use the > given as argument slot as the destination to store GC value. Also, it > fixups all usages of this macro to match new semantics. > > Sergey Kaplun: > * added the description for the problem > > Part of tarantool/tarantool#8516 > --- > src/lj_ccallback.c | 2 +- > src/lj_err.c | 2 +- > src/lj_frame.h | 2 +- > src/lj_meta.c | 2 +- > test/tarantool-c-tests/fix-yield-c-hook.test.c | 4 ---- > 5 files changed, 4 insertions(+), 8 deletions(-) > > diff --git a/test/tarantool-c-tests/fix-yield-c-hook.test.c b/test/tarantool-c-tests/fix-yield-c-hook.test.c > index 9068360e..b84cdc7e 100644 > --- a/test/tarantool-c-tests/fix-yield-c-hook.test.c > +++ b/test/tarantool-c-tests/fix-yield-c-hook.test.c > @@ -22,10 +22,6 @@ static void yield(lua_State *L, lua_Debug *ar) > lua_yield(L, 0); > } > > -/* > - * XXX: This test still leads to core dump in the GC64 mode. > - * This will be fixed in the next commit. > - */ Side note: I didn't mention this in the previous commit, but I wonder, why you simply didn't disable the test for GC64 build? Anyway, I guess we can ignore the fact that tests doesn't work for the previous patch, since this one is a fix for the fix. > static int yield_in_c_hook(void *test_state) > { > lua_State *L = test_state; > -- > 2.34.1 > -- Best regards, IM