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] test: adapt tests checking traceback in tail call Date: Mon, 11 Oct 2021 18:11:55 +0300 [thread overview] Message-ID: <YWRUO9lcBIEza340@root> (raw) In-Reply-To: <20210924172519.121517-1-m.kokryashkin@tarantool.org> Hi, Maxim! Thanks for the patch! LGTM except a few nits, regarding the commit message. On 24.09.21, Maxim Kokryashkin wrote: > LuaJIT does not provide information about tail calls Typo: s/calls/calls,/ > unlike, Lua 5.1 does, so a traceback in LuaJIT may be different. > > Consider this chunck of code: > ``` > local function checktraceback (co, p) > local tb = debug.traceback(co) > local i = 0 > for l in string.gmatch(tb, "[^\n]+\n?") do > assert(i == 0 or string.find(l, p[i])) > i = i+1 > end > assert(p[i] == nil) > end > > local function f (n) > if n > 0 then return f(n-1) > else coroutine.yield() end > end > > local co = coroutine.create(f) > coroutine.resume(co, 3) > checktraceback(co, {"yield", "db.lua", "tail", "tail", "tail"}) > ``` > > For LuaJIT traceback looks like the following: > ``` > stack traceback: > [C]: in function 'yield' > db.lua:436: in function <db.lua:434> > ``` > > And for Lua 5.1 it looks like the following: > ``` > stack traceback: > [C]: in function 'yield' > db.lua:436: in function <db.lua:434> > (tail call): ? > (tail call): ? > (tail call): ? > ``` Please provide a simple example in the commit message. This is too monstrous. Also, it is a good practice to mention what the patch does. > > Closes tarantool/tarantool#5703 > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 Looks like it should be 5870 instead 4473. Also, 5845 is already closed. > --- > Issue: https://github.com/tarantool/tarantool/issues/5703 > GitHub branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-5703-adapt-traceback-tail-call-PUC-Rio > > test/PUC-Rio-Lua-5.1-tests/db.lua | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/test/PUC-Rio-Lua-5.1-tests/db.lua b/test/PUC-Rio-Lua-5.1-tests/db.lua > index 56f59ea8..f254cde6 100644 > --- a/test/PUC-Rio-Lua-5.1-tests/db.lua > +++ b/test/PUC-Rio-Lua-5.1-tests/db.lua <snipped> > -- > 2.33.0 > -- Best regards, Sergey Kaplun
next prev parent reply other threads:[~2021-10-11 15:13 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-24 17:25 Maxim Kokryashkin via Tarantool-patches 2021-09-24 18:28 ` Максим Корякшин via Tarantool-patches 2021-10-11 15:11 ` Sergey Kaplun via Tarantool-patches [this message] 2021-11-09 16:59 ` Максим Корякшин via Tarantool-patches 2022-02-11 19:12 ` Igor Munkin via Tarantool-patches 2022-02-14 22:21 ` Maxim Kokryashkin via Tarantool-patches 2022-02-17 16:36 ` 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=YWRUO9lcBIEza340@root \ --to=tarantool-patches@dev.tarantool.org \ --cc=max.kokryashkin@gmail.com \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit] test: adapt tests checking traceback in tail call' \ /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