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 9A486D71942; Thu, 12 Sep 2024 14:45:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9A486D71942 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1726141509; bh=Z2aAu0ZmKO42lpqLjNjVrSw90/dJn2rvAi3XNNWnLms=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Dj263dE1j1vejeLVbJQ4wqAPbF6zzjyVsHkZ1DNhgGKh7jSPnSpPkaCPwAknsL2L0 iBBEJ2vlbkhj7h3M1d83C1P2mnJqWKqn9BQbMtjTlho6etPhW23ByWZ4dza1iElGXq IreOlzEutpa0M7y3YA6JcpSqhk77bze8Vk2fSV3U= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [95.163.41.97]) (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 5F437C8ED79 for ; Thu, 12 Sep 2024 14:45:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5F437C8ED79 Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1soiG2-00000000hLB-07K8; Thu, 12 Sep 2024 14:45:06 +0300 Content-Type: multipart/alternative; boundary="------------vJWWgJxVdF6sC0mh0H72z0P9" Message-ID: <9b78ec33-28bf-4452-9216-3b5368c8e296@tarantool.org> Date: Thu, 12 Sep 2024 14:45:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Kaplun , tarantool-patches@dev.tarantool.org References: <20240821165250.11087-1-skaplun@tarantool.org> <5f51a9ad-3302-4e0c-8d91-c5a26c147fe2@tarantool.org> Content-Language: en-US In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91486559A3ABF84E7AA02C4391ACD38D4D1E92FCEE46C1725182A05F53808504004A772A44B6AD5D13DE06ABAFEAF67058DA4B1D48F01C624FD4737C3657A425AE14ECCED8CD6B7DB X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CE015DA2C687B387EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F78F3D6E0D6791938638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D89460DFF024707FDD07CC4E1706739835AC94720B67E746E6CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F790063765D76192D7FB77C9389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F7900637FA86E7CA936DF751D32BA5DBAC0009BE395957E7521B51C2330BD67F2E7D9AF1090A508E0FED6299176DF2183F8FC7C09935A1E27F592749B3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE33AC447995A7AD189C87C2358C8A9BAF3A03B725D353964BB861051D4BA689FC35872C767BF85DA227C277FBC8AE2E8BE987C591F5696A4475ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5CB0EABD7B0C368895002B1117B3ED6964F616F652195FC6E957033528158102E823CB91A9FED034534781492E4B8EEADAE4FDBF11360AC9BBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFA7524F478E90CDDF6CA995B5607B173764F09A13C4651D35108D5C1DB999017B286507CB17C9CD82BA3E0C39EEA44CB369AF39D486EF201BF5849A35C5CF2AB1E30A2B573B7C1116111DC66A97D0BFE2913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojBIBNH8BG++fWiehyf9gOKg== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458A2A32D78309FE7CB459FBC39F2FFFE83241815F810A3A9C1B50CE5520A712555645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] FFI: Fix various issues in recff_cdata_arith. 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" This is a multi-part message in MIME format. --------------vJWWgJxVdF6sC0mh0H72z0P9 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thanks! LGTM On 12.09.2024 13:16, Sergey Kaplun wrote: > On 10.09.24, Sergey Kaplun via Tarantool-patches wrote: >> Hi, Sergey! >> Thanks for the review! >> >> On 10.09.24, Sergey Bronnikov wrote: >>> Hi, Sergey, >>> >>> On 09.09.2024 18:37, Sergey Bronnikov via Tarantool-patches wrote: >>>> Hi, Sergey, >>>> >>>> thanks for the patch! see my comments below. >>>> >>>> On 21.08.2024 19:52, Sergey Kaplun wrote: >>>>> From: Mike Pall >>>>> >> >> >>>>> --- >>>>> >>>>> Branch:https://github.com/tarantool/luajit/tree/skaplun/lj-1224-fix-jit-cdata-arith >>>>> Related issues: >>>>> *https://github.com/tarantool/tarantool/issues/10199 >>>>> *https://github.com/LuaJIT/LuaJIT/issues/1224 >>>>> >>>>> src/lj_crecord.c | 10 ++-- >>>>> .../lj-1224-fix-cdata-arith-ptr.test.lua | 48 +++++++++++++++++++ >>>> This test does not fail without fix (but repro from the issue does): >>>> >>>> [0] ~/sources/MRG/tarantool/third_party/luajit $ >>>> ./build/gc64/src/luajit -Ohotloop=1 -e " >>>> repeat >>>>   r = 1LL + nil >>>> until true >>>> " >>>> LuaJIT ASSERT >>>> /home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/lj_ctype.c:185: >>>> lj_ctype_intern: uninitialized cts->L >>>> Aborted >>>> [0] ~/sources/MRG/tarantool/third_party/luajit $ >>>> ./build/gc64/src/luajit >>>> test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua >>>> TAP version 13 >>>> 1..2 >>>>     # cdata arithmetic with nil >>>> 1..2 >>>>     ok - correct recording error with bad cdata arithmetic >>>>     ok - correct error message >>>>     # cdata arithmetic with nil: end >>>> ok - cdata arithmetic with nil >>>>     # cdata arithmetic with string >>>>     1..2 >>>>     ok - correct recording error with bad cdata arithmetic >>>>     ok - correct error message >>>>     # cdata arithmetic with string: end >>>> ok - cdata arithmetic with string >>>> [0] ~/sources/MRG/tarantool/third_party/luajit $ >>>> >>> With GC64 only (LUAJIT_ENABLE_GC64). >> It don't fail with GC64? >> >> Should I add the comment? > I've added the following comment to avoid the confusion. > Branch is force-pushed. > > =================================================================== > diff --git a/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua b/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua > index 9de9586d..dd7e23ec 100644 > --- a/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua > +++ b/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua > @@ -11,6 +11,8 @@ local test = tap.test('lj-1224-fix-cdata-arith-ptr'):skipcond({ > > test:plan(2) > > +-- XXX: This test leads to the assertion failure before the patch > +-- only for non-GC64 build. > local function arith_nil_protected() > local i = 1 > while i < 3 do > =================================================================== > >>> >> -- >> Best regards, >> Sergey Kaplun --------------vJWWgJxVdF6sC0mh0H72z0P9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Thanks! LGTM

