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 5264E540A5D; Fri, 1 Sep 2023 19:02:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5264E540A5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1693584174; bh=h0jt7WUCsgXjW+8wr2SZttNu53faLs04ywrgShZR1GQ=; 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=dIKoHdF18AflUVGPK+08szqi3XxDwsW9KvQg4Gp6XLqKunUZHeWbTj69PYEd2Tri/ 4Xb8E7rekh8D37JUNGcbb92Ta+1TAzWEOhkp9HfDikJzmVeihyqE39G5YbUo5jMCQm xaUp9PZ7ERTdCwZQo10MWQVvO0cRR/mYoZR2dDdk= Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [95.163.41.93]) (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 2C3DB53915E for ; Fri, 1 Sep 2023 19:02:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2C3DB53915E Received: by smtp55.i.mail.ru with esmtpa (envelope-from ) id 1qc6bk-00EAPR-0P; Fri, 01 Sep 2023 19:02:52 +0300 Date: Fri, 1 Sep 2023 15:45:19 +0000 To: Sergey Kaplun Message-ID: References: <20230825150024.23247-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230825150024.23247-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD96E142CFC92DB15CD1C47060D0B6C1F571E4C5B5C7DEF200F182A05F538085040DAF6E8D48BDA09090C500EF91B16D072A586511E61D818F730D9AE39DDFEB1B3 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F544D30F1A6FA191EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E31772672C957B658638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D881528F009EDC66F1B2DA1682A8EDD59D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC911D863C7A028B9E389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8989FD0BDF65E50FBF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C457EE4B4996FC5466E0066C2D8992A164AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C387610DD87C265BFBBA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE732FCE54C4D9A645443847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A507395F103F420214541B652697ECA523EE6E75F450048A99F87CCE6106E1FC07E67D4AC08A07B9B0632EDEA9CD5989A3CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D343D1F112031EF3D6283659DBCDBBCA8C1B7BF59221FB7AAE73AA621E55A2FA077AD253CD85B02FA601D7E09C32AA3244CA416D58412F1336386DE09DCB9EE383851E887DA02A9F7BFBAD658CF5C8AB4025DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj1b73jmY4IdYz7v2J7DoRBw== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D5311837D33FC3FBEC4FA65106DE976B7644EE2427A87B63AAE92326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix maxslots when recording BC_TSETM. 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, I've checked the patchset into all long-term branches in tarantool/luajit and bumped a new version in master, release/2.11 and release/2.10. On 25.08.23, Sergey Kaplun via Tarantool-patches wrote: > From: Mike Pall > > Analyzed by Sergey Kaplun. > > (cherry-picked from commit 0cc5fdfbc0810073485150eb184dc358dab507d9) > > Recording of the `BC_TSETM` bytecode may keep too optimistic JIT > maxslot. In that case, the slot above the top of the Lua stack may be > considered used. When any VM event handler is called before the > recording of the next instruction, this leads to an assertion failure in > `rec_check_slots()`. > > This patch sets the `ra` as a maxslot, as far as the `ra` - 1 contains a > table, which is always the highest slot after this bytecode. Also, it > adds an assertion that we check slots below the top of the Lua stack. > > Sergey Kaplun: > * added the description and the test for the problem > > Part of tarantool/tarantool#8825 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-1025-tsetm-maxslot > Tarantool PR: https://github.com/tarantool/tarantool/pull/9040 > Issues: > * https://github.com/LuaJIT/LuaJIT/issues/1025 > * https://github.com/tarantool/tarantool/issues/8825 > > src/lj_record.c | 2 + > .../lj-1025-tsetm-maxslot.test.lua | 52 +++++++++++++++++++ > 2 files changed, 54 insertions(+) > create mode 100644 test/tarantool-tests/lj-1025-tsetm-maxslot.test.lua > > -- > 2.41.0 > -- Best regards, IM