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 740506B963; Tue, 13 Apr 2021 16:38:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 740506B963 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618321115; bh=niY2cawy0Mi1lN9XGrQUfvn4A4sLuS2nhwyYY8+iKaA=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=T2dUSEpr9Nlp9Yf3NeMLMEQ+7yI0iLXJHR0xysd17/4+ckEZE2ORn8dgQUIPUpkr3 KKOywSF+B9bZiaTGwtxBCuU3Jex8A+Z9mdz52y34ruXh6UmWHUDzQUQ1yKTXfRaQYf deA9gLWrCNq1XV7eIs7eqDcg98Snl32vgz/cWoIQ= Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 B255B6B965 for ; Tue, 13 Apr 2021 16:28:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B255B6B965 Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1lWJ69-0000dj-UV; Tue, 13 Apr 2021 16:28:58 +0300 To: Sergey Ostanevich , Igor Munkin Date: Tue, 13 Apr 2021 16:27:20 +0300 Message-Id: <113f75ade478fa79faf917498d3c57b817a42004.1618320000.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E748094FADAEB10E66ADA4C48BE3C291E66DA182A05F5380850409114B656A7C081A72C1F7688E456798DB6CBA9EB1F640712E89D972F41D4B806 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AB524098FB2F2222EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378D7045943A292EC88638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B25228548B4D35D3BA8CC36C274C522EA116A3AA18C56759C2D2E47CDBA5A96583C09775C1D3CA48CFFD59DAE6580CC3C3117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE791DAD9F922AA71188941B15DA834481F9449624AB7ADAF372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F4AF35CDC743633045E1C53F199C2BB95B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CB69F9342289A40B3DA9E25E08F682D75C0D50ADCD1481EEA9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3473688ED311681BF0C9BA0E99D6CA74B2A57181D69E89DA78ADCB109F834A34C93FCAE9A4C8B8940D1D7E09C32AA3244CCCF29A46AD38D47B3DDCA2030CE087BDF2F5F14F68F1805B927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnA7/qPBUIXGbyIQlm7Grjw== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB4299E6562926F10990CB0C4669B49AB2CB18789A3A159887FF2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit v3 20/29] test: disable PUC-Rio test for getfenv in tailcall 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" Tail calls are not taken into account for call-level counting. So, `getfenv()` behaviour in LuaJIT is different from Lua 5.1 in tailcalls. LuaJIT doesn't create an additional frame for tailcalls, just uses the previous one. This patch disables test for the return result of `getfenv()` tailcall. Default value (equals to 1) of `getfenv()` function's argument (function level) is invalid for this tailcall -- LuaJIT can't provide necessary debug information for the frame. Relates to tarantool/tarantool#5713 Part of tarantool/tarantool#5845 Part of tarantool/tarantool#4473 --- test/PUC-Rio-Lua-5.1-tests/closure.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/PUC-Rio-Lua-5.1-tests/closure.lua b/test/PUC-Rio-Lua-5.1-tests/closure.lua index fdcfe934..551fe70d 100644 --- a/test/PUC-Rio-Lua-5.1-tests/closure.lua +++ b/test/PUC-Rio-Lua-5.1-tests/closure.lua @@ -174,7 +174,15 @@ f = coroutine.wrap(foo) local a = {} assert(f(a) == _G) local a,b = pcall(f) -assert(a and b == _G) +-- FIXME: LuaJIT doesn't take into account tail calls for +-- call-level counting, so `getfenv()` behaviour is different +-- in tail calls. For example, this `pcall()` returns false, +-- because `getfenv()` default level is 1 which is invalid for +-- this case when is called from tail call (`lj_debug_frame()` +-- returns NULL). +-- See also https://github.com/tarantool/tarantool/issues/5713. +-- Test is disabled for LuaJIT for now. +-- assert(a and b == _G) -- tests for multiple yield/resume arguments -- 2.31.0