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 152F270CB2; Mon, 11 Oct 2021 18:13:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 152F270CB2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1633965218; bh=Sm9CXkE9JMU284zNHagxKgOeD0EsE8IlXMBLqbxo/CE=; 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=fR3dA8of1hf/LwF7oJyR/TDuVe9sAGxh5qKfgAG/iQDLyBlJfEWRifCUQjvi71hCL E7dSACS9hM5DgJa0OwJOXuQo9qKX5hd9QPK19MIeaVjhLlZvf2q2R/xRCUYoc0lvn6 7FLtfZWu5Yvs9srh50JEHbFy0nqbzsEEHvWJg0aU= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 AF8CE70CB2 for ; Mon, 11 Oct 2021 18:13:36 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AF8CE70CB2 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mZwzf-0001WC-W3; Mon, 11 Oct 2021 18:13:36 +0300 Date: Mon, 11 Oct 2021 18:11:55 +0300 To: Maxim Kokryashkin Message-ID: References: <20210924172519.121517-1-m.kokryashkin@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210924172519.121517-1-m.kokryashkin@tarantool.org> X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD922964B4BA091D9ACDB65386DFBCFEF8EE1B6B9265077B93C182A05F53808504043C5709C01D17D8A4FAF04BF3EB5AB08F2B9E90DE0AA7DD151AD2872973D431E X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE776377A057133B646EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375F0BD5CF353A411D8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D3B0CA6C86D383C42A631D868CBD7563117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B67393CE827C55B5F775ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A59AC51EDEFB523C0C4C1827DD50FD8431F5A309B54D765702D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA759D2A03B9C34326B3410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34ECB3E21D3CD9CB4F9C54A9E401B8BA4A7E01AD587061FA8437C72417FCDD85E66E0F7878B9BF7FB71D7E09C32AA3244C6BBE07A75F43ED865A2AB2D0D4E6E7CD6C24832127668422927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioju/+AAevgYAWuHKTdT20JLA== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D2A7265166C69E833A8106E0ED3C380B30FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED567EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] test: adapt tests checking traceback in tail call 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Maxim! Thanks for the patch! LGTM except a few nits, regarding the commit message. On 24.09.21, Maxim Kokryashkin wrote: > LuaJIT does not provide information about tail calls Typo: s/calls/calls,/ > unlike, Lua 5.1 does, so a traceback in LuaJIT may be different. > > Consider this chunck of code: > ``` > local function checktraceback (co, p) > local tb = debug.traceback(co) > local i = 0 > for l in string.gmatch(tb, "[^\n]+\n?") do > assert(i == 0 or string.find(l, p[i])) > i = i+1 > end > assert(p[i] == nil) > end > > local function f (n) > if n > 0 then return f(n-1) > else coroutine.yield() end > end > > local co = coroutine.create(f) > coroutine.resume(co, 3) > checktraceback(co, {"yield", "db.lua", "tail", "tail", "tail"}) > ``` > > For LuaJIT traceback looks like the following: > ``` > stack traceback: > [C]: in function 'yield' > db.lua:436: in function > ``` > > And for Lua 5.1 it looks like the following: > ``` > stack traceback: > [C]: in function 'yield' > db.lua:436: in function > (tail call): ? > (tail call): ? > (tail call): ? > ``` Please provide a simple example in the commit message. This is too monstrous. Also, it is a good practice to mention what the patch does. > > Closes tarantool/tarantool#5703 > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 Looks like it should be 5870 instead 4473. Also, 5845 is already closed. > --- > Issue: https://github.com/tarantool/tarantool/issues/5703 > GitHub branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5703-adapt-traceback-tail-call-PUC-Rio > > test/PUC-Rio-Lua-5.1-tests/db.lua | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/test/PUC-Rio-Lua-5.1-tests/db.lua b/test/PUC-Rio-Lua-5.1-tests/db.lua > index 56f59ea8..f254cde6 100644 > --- a/test/PUC-Rio-Lua-5.1-tests/db.lua > +++ b/test/PUC-Rio-Lua-5.1-tests/db.lua > -- > 2.33.0 > -- Best regards, Sergey Kaplun