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 65FD270370; Mon, 6 Feb 2023 15:17:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 65FD270370 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1675685868; bh=YV9EmvK48Pb/maquKGI3ZySFsgmwqHneRnfpQZGrgEc=; 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=YyXysqBf2GAvQYE/DIavxepRiSysU3cHR0wyGyh717OdnxWW9ru1LFORJuPWROfUX Oq7BsEnjUQWBgRE5NTT7BatstxalpTYQjH4nH8A9pezdwsuUbsQ77zsGyJBeQBgXmX 3dAc5ffCshvYaHPdP+iX0LrJZ0BfGUGewBY1eu3w= Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [95.163.41.72]) (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 5BF1F70370 for ; Mon, 6 Feb 2023 15:17:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5BF1F70370 Received: by smtp31.i.mail.ru with esmtpa (envelope-from ) id 1pP0RN-008oS1-I5; Mon, 06 Feb 2023 15:17:46 +0300 Message-ID: <75948070-a905-9807-a6d3-44347e80ecc3@tarantool.org> Date: Mon, 6 Feb 2023 15:17:45 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 To: Sergey Kaplun , Sergey Bronnikov References: <821de7208007ffc8f10222761dd264cf0c4a0bb4.1675669159.git.sergeyb@tarantool.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9D919194CF4FC6604A01E0973C23BD86E492C2552DEF709F7182A05F5380850405A4317A07D523D9E5B295EBED9E630FB2C915DF14CE2A1BF7B1149364C50B8F1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE727FD6E7FC3A8F857EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063707C1E244DAE02CF68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D860EABF36DA1FEB8F55A7E9931A0F1FF8117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAE9A1BBD95851C5BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520C65AC60A1F0286FEBDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE140C956E756FBB7A96C9B5BF839F39F6D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE324D079F6B4507B16C0837EA9F3D19764C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637368BCC681386E289EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D343D1F112031EF3D621C765731EEC0830E6BCB457C43EB1CF6EC12F2ACC02236C72A07BD4330C490231D7E09C32AA3244C297EBE0DF6F6D870328987CAAC08C44C05AB220A9D022EBC927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj6shc/GkzDh1MBhmy3Ewn9Q== X-Mailru-Sender: 11C2EC085EDE56FAC71737E9F694C0DEA04F2892B1737BA2764944A3255C7FDCBB5E6CAE047D672B645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] test: disable cases in PUC-Rio tests for debug line hook 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: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for a quick review! See my answers inline. On 2/6/23 11:31, Sergey Kaplun wrote: > Hi, Sergey! > > Thanks for the patch! > Please consider my comments below. > > On 06.02.23, Sergey Bronnikov wrote: >> From: Sergey Bronnikov >> >> In order to fix issue [1] it is required to introduce a wrapper for >> `__pairs()`. This wrapper breaks a couple of tests for builtin debug > IINM, it's not for the metamethod `__pairs`, but for the built-in > function `pairs()`. Right! Updated  commit message. > >> module. > ^ Those tests rely on specific backtrace, which is changed by > an additional wrapper for `pairs()`. Added to commit message. > >> Patch disables testcases when running under Tarantool. >> >> 1. https://github.com/tarantool/tarantool/issues/2867 >> --- >> test/PUC-Rio-Lua-5.1-tests/db.lua | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/test/PUC-Rio-Lua-5.1-tests/db.lua b/test/PUC-Rio-Lua-5.1-tests/db.lua >> index b148c2dd..b05075bb 100644 >> --- a/test/PUC-Rio-Lua-5.1-tests/db.lua >> +++ b/test/PUC-Rio-Lua-5.1-tests/db.lua >> @@ -169,10 +169,12 @@ test([[for i=1,3 do >> end >> ]], {1,2,1,2,1,2,1,3}) >> >> +if not _TARANTOOL then > Minor: It will be nice to add the comment about the wrapper for > `pairs()` in Tarantool here. Added: "Tarantool has a wrapper around builtin function `pairs()`, see see gh-2867. Testcase below relies on a specific backtrace, which is changed by an introduced wrapper for `pairs()`." > >> test([[for i,v in pairs{'a','b'} do >> a=i..v >> end >> ]], {1,2,1,2,1,3}) >> +end >> >> -- Test is adapted to the behaviour of LuaJIT, as it generates >> -- only four line events, unlike Lua, which generates five >> @@ -411,7 +413,9 @@ function g1(x) g(x) end >> >> local function h (x) local f=g1; return f(x) end >> >> +if not _TARANTOOL then >> h(true) >> +end > These changes don't fix the problem for the test in LuaJIT [1]: > > | src/luajit: test/PUC-Rio-Lua-5.1-tests/db.lua:403: assertion failed! > | stack traceback: > | [C]: in function 'assert' > | test/PUC-Rio-Lua-5.1-tests/db.lua:403: in function 'g' > | test/PUC-Rio-Lua-5.1-tests/db.lua:412: in function 'h' > | test/PUC-Rio-Lua-5.1-tests/db.lua:417: in function '_dofile' > | test/PUC-Rio-Lua-5.1-tests/all.lua:89: in main chunk > | [C]: at 0x56039b641064 > As far as the linedefined number for `g1()` function is changed. > > I suggest the following patch (without comments to add) (haven't checked > it on Tarantool): > =================================================================== > diff --git a/test/PUC-Rio-Lua-5.1-tests/db.lua b/test/PUC-Rio-Lua-5.1-tests/db.lua > index b05075bb..550debdc 100644 > --- a/test/PUC-Rio-Lua-5.1-tests/db.lua > +++ b/test/PUC-Rio-Lua-5.1-tests/db.lua > @@ -400,7 +400,7 @@ local function f (x) > if x then > assert(debug.getinfo(1, "S").what == "Lua") > local tail = debug.getinfo(2) > - assert(tail.what == "Lua" and tail.linedefined == 410 and tail.func == g1) > + assert(tail.what == "Lua" and tail.linedefined == 412 and tail.func == g1) > assert(getfenv(3)) > assert(debug.getinfo(3, "S").what == "main") > print"+" > @@ -413,9 +413,7 @@ function g1(x) g(x) end > > local function h (x) local f=g1; return f(x) end > > -if not _TARANTOOL then > h(true) > -end > > local b = {} > debug.sethook(function (e) table.insert(b, e) end, "cr") > =================================================================== Reverted a change around call of h() function, updated line number and added a message to assert with useful information:    if x then      assert(debug.getinfo(1, "S").what == "Lua")      local tail = debug.getinfo(2) -    assert(tail.what == "Lua" and tail.linedefined == 410 and tail.func == g1) +    assert(tail.what == "Lua" and tail.linedefined == 418 and tail.func == g1, +           ("linedefined %s, what %s"):format(tail.linedefined, tail.what))      assert(getfenv(3))      assert(debug.getinfo(3, "S").what == "main")      print"+" >> >> local b = {} >> debug.sethook(function (e) table.insert(b, e) end, "cr") >> -- >> 2.34.1 >> > [1]: https://github.com/tarantool/luajit/actions/runs/4101439522/jobs/7073225472 >