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 E01E093AB2B; Wed, 10 Jan 2024 11:57:36 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E01E093AB2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1704877057; bh=qse9Ds+97Pe4UVpElf4WQWSLTRsGDD8tWZ2c9EsUM94=; 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=MixjgYEgKtNV2me7a8+b5V4e1XJqw8klo8JpDRwEB7Y3DcnF/FvQ+3JLP6w+Pw0FC kz8f1hinS4fJzeHwlopduYhRbvt1vIfKIzQMvCTv1/EUriBOWoplWpOyWZ92va0ExG pbuRCQipztICWC83HFsS7X5lKT2cIQSlI5U29U4A= Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [95.163.41.94]) (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 563A493AB2B for ; Wed, 10 Jan 2024 11:57:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 563A493AB2B Received: by smtp56.i.mail.ru with esmtpa (envelope-from ) id 1rNUOq-000Sto-35; Wed, 10 Jan 2024 11:57:25 +0300 Date: Wed, 10 Jan 2024 08:51:19 +0000 To: Sergey Kaplun Message-ID: References: <20231109122628.19853-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231109122628.19853-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9F008C97756F746CAA89CC280A9C73C8312970F1BEE6B7403182A05F538085040F3544373229C869F148E8186B3049BA83757E5D3264CD83296AC88DFF5AA90F7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B264C8851FD8E810EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378997215BCAA11D778638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8BB7D90CCEFCBE8DF230F2B2AA5FF2EFB117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE9647ADFADE5905B1D94E105876FE7799D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE34CB6874B0BCFF0B8302FCEF25BFAB345C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947C1D471462564A2E192E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89FD2A95C73FD1EFF4557739F23D657EF2BB5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5027C602BD058CDDD8829C3E5BC7D74080540E98F460C1F68F87CCE6106E1FC07E67D4AC08A07B9B04B3849D6E5CCBAFDBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34F0A5F58274334C95943815942BF61E31BDC72CF1AE1512A66BB6138B2C766821E2538AAA4524F89B1D7E09C32AA3244C3529D451266A9A2701DFEE7FF19D2CFA05AB220A9D022EBCBAD658CF5C8AB4025DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojou3Ii6fsdvWbY/jXitsFZA== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D5313A1B002DACD62F3446E49B2F9157B5A67417481E5B9B36C12326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix HREFK forwarding vs. table.clear(). 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 09.11.23, Sergey Kaplun via Tarantool-patches wrote: > From: Mike Pall > > Reported by XmiliaH. > > (cherry-picked from commit d5a237eae03d2ad346f82390836371a952e9a286) > > When performing HREFK (and also ALOAD, HLOAD) forwarding optimization, > the `table.clear()` function call may be performed on the table operand > from HREFK between table creation and IR, from which value is forwarded. > This call isn't taken in the account, so it may lead to too optimistic > value-forwarding from NEWREF (and also ASTORE, HSTORE), or the omitted > type guard for HREFK operation. Therefore, this leads to incorrect trace > behaviour (for example, taking a non-nil value from the cleared table). > > This patch adds necessary checks for `table.clear()` calls. > > Sergey Kaplun: > * added the description and the test for the problem > > Part of tarantool/tarantool#9145 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-792-hrefk-table-clear > Tarantool PR: https://github.com/tarantool/tarantool/pull/9351 > Relate issues: > * https://github.com/LuaJIT/LuaJIT/issues/792 > * https://github.com/tarantool/tarantool/issues/9145 > > src/lj_opt_mem.c | 63 +++--- > .../lj-792-hrefk-table-clear.test.lua | 181 ++++++++++++++++++ > 2 files changed, 213 insertions(+), 31 deletions(-) > create mode 100644 test/tarantool-tests/lj-792-hrefk-table-clear.test.lua > > -- > 2.42.0 > -- Best regards, IM