From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 89BE045C304 for ; Fri, 11 Dec 2020 06:22:25 +0300 (MSK) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) From: Roman Khabibov In-Reply-To: <20201208172522.GL5396@tarantool.org> Date: Fri, 11 Dec 2020 08:22:23 +0500 Content-Transfer-Encoding: quoted-printable Message-Id: <2230BA89-2905-4A22-A74A-BB59FC53136B@tarantool.org> References: <20201117164012.14652-1-roman.habibov@tarantool.org> <20201123202841.GC14086@tarantool.org> <20201208172522.GL5396@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] serializer: check for recursive serialization List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Hi! > On Dec 8, 2020, at 22:25, Igor Munkin wrote: >=20 > Sergos, >=20 > On 08.12.20, Sergey Ostanevich wrote: >> Hi! >>=20 >> Thanks for the patch! >>=20 >> My biggest concern was how would you check the recursion appears. You >=20 > Well, I see the issue is reported for "identity" serializer = (considering > documentation request and the error message), and such recursion can = be > fixed the way Roma did. You're talking about a general case of = infinite > recursions, but I believe there is no other approach to handle this > situation the way different from one Python does (I mentioned it in my > previous review[1]). By the way, other runtimes such as Perl starts > spamming with the corresponding warning after the recursion hits the > "soft" limit, but the result is the same: stack overflow. Thoughts? Let=E2=80=99s just add =E2=80=98hard=E2=80=99 limit? Only it is not = clear how to calculate its value. Just empirically? >> just check if the result is equivalent to the argument. To me it is >> not enough, obviously. I tried this on your branch and=E2=80=A6 >>=20 >>=20 >> tarantool> setmetatable({},{__serialize =3D function(_) return {_} = end}) >> Segmentation fault (core dumped) >>=20 >>=20 >> Regards, >> Sergos >>=20 >=20 > >=20 >>=20 >=20 > [1]: = https://lists.tarantool.org/pipermail/tarantool-patches/2020-July/018524.h= tml >=20 > --=20 > Best regards, > IM