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 58C3F7118C; Tue, 12 Oct 2021 11:17:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 58C3F7118C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1634026673; bh=AMIdjNtjfIIxgeTclGd8FIxvp1B+Y7Fkvv4q5xYvFhw=; 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=gM5AGX40Srm5G29FOj2UjVFmUpEqoQLSkC+AFxHJWBdSg2eocLmRioim6iwwZK8To FL7958ta7PpnkkyuhneycHD86oUyjjpL0cAL1kIm/vNwBfpxmHMLSdYHkix3TPvPIY nMVj3KcrsHXuerc7VciXa8kP3p0+qOXD4CbRO8ZU= 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 F0F3A7107D for ; Tue, 12 Oct 2021 11:17:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F0F3A7107D Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1maCyt-0005Yv-1R; Tue, 12 Oct 2021 11:17:51 +0300 Date: Tue, 12 Oct 2021 11:16:10 +0300 To: =?utf-8?B?0JzQsNC60YHQuNC8INCa0L7RgNGP0LrRiNC40L0=?= Message-ID: References: <20210930114337.1575120-1-m.kokryashkin@tarantool.org> <1633983560.725061406@f460.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1633983560.725061406@f460.i.mail.ru> X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD922964B4BA091D9ACDB65386DFBCFEF8EE1B6B9265077B93C182A05F5380850406E6DD28611957D54FCD38C785174F127094053083CACD97B464B55D5EE186682 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE795530B80AF2ADB7BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371E4BC0E00C009995EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F294E8757CC6D865C81846C6F8DA007696CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BAEB924C2B054B06E75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5DACD61BBB5DE542327CDDE2D382DEC2749C979CC67748620D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75DE0727929DDCA7BB410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D343FB425EC7F4D4A4B562338839AAC711AB14BFFD21D717A6E20A98B9B537034BD8547314B7EB4C65C1D7E09C32AA3244C7FE495D247725715252BD9AB3DF18488A95CA90A1D8AC56583B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojtWOf/ZwQPGGjxsb2XeRnWQ== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D19CD2B24DC4FEC86055739AA5C5AA7280FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED567EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] test: adapt test checking reversed function 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: Maxim Kokryashkin , tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the answer! On 11.10.21, Максим Корякшин wrote: > > Hi! Thanks for the comments.  >   > I agree that it is strange to add this test, as long as it does not test > anything, so I propose to remove it. May be as an option, but IMO it is better to leave it commented instead, as a reminder about the problem. Lets wait for the second reviewer here. I'm OK with both solutions. >   > Best regards, > Maxim Kokryashkin >   > >  > >>Hi, Maxim! > >> > >>Thanks for the patch! > >> > >>Please consider my comments below. > >> > >>On 30.09.21, Maxim Kokryashkin wrote: > >>> The first fiber in Tarantool has only 512Kb of the stack which is not enough to > >>> handle such a deep call chain. > >>> The test is adapted to Tarantool by decreasing the string length. > >>> > >>> Closes tarantool/tarantool#5782 > >>> Part of tarantool/tarantool#5845 > >>> Part of tarantool/tarantool#4473 > >> > >>Looks like it should be 5870 instead 4473. Also, 5845 is already > >>closed. > >> > >>> --- > >> > >>Please show the Tarantool branch as well, to show that problem is gone. > >> > >>> GitHub branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5782-adapt-deep-nest-gsub-PUC-Rio > >>> Issue: https://github.com/tarantool/tarantool/issues/5782 > >>> > >>> test/PUC-Rio-Lua-5.1-tests/pm.lua | 9 ++++----- > >>> 1 file changed, 4 insertions(+), 5 deletions(-) > >>> > >>> diff --git a/test/PUC-Rio-Lua-5.1-tests/pm.lua b/test/PUC-Rio-Lua-5.1-tests/pm.lua > >>> index e364ff9d..7da3ef4a 100644 > >>> --- a/test/PUC-Rio-Lua-5.1-tests/pm.lua > >>> +++ b/test/PUC-Rio-Lua-5.1-tests/pm.lua > >>> @@ -206,12 +206,11 @@ function rev (s) > >>> return string.gsub(s, "(.)(.+)", function (c,s1) return rev(s1)..c end) > >>> end > >>> > >>> -local x = string.rep('012345', 10) > >>> --- FIXME: The first Tarantool's fiber has only 512Kb of stack. > >>> --- It is not enough for this recursive call. > >>> +-- This test is adapted to match the stack size (512Kb) of the first fiber in > >>> +-- Tarantool. > >>> -- See also https://github.com/tarantool/tarantool/issues/5782 . > >>> --- The test is disabled for Tarantool binary. > >>> --- assert(rev(rev(x)) == x) > >>> +local x = string.rep('01234', 10) > >>> +assert(rev(rev(x)) == x) > >> > >>The patch is looks OK to me, but the main problem is still here: > >>LuaJIT is badly managing C stack overflow. The same chunk rases an error > >>for Lua 5.1, but crashes for LuaJIT. > >> > >>| $ luajit -e 'local function rev (s) return string.gsub(s, "(.)(.+)", function (c,s1) return rev(s1)..c end) end local x = string.rep("0", 1000) rev(x)' > >>| Segmentation fault > >> > >>| $ lua -e 'local function rev (s) return string.gsub(s, "(.)(.+)", function (c,s1) return rev(s1)..c end) end local x = string.rep("0", 1000) rev(x)' > >>| lua: C stack overflow > >>| stack traceback: > >>| [C]: in function 'gsub' > >>| (command line):1: in function 'rev' > >>| (command line):1: in function <(command line):1> > >>| [C]: in function 'gsub' > >>| (command line):1: in function 'rev' > >>| (command line):1: in function <(command line):1> > >>| [C]: in function 'gsub' > >>| (command line):1: in function 'rev' > >>| (command line):1: in function <(command line):1> > >>| [C]: in function 'gsub' > >>| ... > >>| [C]: in function 'gsub' > >>| (command line):1: in function 'rev' > >>| (command line):1: in function <(command line):1> > >>| [C]: in function 'gsub' > >>| (command line):1: in function 'rev' > >>| (command line):1: in function <(command line):1> > >>| [C]: in function 'gsub' > >>| (command line):1: in function 'rev' > >>| (command line):1: in main chunk > >>| [C]: ? > >> > >>So I suppose it is strange to add test that tests nothing. > >> > >>Thoughts? > >> > >>> > >>> > >>> -- gsub with tables > >>> -- > >>> 2.33.0 > >>> > >> > >>-- > >>Best regards, > >>Sergey Kaplun > >  -- Best regards, Sergey Kaplun