From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Roman Khabibov <roman.habibov@tarantool.org>, tml <tarantool-patches@dev.tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] serializer: serialize recursive structures Date: Tue, 13 Apr 2021 18:54:14 +0300 [thread overview] Message-ID: <9edf496a-3681-44f9-6e89-1d44bcc193b2@tarantool.org> (raw) In-Reply-To: <20210311054949.91263-1-roman.habibov@tarantool.org> Hello! thanks for the patch! 1. I have reverted all changes and test passed. 2. In commit message you declares recursive structures support. What is the max supported depth of recursive structure? I believe it is worth to describe possible limitations in commit message. See inline On 11.03.2021 08:49, Roman Khabibov via Tarantool-patches wrote: > Fix bug with bus error during serializing of recursive > structures. > > Closes #3228 > --- > > Branch: https://github.com/tarantool/tarantool/tree/romanhabibov/gh-3228-visited-set > Issue: https://github.com/tarantool/tarantool/issues/3228 > > src/box/lua/call.c | 6 +- > src/box/lua/execute.c | 2 +- > src/box/lua/serialize_lua.c | 96 ++------ > src/box/lua/tuple.c | 2 +- > src/box/sql/func.c | 2 +- > src/lua/msgpack.c | 10 +- > src/lua/pickle.c | 2 +- > src/lua/utils.c | 226 ++++++++++++++++-- > src/lua/utils.h | 43 +++- > ...-3228-serializer-look-for-recursion.result | 67 ++++++ > ...228-serializer-look-for-recursion.test.lua | 17 ++ > test/swim/swim.result | 18 +- > third_party/lua-cjson/lua_cjson.c | 4 +- > third_party/lua-yaml/lyaml.cc | 88 +++---- > 14 files changed, 390 insertions(+), 193 deletions(-) > create mode 100644 test/app/gh-3228-serializer-look-for-recursion.result > create mode 100644 test/app/gh-3228-serializer-look-for-recursion.test.lua <snipped> > diff --git a/test/app/gh-3228-serializer-look-for-recursion.test.lua b/test/app/gh-3228-serializer-look-for-recursion.test.lua > new file mode 100644 > index 000000000..1c9b0375f > --- /dev/null > +++ b/test/app/gh-3228-serializer-look-for-recursion.test.lua > @@ -0,0 +1,17 @@ > +test_run = require('test_run').new() > + > +-- > +-- gh-3228: Check the error message in the case of a __serialize > +-- function generating infinite recursion. > +-- > +setmetatable({}, {__serialize = function(a) return a end}) > +setmetatable({}, {__serialize = function(a) return {a} end}) > +setmetatable({}, {__serialize = function(a) return {a, a} end}) > +setmetatable({}, {__serialize = function(a) return {a, a, a} end}) > +setmetatable({}, {__serialize = function(a) return {{a, a}, a} end}) > +setmetatable({}, {__serialize = function(a) return {a, 1} end}) > +setmetatable({}, {__serialize = function(a) return {{{{a}}}} end}) > +setmetatable({}, {__serialize = function(a) return {{{{1}}}} end}) 3. Are you sure 4 levels depth is enough to check recursive structure? What is about testing max depth? > +b = {} > +setmetatable({b}, {__serialize = function(a) return {a_1 = a, a_2 = a, b_1 = b, b_2 = b} end}) > +setmetatable({b}, {__serialize = function(a) return {a_1 = a, a_2 = {a, b}, b = b} end}) > diff --git a/test/swim/swim.result b/test/swim/swim.result > index bfc83c143..539131677 100644 > --- a/test/swim/swim.result > +++ b/test/swim/swim.result > @@ -1322,16 +1322,13 @@ m_list > incarnation: cdata {generation = 0ULL, version = 1ULL} > uuid: 00000000-0000-1000-8000-000000000002 > payload_size: 0 > - - uri: 127.0.0.1:<port> > - status: alive > - incarnation: cdata {generation = 0ULL, version = 2ULL} > - uuid: 00000000-0000-1000-8000-000000000001 > - payload_size: 8 > - - uri: 127.0.0.1:<port> > + - &0 > + uri: 127.0.0.1:<port> > status: alive > incarnation: cdata {generation = 0ULL, version = 2ULL} > uuid: 00000000-0000-1000-8000-000000000001 > payload_size: 8 > + - *0 > ... > e_list > --- > @@ -1374,16 +1371,13 @@ fiber.sleep(0) > -- Two events - status update to 'left', and 'drop'. > m_list > --- > -- - uri: 127.0.0.1:<port> > - status: left > - incarnation: cdata {generation = 0ULL, version = 1ULL} > - uuid: 00000000-0000-1000-8000-000000000002 > - payload_size: 0 > - - uri: 127.0.0.1:<port> > +- - &0 > + uri: 127.0.0.1:<port> > status: left > incarnation: cdata {generation = 0ULL, version = 1ULL} > uuid: 00000000-0000-1000-8000-000000000002 > payload_size: 0 > + - *0 > ... > e_list > --- 4. How changes in swim test related to patch? It is not clear from commit message. <snipped>
next prev parent reply other threads:[~2021-04-13 15:54 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-11 5:49 Roman Khabibov via Tarantool-patches 2021-03-14 12:42 ` Sergey Kaplun via Tarantool-patches 2021-04-05 22:05 ` Roman Khabibov via Tarantool-patches 2021-04-21 9:27 ` Sergey Kaplun via Tarantool-patches 2021-04-21 13:12 ` Sergey Bronnikov via Tarantool-patches 2021-04-21 18:20 ` Sergey Kaplun via Tarantool-patches 2021-04-13 15:54 ` Sergey Bronnikov via Tarantool-patches [this message] 2021-04-15 20:39 ` Roman Khabibov via Tarantool-patches 2021-04-21 12:34 ` Sergey Bronnikov via Tarantool-patches 2021-07-07 22:42 ` Alexander Turenko 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=9edf496a-3681-44f9-6e89-1d44bcc193b2@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=roman.habibov@tarantool.org \ --cc=sergeyb@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH] serializer: serialize recursive structures' \ /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