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 387E950D241; Thu, 29 Jun 2023 14:25:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 387E950D241 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1688037925; bh=HgDm0Zb3V2DTjfwVY/1a/BU0z0aZbI1gaybxqR/MGjg=; 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=wxSH683KHH2qeUT3YcOi6yHsoVPTpFYcew7hWkNGZwS6Xvw8YqOqfShpFOF6zu0CS gTBpClVWIvpfy07nZpURfO+Koh5IFgsSbhWg47aMGr0Su92lVxIgWOPt0FzynKTI7s 5g8KuxBubD5faAt+Z+VGv8qx+oPYmI93zXLXEC0k= Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [95.163.41.91]) (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 DE6555057D4 for ; Thu, 29 Jun 2023 14:25:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DE6555057D4 Received: by smtp49.i.mail.ru with esmtpa (envelope-from ) id 1qEpm7-00Bkpj-56; Thu, 29 Jun 2023 14:25:23 +0300 Date: Thu, 29 Jun 2023 14:21:05 +0300 To: Maxim Kokryashkin Message-ID: References: <840ae735734b3b0074bb43659c7fb21f54664114.1687439049.git.skaplun@tarantool.org> <1688029749.165301004@f118.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1688029749.165301004@f118.i.mail.ru> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9666F0A09DBE8C389EE5326F09032113541013F4C3CE69344182A05F53808504046341A98A0CECB81FF9B1FA6AC54DEAE856A99A7A0CD89B2A633F2E45A87D7E8 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AD2F2D6F6013FF7FC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7E9C30BC00893CB9AEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BE5CCB53A13BC8DBAFE0E997E9E2A6CFBA572614C4A13F131CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637A3E1607A70BC73F0389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F7900637AD6E97F5A6C18016D81D268191BDAD3DBD4B6F7A4D31EC0BEA7A3FFF5B025636D81D268191BDAD3D78DA827A17800CE73745307B7F32D572EC76A7562686271ED91E3A1F190DE8FD2E808ACE2090B5E14AD6D5ED66289B5278DA827A17800CE76631511D42670FFE2EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE75A9E79F66F1C28F3731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5787D0B056FEF4ACE47C942EDB0C3CDE7CBDE789A041F3CB7F87CCE6106E1FC07E67D4AC08A07B9B01F9513A7CA91E555CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D349C39CCCDAABCB54B53927803D90611DA5A3F8256671956D038BA3053E7D3D1388F19C5838EF225B91D7E09C32AA3244C307445EFAC76FCA689F6A4FB3E50EF7CCE0B41342B755BCD85A42E4C463514DC5DA084F8E80FEBD3202CD0F03380D9577A83BD0C44CE203720ABEDE4BBDD9CDD X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojD2/8pXBAXbJSEtCgqe8/JQ== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769F1A62EAC797C464BFF9B1FA6AC54DEAE81AE5054A97140B9DEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF 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: 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, Maxim! Thanks for the review! Fixed your comments and force-pushed the branch. On 29.06.23, Maxim Kokryashkin wrote: > > Hi, Sergey! > LGTM, except for a few comments and the single note below. > >  > >>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()` > >Typo: s/during creating/during the creation of/ Fixed. > >>.This happens due to tricky usage of the previous slot instead of the > >Typo: s/due to/due to the/ Fixed. > >>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 > >Typo: s/the given as argument slot/the slot given as argument/ Fixed. > >>fixups all usages of this macro to match new semantics. > >Typo: s/new/the new/ Fixed. > >  > >Also, I strongly suggest to distinct the changes that directly relate > >to the issue, from the semantic fixups related to the macro update. > >An additional sentence or a list in the commit message would be enough. I mention all places with changed semantics to avoid misunderstanding. The commit message looks like the following: =================================================================== Another fix for lua_yield() from C hook. 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 the creation of a continuation frame for `lua_yield()`. This happens due to the 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 slot given as argument as the destination to store GC value. Also, it fixups all usages of this macro to match the new semantics, i.e. in: * * * Sergey Kaplun: * added the description for the problem Part of tarantool/tarantool#8516 =================================================================== > >> > >>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(-) > >> > >-- > >Best regards, > >Maxim Kokryashkin > >  -- Best regards, Sergey Kaplun