On 12.09.2024 13:16, Sergey Kaplun wrote:
On 10.09.24, Sergey Kaplun via Tarantool-patches wrote:
Hi, Sergey!
Thanks for the review!

On 10.09.24, Sergey Bronnikov wrote:
Hi, Sergey,

On 09.09.2024 18:37, Sergey Bronnikov via Tarantool-patches wrote:
Hi, Sergey,

thanks for the patch! see my comments below.

On 21.08.2024 19:52, Sergey Kaplun wrote:
From: Mike Pall <mike>

<snipped>

---

Branch:https://github.com/tarantool/luajit/tree/skaplun/lj-1224-fix-jit-cdata-arith
Related issues:
*https://github.com/tarantool/tarantool/issues/10199
*https://github.com/LuaJIT/LuaJIT/issues/1224

  src/lj_crecord.c                              | 10 ++--
  .../lj-1224-fix-cdata-arith-ptr.test.lua      | 48 +++++++++++++++++++
This test does not fail without fix (but repro from the issue does):

[0] ~/sources/MRG/tarantool/third_party/luajit $ 
./build/gc64/src/luajit -Ohotloop=1 -e "
repeat
  r = 1LL + nil
until true
"
LuaJIT ASSERT 
/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/lj_ctype.c:185: 
lj_ctype_intern: uninitialized cts->L
Aborted
[0] ~/sources/MRG/tarantool/third_party/luajit $ 
./build/gc64/src/luajit 
test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua
TAP version 13
1..2
    # cdata arithmetic with nil
1..2
    ok - correct recording error with bad cdata arithmetic
    ok - correct error message
    # cdata arithmetic with nil: end
ok - cdata arithmetic with nil
    # cdata arithmetic with string
    1..2
    ok - correct recording error with bad cdata arithmetic
    ok - correct error message
    # cdata arithmetic with string: end
ok - cdata arithmetic with string
[0] ~/sources/MRG/tarantool/third_party/luajit $

With GC64 only (LUAJIT_ENABLE_GC64).
It don't fail with GC64?

Should I add the comment?
I've added the following comment to avoid the confusion.
Branch is force-pushed.

===================================================================
diff --git a/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua b/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua
index 9de9586d..dd7e23ec 100644
--- a/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua
+++ b/test/tarantool-tests/lj-1224-fix-cdata-arith-ptr.test.lua
@@ -11,6 +11,8 @@ local test = tap.test('lj-1224-fix-cdata-arith-ptr'):skipcond({
 
 test:plan(2)
 
+-- XXX: This test leads to the assertion failure before the patch
+-- only for non-GC64 build.
 local function arith_nil_protected()
   local i = 1
   while i < 3 do
===================================================================


        
<snipped>
-- 
Best regards,
Sergey Kaplun

    
--------------vJWWgJxVdF6sC0mh0H72z0P9--