From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 5D3CC469719 for ; Mon, 14 Sep 2020 17:43:58 +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: <20200714104027.GF296695@grain> Date: Mon, 14 Sep 2020 17:43:56 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20200710120109.91675-1-roman.habibov@tarantool.org> <20200710122958.GF1999@grain> <20200714094533.GK5559@tarantool.org> <20200714104027.GF296695@grain> Subject: Re: [Tarantool-patches] [PATCH] serilaizer: check for recursive serialization List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org Hi, Cyrill and Igor! I tried to compare the addresses of the previous and the current = iteration, if they are equal, then throw "looks like recursion, bad function!=E2=80=9D= . But I got swim tests failing. That is, they use some recursive serializers = that do not overflow the stack. Therefore, I settled on the idea of = =E2=80=8B=E2=80=8Bintroducing a=20 recursion limit. > On Jul 14, 2020, at 13:40, Cyrill Gorcunov wrote: >=20 > On Tue, Jul 14, 2020 at 12:45:33PM +0300, Igor Munkin wrote: >>>=20 >>> Wait. The @idx stands for index in a table as far as I remember, >>> this just happen to hit when you're calling youself recursively >>> but @idx may be > SERIALIZER_CRITICAL_RECURSION_DEPTH for = nonrecursive >>> calls as well. >>=20 >> I guess you've just misread this part: @idx is just a guest stack = slot >> where Lua object being serialized is stored. If I get your concerns >> right, you're talking about the following case: >=20 > Yes, you're right. Thanks, Igor! I don't have strong preference here > on how to handle the case. Thus >=20 > Reviewed-by: Cyrill Gorcunov