From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp5.mail.ru (smtp5.mail.ru [94.100.179.24]) (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 158C44696C3 for ; Fri, 17 Apr 2020 23:06:39 +0300 (MSK) Date: Fri, 17 Apr 2020 20:06:38 +0000 From: Nikita Pettik Message-ID: <20200417200638.GA14084@tarantool.org> References: <3ee69eaa4ff23647e9ae6fe63e2ae77c427ffe01.1586993218.git.korablev@tarantool.org> <574107d5-cb85-1b08-3abf-c2c53497ab5e@tarantool.org> <20200416123400.GA6229@tarantool.org> <4d22bf0c-a363-719c-4198-46616f42ed48@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4d22bf0c-a363-719c-4198-46616f42ed48@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] box/error: ref error.prev while accessing it List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On 16 Apr 23:17, Vladislav Shpilevoy wrote: > Hi! Thanks for the fixes! > > Now there is a new problem: > > value = 2147483647 + 100 > e1 = box.error.new(1000, 'Message1') > e2 = box.error.new(1001, 'Message2') > e1:set_prev(e2) > prev = nil > for i = 1, value do prev = e1.prev end Oh, if user wrote code like this I guess negative reference counter would be fair panishment. Still ref counter overflow can be achieved without stacked diag: box.error.last() refs counter as well. So I introduced overflow check in error_ref() in a separate patch. > tarantool> prev._refs > --- > - -2147483547 > ... > > Negative ref count.