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 03B426F3C7; Fri, 26 Mar 2021 14:49:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 03B426F3C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616759373; bh=fdgJEVD8DafpDJuS+3UWOzfkG//htNn448pfG92Fo84=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=j267g3TV9jp3ykq6haNykh5owBUOx9tOCoXfdp//3vFhIEhdgToIazWnJgYrYHYUQ LHXDN0Kytd3r9RSxLsyQRkc7iUXhbWUKqZq0kSQ6/INEx9lcSKzZAiupVyqg6UdMtK uMhrDUaIQvBhUzMvP1Pqc9vqC21003MYmpKOjA/A= Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (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 CDE106F3C7 for ; Fri, 26 Mar 2021 14:49:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CDE106F3C7 Received: by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1lPky3-0007k1-1h; Fri, 26 Mar 2021 14:49:31 +0300 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: Date: Fri, 26 Mar 2021 14:49:29 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Sergey Kaplun X-Mailer: Apple Mail (2.3654.60.0.2.21) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9064ADF4728AA0EE922675D89A18E042B1EBC993A8274C79D182A05F5380850408CF26670790B92E734A2844D87D0FCD174563EE84252F27A641589CDE250EB22 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78981306C6E927004EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063729381D024F10DD158638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C5DD32608FC869F5DD07B7B76F3C5934BC798B6B06C6AF3B6A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE74A95F4E53E8DCE969FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C32609375A3A81E2DD117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7352629B07FD02F83A6C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5A333789D2D8A35358F5C60282236E50E21ABE2073E47F144D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34987A0E8D235BB5343B742C411B1F76DFEF4CEBEC1F2671CC3F5EDA126F6608789F7A3328EEF65C691D7E09C32AA3244C429F825D625A4836BA3A43CB78DB9496C86C126E7119A0FEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojapPp7P/VpAhlo4jgHvBI+g== X-Mailru-Sender: 3B9A0136629DC912F4AABCEFC589C81E7E564150DABF770A50282823881ED127D586A72D9E53DC1DAD07DD1419AC565FA614486B47F28B67C5E079CCF3B0523AED31B7EB2E253A9E112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 12/30] test: adapt PUC Lua 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 Ostanevich via Tarantool-patches Reply-To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" LGTM. Sergos > On 26 Mar 2021, at 10:42, Sergey Kaplun wrote: >=20 > 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.). >=20 > This patch adapts these tests for LuaJIT by disabling JIT while = testing > count hooks. >=20 > Closes tarantool/tarantool#5701 > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 > --- > test/PUC-Lua-5.1-tests/db.lua | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) >=20 > diff --git a/test/PUC-Lua-5.1-tests/db.lua = b/test/PUC-Lua-5.1-tests/db.lua > index 6985c29..c1a635a 100644 > --- a/test/PUC-Lua-5.1-tests/db.lua > +++ b/test/PUC-Lua-5.1-tests/db.lua > @@ -347,6 +347,18 @@ assert(debug.setupvalue(io.read, 1, 10) =3D=3D = nil) >=20 > -- testing count hooks > local a=3D0 > +-- 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 =3D jit.status() > +if jit_is_enabled then > + jit.off() > +end > debug.sethook(function (e) a=3Da+1 end, "", 1) > a=3D0; for i=3D1,1000 do end; assert(1000 < a and a < 1012) > debug.sethook(function (e) a=3Da+1 end, "", 4) > @@ -359,6 +371,9 @@ debug.sethook(print, "", 2^24 - 1) -- count = upperbound > local f,m,c =3D debug.gethook() > assert(({debug.gethook()})[3] =3D=3D 2^24 - 1) > debug.sethook() > +if jit_is_enabled then > + jit.on() > +end >=20 >=20 > -- tests for tail calls > --=20 > 2.31.0 >=20