Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Maxim Kokryashkin <max.kokryashkin@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit v2] test: adapt test checking reversed function
Date: Wed, 2 Mar 2022 08:59:57 +0300	[thread overview]
Message-ID: <Yh8H3fpJ3cJ7Hj9a@root> (raw)
In-Reply-To: <20220228235445.1841219-1-m.kokryashkin@tarantool.org>

Hi, Maxim!

Thanks for the fixes!

LGTM.

On 01.03.22, Maxim Kokryashkin wrote:

<snipped>

> diff --git a/test/PUC-Rio-Lua-5.1-tests/pm.lua b/test/PUC-Rio-Lua-5.1-tests/pm.lua
> index e364ff9d..61f437f6 100644
> --- a/test/PUC-Rio-Lua-5.1-tests/pm.lua
> +++ b/test/PUC-Rio-Lua-5.1-tests/pm.lua
> @@ -206,12 +206,16 @@ 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.
> +-- The first fiber in Tarantool has only 512Kb of the stack,
> +-- which is not enough to handle such a deep call chain. Thus,
> +-- the chunk of code being considered cores with SIGSEGV as a
> +-- result of C stack overflow.
> +--
> +-- This test is adapted to match the stack size of the first fiber in
> +-- Tarantool by decreasing the string length.
>  -- See also https://github.com/tarantool/tarantool/issues/5782.
> --- The test is disabled for Tarantool binary.
> --- assert(rev(rev(x)) == x)

Minor: Please, add the comment, that the following example crashes both
Tarantool and LuaJIT (so the problem with C stack overflow still
exists):

| 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)
| '

> +local x = string.rep('01234', 10)
> +assert(rev(rev(x)) == x)
>  
>  
>  -- gsub with tables
> -- 
> 2.35.1
> 

-- 
Best regards,
Sergey Kaplun

  reply	other threads:[~2022-03-02  6:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 23:54 Maxim Kokryashkin via Tarantool-patches
2022-03-02  5:59 ` Sergey Kaplun via Tarantool-patches [this message]
2022-06-01 14:31 ` Igor Munkin via Tarantool-patches
2022-06-20 12:47 ` Igor Munkin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yh8H3fpJ3cJ7Hj9a@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=max.kokryashkin@gmail.com \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit v2] test: adapt test checking reversed function' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox