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 4EB7C5BE742; Mon, 28 Aug 2023 15:58:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4EB7C5BE742 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1693227521; bh=ZluhmOPOOqFbIfdNXTgI2FEsdtxoyLaOpjFV6Vb2sc8=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=U4/fmdputPw2BBbQ0yfUxuMOK/gN9yHsHZ7Je5dL9zh/crKXJasxxthJvPm65eqzQ XUzqD9ZPXvZmCHA6Qa0FRIIJPe5sOiOesOeVJmssR2gbBi1EDAzADoMGGF3Z85nSq3 4mf5Yah7OXuN+UfiBcbKfZp3FwsKsyOrW1UadREQ= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 615425BE742 for ; Mon, 28 Aug 2023 15:58:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 615425BE742 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1qabpG-0002Vu-GB; Mon, 28 Aug 2023 15:58:38 +0300 Message-ID: Date: Mon, 28 Aug 2023 15:58:38 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <20230825150024.23247-1-skaplun@tarantool.org> Content-Language: en-US In-Reply-To: <20230825150024.23247-1-skaplun@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9954329A9C7AF96E93B16F99B2A6DD833724391D63868FF9F182A05F53808504082CDCB94067A171014A9ECBC1D0D1C76EA5629734FD64037DC5BA09D18E853F2 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE705C173BDDADFC82AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B35447D73BF3EFFE8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D807B591609E82C1B86E283151CDBDA725117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCB6FC2C91A742FF12A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BCB5A162A2BD0125875ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A510EEF745A6A7D296E5838B0884CF223BA6749DB82BB3AC29F87CCE6106E1FC07E67D4AC08A07B9B0735DFC8FA7AC1207CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34B7CBFF60649FF266AF954973511F784AA38B6A80A0F603DDD16EDDFB974FAFC54B9E94A25D929A671D7E09C32AA3244CABD5B6897A807FB6ECD88AA061C0933C795D98D676DD64D085A42E4C463514DC5DA084F8E80FEBD3FFA33E6B6B2F82C47A83BD0C44CE203720ABEDE4BBDD9CDD X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojrC6BcuK2ROwdnwTEslXl6A== X-DA7885C5: 9856A9EC1C2D82493570FC8633222428F4F1FAE10F8CB58B41C940ACD59EE95A262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73930F533AC2B33E986BEA040883E7086E11CC38E4C9257B584CDD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 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: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey thanks for the patch! LGTM See a minor comment inline. Sincerely yours, Sergey On 8/25/23 18:00, Sergey Kaplun 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. I've discovered that bug is not reproduced when LUAJIT_ENABLE_TABLE_BUMP is enabled, by default it is disabled. CFLAGS="-DLUAJIT_ENABLE_TABLE_BUMP" cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug cmake --build build --parallel It is probably worth to mention in commit message. Feel free to ignore.