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 345966E454; Thu, 17 Feb 2022 19:40:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 345966E454 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1645116017; bh=Jun6RDKQknywDVqFCvytxO1hhxDyHkDmTudzZKhO7OM=; 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=RMoqdPojvr29JN6K8yUn0GCOH8L+1HYZgGXryoLA4D0zGB72TMbjBVL78MSbo+0AF XCaFgdvH4YLjKIhLXa0mts3YKzcQMBX8YU/DmNsW9nLhp9G5saMJDHb+YLLQWGKILi s7egqR3mTYgRTkH1cJRQG/Q2dxQbWvONMYF4nyI8= 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 DBF216E454 for ; Thu, 17 Feb 2022 19:40:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DBF216E454 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1nKjpG-0007vE-VK; Thu, 17 Feb 2022 19:40:15 +0300 Date: Thu, 17 Feb 2022 19:36:58 +0300 To: Maxim Kokryashkin Message-ID: References: <20210924172519.121517-1-m.kokryashkin@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210924172519.121517-1-m.kokryashkin@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD923F1B5F87BDC70E65A8F887F9034DEDC9D51F702AE775558182A05F53808504086E12E4B2D1A6C6EF50540AE1E6CF54EB834B31E226FBA2A415F4346395F2E4D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F2919D563845004AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063727599E9BE65898D58638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D1F9CA7AC368FF8A4D8837E9EBEC0126117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CB1724D34C644744043847C11F186F3C59DAA53EE0834AAEE X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 0D63561A33F958A533CE971758F4CB38F544510BA31150AE5931CFDEB7F70119D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752FA4FC647EE431D9410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34806D3522FB05EB399C47FB02FA62945D38592AC4DE516194E102A4687B631954E80623A4543DA3D11D7E09C32AA3244C9DD91C9EC0EC3B1E7167F0CAD0BC25E355E75C8D0ED9F6EE83B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj8IMJ5WMmQGExD29HYcBL1g== X-Mailru-Sender: 689FA8AB762F739339CABD9B3CA9A7D6A0675A63B182CFB32C6C8EDA58C2AE71A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 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: 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" Max, I've checked the patch into all long-term branches in tarantool/luajit and bumped a new version in 1.10, 2.8 and master. On 24.09.21, Maxim Kokryashkin wrote: > LuaJIT does not provide information about tail 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): ? > ``` > > Closes tarantool/tarantool#5703 > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 > --- > 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(-) > > -- > 2.33.0 > -- Best regards, IM