Tarantool development patches archive
 help / color / mirror / Atom feed
From: Maxim Kokryashkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: "Igor Munkin" <imun@tarantool.org>
Cc: "Maxim Kokryashkin" <max.kokryashkin@gmail.com>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches]  [PATCH luajit] test: adapt tests checking traceback in tail call
Date: Tue, 15 Feb 2022 01:21:24 +0300	[thread overview]
Message-ID: <1644877284.438277158@f461.i.mail.ru> (raw)
In-Reply-To: <Yga1IpOqZRfgGQVC@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 3154 bytes --]


Hi!
Thanks for the review!
 
Here is the new commit message:
=======================================================
test: adapt tests checking traceback in tail call
 
LuaJIT does not provide information about tail calls,
unlike, Lua 5.1 does, so a traceback in LuaJIT may be different.
 
Consider this chunk of code:
```
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)
print(debug.traceback(co))
```
 
For LuaJIT traceback looks like the following:
stack traceback:
        [C]: in function 'yield'
        test.lua:5: in function <test.lua:1>
```
 
And for Lua 5.1 it looks like the following:
```
stack traceback:
        [C]: in function 'yield'
        test.lua:5: in function <test.lua:1>
        (tail call): ?
        (tail call): ?
        (tail call): ?
```
 
This commit adapts the corresponding test to the behavior of LuaJIT, so
it doesn't check tail calls anymore.
 
Resolves tarantool/tarantool#5703
Part of tarantool/tarantool#5870
=======================================================
 
New CI branch:  https://github.com/tarantool/tarantool/tree/fckxorg/gh-5703-adapt-traceback-tail-call-PUC-Rio-full-ci
--
Best regards,
Maxim Kokryashkin
 
 
> 
>>Max,
>>
>>Thanks for the patch! LGTM, except a couple of nits.
>>
>>On 09.11.21, Максим Корякшин wrote:
>>>
>>> Hi, Sergey! Thanks for the review!
>>> Here is the new commit message considering your comments:
>>>  
>>> =======================================================
>>> test: adapt tests checking traceback in tail call
>>>  
>>> LuaJIT does not provide information about tail calls,
>>> unlike, Lua 5.1 does, so a traceback in LuaJIT may be different.
>>>  
>>> Consider this chunck of code:
>>
>>Typo: s/chunck/chunk/.
>>
>>> ```
>>> 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)
>>> print(debug.traceback(co))
>>> ```
>>>  
>>> For LuaJIT traceback looks like the following:
>>> stack traceback:
>>>             [C]: in function 'yield'
>>>             test.lua:5: in function <test.lua:1>
>>> ```
>>>  
>>> And for Lua 5.1 it looks like the following:
>>> ```
>>> stack traceback:
>>>             [C]: in function 'yield'
>>>             test.lua:5: in function <test.lua:1>
>>>             (tail call): ?
>>>             (tail call): ?
>>>             (tail call): ?
>>> ```
>>>  
>>> This commit adapts the corresponding test to the behavior of LuaJIT, so
>>> it doesn't check tail calls anymore.
>>>  
>>
>>Please, add "Resolves tarantool/tarantool#5703" here.
>>
>>> Part of tarantool/tarantool#5870
>>> =======================================================
>>>  
>>> CI:   https://github.com/tarantool/tarantool/tree/fckxorg/gh-5703-adapt-traceback-tail-call-PUC-Rio
>>>  
>>> Best regards,
>>> Maxim Kokryashkin
>>
>><snipped>
>>
>>>  
>>
>>--
>>Best regards,
>>IM
> 

[-- Attachment #2: Type: text/html, Size: 5237 bytes --]

  reply	other threads:[~2022-02-14 22:21 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
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 [this message]
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=1644877284.438277158@f461.i.mail.ru \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=max.kokryashkin@gmail.com \
    --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