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 356CB6B944; Tue, 13 Apr 2021 16:34:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 356CB6B944 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618320872; bh=jRV2SFdGBgfFXONYwui4mWjwP1kA6HnKU8rc57llPag=; 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=lWon1G10bu1ZnPmdjBh5ml8QfyI+DfCLZfSY3sFzusgE3FbOR7jWI0oBvbywXhnXW ox4iUGmGrjD19wNw+s2f/7R6cmCEpg2QzE/oR0Mb+nX68wQW3QITbaQDOD2pwOabDr GRuaqA7GLL0+8fuRNcieFb87RGxomjRINCriJzpg= 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 58B636B95D for ; Tue, 13 Apr 2021 16:28:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 58B636B95D Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1lWJ5t-0000dj-D8; Tue, 13 Apr 2021 16:28:41 +0300 To: Sergey Ostanevich , Igor Munkin Date: Tue, 13 Apr 2021 16:27:12 +0300 Message-Id: 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: 4F1203BC0FB41BD92FFCB8E6708E7480B1C8842CE613979723F2FB4628545A35182A05F5380850406692DE025B4E9A95173DD220FC1C0ACFB6FA057C6BBFCB4113E38214E58A43EC X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73F64378C139886A6EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637EDC9855826FBDF5A8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2EE60049A4206A4E12D9588294444DD30BDFBBEFFF4125B51D2E47CDBA5A96583C09775C1D3CA48CF11471C67CF6D96D5117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7BE2AB513042E4E129FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA73A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E73525A4AB119743A3B3C4224003CC83647689D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831623F6B40DBB227C8D5EE6400B98F466E X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CB69F9342289A40B36B360165EC88ACA19228C2C55C75FA479C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D340297C696F996E384EFD368938F824687DFD29586E58E148E3D10EFCA536414B01D98B5BB1D208BEB1D7E09C32AA3244C8C8F185CABEF36358D4CEB2CEB3518DB3C6EB905E3A8056B927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnA7/qPBUIXHMeKlDMhp1yg== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB4B955716FE23FCAE70CB0C4669B49AB2C0AFB56C7FFF68B6EF2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit v3 12/29] test: adapt PUC-Rio test with count hooks 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" LuaJIT does not check hooks at traces without defined -DLUAJIT_ENABLE_CHECKHOOK. For more information see or commit 6bce6b118eeb2bb7f36157de158e5cccf0ea68e5 (Add compile-time option LUAJIT_ENABLE_CHECKHOOK. Disabled by default.). This patch adapts these tests for LuaJIT by disabling JIT while testing count hooks. Resolves tarantool/tarantool#5701 Part of tarantool/tarantool#5845 Part of tarantool/tarantool#4473 --- test/PUC-Rio-Lua-5.1-tests/db.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/PUC-Rio-Lua-5.1-tests/db.lua b/test/PUC-Rio-Lua-5.1-tests/db.lua index 6c412170..db69b2df 100644 --- a/test/PUC-Rio-Lua-5.1-tests/db.lua +++ b/test/PUC-Rio-Lua-5.1-tests/db.lua @@ -350,6 +350,18 @@ assert(debug.setupvalue(io.read, 1, 10) == nil) -- testing count hooks local a=0 +-- LuaJIT: LuaJIT does not check hooks at traces without defined +-- -DLUAJIT_ENABLE_CHECKHOOK. +-- For more information see or commit +-- 6bce6b118eeb2bb7f36157de158e5cccf0ea68e5 (Add compile-time +-- option LUAJIT_ENABLE_CHECKHOOK. Disabled by default.). +-- See also https://github.com/tarantool/tarantool/issues/5701 +-- Test is adapted for LuaJIT by disabling JIT while +-- testing count hooks. +local jit_is_enabled = jit.status() +if jit_is_enabled then + jit.off() +end debug.sethook(function (e) a=a+1 end, "", 1) a=0; for i=1,1000 do end; assert(1000 < a and a < 1012) debug.sethook(function (e) a=a+1 end, "", 4) @@ -362,6 +374,9 @@ debug.sethook(print, "", 2^24 - 1) -- count upperbound local f,m,c = debug.gethook() assert(({debug.gethook()})[3] == 2^24 - 1) debug.sethook() +if jit_is_enabled then + jit.on() +end -- tests for tail calls -- 2.31.0