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 A87166EC60; Wed, 31 Mar 2021 22:24:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A87166EC60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617218660; bh=MGTRF5TWLcKRsQevQAP6GoWf/jnLb0cBeCVt3NjWteE=; 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=p0UrU4Wt6RN/oAxL7vfQb5V+KXejUO5LnD5CXGfgfAz4Hm/rYO6uMJLEW4KZ6pqUr Fx9zm4vJ7BCBI1UvZ2xO9CzcoMw3SwsxaTQMa3EPvzuPUhfc0rN7IhZkyK3mgfYZ6f SEIVsqBytjE9VvZxVKqISaThtztksiMJApsSV4Ps= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 F36766EC60 for ; Wed, 31 Mar 2021 22:24:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F36766EC60 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lRgRc-0002oe-7u; Wed, 31 Mar 2021 22:24:00 +0300 Date: Wed, 31 Mar 2021 22:23:50 +0300 To: Sergey Kaplun Message-ID: <20210331192350.GK29703@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32947A0146560F8BA70927CAA5B950F38D9F182A05F538085040C0D87368917035666E5E16F25E08329575A5AC4FE069FC6736C3614F0FB4F7C0 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE731D82F3F177D3BCDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637FD169B9D7A3022168638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95CE99938B3FD79E1DF5EF85449CB250B8ACE3225A1A7E45D79A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C37EF884183F8E4D67117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735B58781B77DE60D36C4224003CC83647689D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C978312F0A634159382C9649269A4754B3489E X-C1DE0DAB: 0D63561A33F958A57B2C8349345B12997267B64D9AA7556AEFBA59A1B681AF9ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C1D376EF32BB0896D1857705927952E872485E7BA03C4B40EC78A034E6B523EC28B22457F5952E4F1D7E09C32AA3244CD95E74FEBAFB67EFE5FE2A7F5559A7078A6D4CC6FBFAC251927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojetunDCtJ20I6ABQeN/Hgxg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638226A5C5EA60994CA44F677B84E0C22FE3AA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 23/30] test: disable PUC Lua test for fast function name 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, Thanks for the patch! Please consider the comments below. On 26.03.21, Sergey Kaplun wrote: > LuaJIT can't determine bytecode position for non Lua functions > (in particular for fast functions) and, therefore, detect built-in > function names for errors in tail calls. Side note: here is the inconsistency in your usage of possessive nouns. > > This patch disables test that checks name of built-in functions Typo: s/disables test/disables the test/. Typo: s/checks name/checks the name/. > reported in error in tail call. > > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 > --- > test/PUC-Lua-5.1-tests/errors.lua | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/test/PUC-Lua-5.1-tests/errors.lua b/test/PUC-Lua-5.1-tests/errors.lua > index cf24e40..af776a7 100644 > --- a/test/PUC-Lua-5.1-tests/errors.lua > +++ b/test/PUC-Lua-5.1-tests/errors.lua > @@ -105,9 +105,13 @@ while 1 do > insert(prefix, a) > end]], "global 'insert'") > > -checkmessage([[ -- tail call > - return math.sin("a") > -]], "'sin'") > +-- LuaJIT: Can't determine bytecode position for non Lua functions > +-- (in particular for fast functions) and, therefore, detect fast > +-- function names for errors in tail calls. This is kinda gibberish. I've tried the following snippets and can't understand what do you mean by this comment. | $ luajit -e 'function q(a) return math.sin(a) end q("a")' | luajit: (command line):1: bad argument #1 to 'q' (number expected, got string) | stack traceback: | [C]: in function 'q' | (command line):1: in main chunk | [C]: at 0x5610e8497eb0 | $ luajit -e 'loadstring("return math.sin([[a]])")()' | luajit: (command line):1: bad argument #1 to '?' (number expected, got string) | stack traceback: | [builtin#43]: at 0x7fc0f807ad10 | (command line):1: in main chunk | [C]: at 0x55c1e85c7eb0 I understand the first result. The second result surprised me, but I've never investigated how loadstring call works (it looks like specifics of VARG frame, but this is a wild guess). But neither of them fits your explanation. The root cause is the same: callee uses caller frame, since caller doesn't need it anymore. Could you please clarify yours? > +-- The test is disabled for LuaJIT. > +-- checkmessage([[ -- tail call > +-- return math.sin("a") > +-- ]], "'sin'") > > checkmessage([[collectgarbage("nooption")]], "invalid option") > > -- > 2.31.0 > -- Best regards, IM