[Tarantool-patches] [PATCH luajit v2] test: adapt test checking reversed function
skaplun at tarantool.org
Wed Mar 2 08:59:57 MSK 2022
Thanks for the fixes!
On 01.03.22, Maxim Kokryashkin wrote:
> 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)
> -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
| luajit -e '
| local function rev (s)
| return string.gsub(s, "(.)(.+)", function (c,s1)
| return rev(s1)..c
| local x = string.rep("0", 1000)
> +local x = string.rep('01234', 10)
> +assert(rev(rev(x)) == x)
> -- gsub with tables
More information about the Tarantool-patches