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 CEC674F62AF; Thu, 13 Jul 2023 12:55:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CEC674F62AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1689242153; bh=6mR7rlSTPw435PXEyY8su4qCz9VNyq5xt3oHMTndOgY=; 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=koxOu6Zrv1Q4kc4B3LphSb0t25xxJZprr8uIk2CPrQtwwCiXtFtXlrmjoJroFkNxd w2WVXlnZWslcFK1Y0vmEwtGlRnWUZFoUefrRdpuoSDd095YRCcDirDAv/KDIO7d2n4 UEKXZzeri1bbYjwAURq2asELvZBr76n6LRjs52hU= Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [95.163.41.82]) (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 727D64F62AF for ; Thu, 13 Jul 2023 12:55:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 727D64F62AF Received: by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1qJt39-006Smt-Ne; Thu, 13 Jul 2023 12:55:52 +0300 Message-ID: <77ec03d9-546e-f04b-a711-cf8a979bd2c6@tarantool.org> Date: Thu, 13 Jul 2023 12:55:51 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Sergey Kaplun References: <895991f2-93ca-0901-031b-2b39e0612a39@tarantool.org> <61340557-2a53-e6e3-ac6f-280ff30f1d66@tarantool.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD90D3A2D5CD15493BE5FC25CDDA03C1C841FDE3111F33A20A0182A05F5380850404C228DA9ACA6FE27A36396FEC4EA42DF4D72B4121E74468654C3B6B180DC35282E3011A20F932F8F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE795530B80AF2ADB7BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637C8DFB935205A313D8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D892A4B9A9DFC230EBA3A2C5F5EAA95D81117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520F8AB6B2BE2218126117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF63F2735A3F024A32BA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B6404C1EB44886FC5F76E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C22494854413538E1713FE827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6A1DCCEB63E2F10FB089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A564DEC7637385B7A0A00166D5EB78DAD44CCA352F90F7F440F87CCE6106E1FC07E67D4AC08A07B9B0DB8A315C1FF4794DBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF2CA60A3849676F74E51F13F9362F6F2CB68AD5709DD4B9F2BE745389B328F25E68A36B291CE9B2EB399DF444199BC1D15A4177A1E3B9FBEE3ABB64B8D727D6D6A74DFFEFA5DC0E7F02C26D483E81D6BE0DBAE6F56676BC7117BB6831D7356A2DEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmIyQFW4pVclwTMsj2NWOAA== X-Mailru-Sender: 49D287FBCBBF3A5C1746B9497B71E89EB8980620CFA49FDD4D72B4121E7446861E1E156D000DABDBEBA65886582A37BD66FEC6BF5C9C28D98A98C1125256619760D574B6FC815AB872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v1] Fix BC_UCLO insertion for returns. 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 Cc: Sergey Bronnikov , tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! On 7/13/23 10:57, Sergey Kaplun wrote: > Hi, Sergey! > Thanks for the fixes! > > Still some thoughts about the `pcall()`. > > On 10.07.23, Sergey Bronnikov wrote: >> Hi, Sergey! >> @@ -110,6 +114,7 @@ f() >>  f = missing_uclo() >>  local _ >>  _, res = pcall(f) >> -test:ok(type(res) == 'function', 'consistency on compilation: type of >> returned value is correct') >> +test:ok(type(res) == 'function', >> +        'consistency on compilation: type of returned value is correct') >> >>  os.exit(test:check() and 0 or 1) >> >>> Do we need pcall here? >> >> I would use it to avoid breaking test due to assert. >> >> Without a pcall: >> >> >> TAP version 13 >> 1..2 >> not ok - VM consistency: type of returned value is correct >>     filename:   eval >>     line:       -1 >>     frame #1 >>       line:     0 >>       source: @test/tarantool-tests/lj-819-fix-missing-uclo.test.lua >>       filename: test/tarantool-tests/lj-819-fix-missing-uclo.test.lua >>       what:     main >>       namewhat: >>       src: test/tarantool-tests/lj-819-fix-missing-uclo.test.lua >>     frame #2 >>       line:     -1 >>       source:   =[C] >>       filename: eval >>       what:     C >>       namewhat: >>       src:      [C] >> luajit: >> /home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/lj_record.c:135: >> rec_check_slots: Assertion `((((((tr))>>24) & IRT_TYPE) - >> (TRef)(IRT_NUM) <= (TRef)(IRT_INT-IRT_NUM)))' failed. >> Aborted (core dumped) >> >> With pcall: >> >> TAP version 13 >> 1..2 >> not ok - VM consistency: type of returned value is correct >> >>    filename:   eval >>     line:       -1 >>     frame #1 >>       line: 0 >>       source: @test/tarantool-tests/lj-819-fix-missing-uclo.test.lua >>       filename: test/tarantool-tests/lj-819-fix-missing-uclo.test.lua >>       what:     main >>       namewhat: >>       src: test/tarantool-tests/lj-819-fix-missing-uclo.test.lua >>     frame #2 >>       line:     -1 >>       source:   =[C] >>       filename: eval >>       what:     C >>       namewhat: >>       src:      [C] >> not ok - consistency on compilation: type of returned value is correct >>     filename:   eval >>     line:       -1 >>     frame #1 >>       line:     0 >> >> >> >> >> I like second output more. > Yes, but there is no trace related to the `f()` only for > `test:check()`: > > | ---- TRACE 1 start tap.lua:33 > | ---- TRACE 2 start 1/stitch tap.lua:34 > | ---- TRACE 3 start tap.lua:16 > | ---- TRACE 3 start tap.lua:80 > > So, with this `pcall()` we lose the JIT testing. With patch below JIT assertion is triggered: --- a/test/tarantool-tests/lj-819-fix-missing-uclo.test.lua +++ b/test/tarantool-tests/lj-819-fix-missing-uclo.test.lua @@ -101,10 +101,10 @@ local function missing_uclo()  end  local f = missing_uclo() -local res = f() +local res_interp = f()  -- Without a patch, we don't get here a function, because upvalue  -- isn't closed as desirable. -test:ok(type(res) == 'function', +test:ok(type(res_interp) == 'function',          'VM consistency: type of returned value is correct')  jit.opt.start('hotloop=1') @@ -112,9 +112,8 @@ jit.opt.start('hotloop=1')  f = missing_uclo()  f()  f = missing_uclo() -local _ -_, res = pcall(f) -test:ok(type(res) == 'function', +local _, res_jit = pcall(f) +test:ok(type(res_jit) == 'function',          'consistency on compilation: type of returned value is correct')  os.exit(test:check() and 0 or 1) In a 1:1 conversation we agreed that it is ok. I added patch to the branch and force-pushed.