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 812F7D5DED4; Wed, 13 Mar 2024 11:39:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 812F7D5DED4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1710319171; bh=JhGySteZEWHfBGLA4TK/N/wqP5pdWUG77SraWwkRbz0=; 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=VQ3mwKGAXnUs/8M2TZvQY6xiGdA63F3FBuuBV7R6dfgrmks6Bd1rhB4DmWVhopK1M zi724NjU296CKqydtACmYh5gQagKWQSkAH7O4DHbyf7XyMfWVt+Ny/WO039lmXptTC Zx9SpnHVvy4419k6SqN5dGQ+DStd4GDMCxbcupko= Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [95.163.41.80]) (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 2293C40F5C3 for ; Wed, 13 Mar 2024 11:39:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2293C40F5C3 Received: by smtp39.i.mail.ru with esmtpa (envelope-from ) id 1rkK93-00000004G6y-2i7I; Wed, 13 Mar 2024 11:39:30 +0300 Date: Wed, 13 Mar 2024 11:35:30 +0300 To: Maxim Kokryashkin Message-ID: References: <20240312052627.21222-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD987C0EE6E7F0A597D2604A3BCAEBFC93637641474DCE2D7B2182A05F538085040C847200D1357F86ED4FF92D56319F1976E8EAB579E0E3DB905A355599DF1B17BE5AAAE139CE2AE96 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DB6A86BDF2D5A895EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637803A71E7516670C28638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D892600278E239F3BB6550CD07FE3984F681E8E5C8376E46B2CC7F00164DA146DAFE8445B8C89999728AA50765F790063783E00425F71A4181389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC82FFDA4F57982C5F4F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CDA7BFA4571439BB26136E347CC761E074AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C360DFB64E4A26F5C4BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF17B107DEF921CE791DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3C9EEE74C166EF7BC35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A50361B1B6402C8CF55002B1117B3ED6966D8297F4857EA297A13BD6A4B0E00B96823CB91A9FED034534781492E4B8EEAD887A4342A344B6EDBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF7C8ECF8B3857A612F0A0AD4693DE160626002A8A934BF0248885CF24EAF2D3E9E125D5F9813FCCC57C77D8D956826D3336FD810AC928E49615F3DD10609DE367E97A631A4010FBA45F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojtv/CB9kl0S1fmEV/o/NWwQ== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769252B66B4C7CAA1FED4FF92D56319F1976E8EAB579E0E3DB9B7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Check frame size limit before returning to a lower frame. 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 below. On 12.03.24, Maxim Kokryashkin wrote: > Hi, Sergey! > Thanks for the patch! > LGTM, except for the single comment below. > On Tue, Mar 12, 2024 at 08:26:27AM +0300, Sergey Kaplun wrote: > > From: Mike Pall > > > > Thanks to Sergey Kaplun. > > > > (cherry picked from commit 302366a33853b730f1b7eb61d792abc4f84f0caa) > > > > When compiling a stitched (or side) trace, there is no check for the > > frame size of the current prototype during recording. Hence, when we > > return (for example, after stitching) to the lower frame with a maximum > > possible frame size (249), the 251 = `baseslot` (2) + `maxslot` (249) > > slot for GC64 mode may be used. This leads to the corresponding assertion > > failure in `rec_check_slots()`. > > > > This patch adds the corresponding check. > > > > Sergey Kaplun: > > * added the description and the test for the problem > > > > Part of tarantool/tarantool#9595 > > --- > > > > Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-1173-frame-limit-lower-frame > > Tarantool PR: https://github.com/tarantool/tarantool/pull/9791 > > Related issues: > > * https://github.com/tarantool/tarantool/issues/9595 > > * https://github.com/LuaJIT/LuaJIT/issues/1173 > > > > +local chunk = 'local uv = {key = 1}\n' > > +chunk = chunk .. 'return function()\n' > > +chunk = chunk .. 'local r = retf()\n' > Kind of a strange way to define a chunk. I believe that multiline > is better here. Totally agree, thanks! > > + > > +-- Each `UGET` occupies 1 slot, `KNIL` occupies the same amount. > > +-- 1 slot is reserved (`r` variable), 1 pair is set outside the > > +-- cycle. 249 slots (the maximum available amount, see > > +-- , `bcreg_bump()` for details) are occupied in > > +-- total. > > +for _ = 1, LJ_MAX_JSLOTS / 2 - 2 do > > + chunk = chunk .. ('uv.key, ') > > +end > > +chunk = chunk .. 'uv.key = nil\n' > > +chunk = chunk .. 'end\n' > Same applies here. Fixed. See the iterative patch below. Branch is force-pushed. =================================================================== diff --git a/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua b/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua index 91e2c603..468462d2 100644 --- a/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua +++ b/test/tarantool-tests/lj-1173-frame-limit-lower-frame.test.lua @@ -44,9 +44,11 @@ local LJ_MAX_JSLOTS = 250 -- `maxslot` (the first free slot) to 249. Hence, the JIT slots -- are overflowing. -local chunk = 'local uv = {key = 1}\n' -chunk = chunk .. 'return function()\n' -chunk = chunk .. 'local r = retf()\n' +local chunk = [[ +local uv = {key = 1} +return function() + local r = retf() + ]] -- Each `UGET` occupies 1 slot, `KNIL` occupies the same amount. -- 1 slot is reserved (`r` variable), 1 pair is set outside the @@ -56,8 +58,8 @@ chunk = chunk .. 'local r = retf()\n' for _ = 1, LJ_MAX_JSLOTS / 2 - 2 do chunk = chunk .. ('uv.key, ') end -chunk = chunk .. 'uv.key = nil\n' -chunk = chunk .. 'end\n' +chunk = chunk .. [[uv.key = nil +end]] local get_func = assert(loadstring(chunk)) local function_max_framesize = get_func() =================================================================== > > -- Best regards, Sergey Kaplun