Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Nikita Pettik <korablev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] box/error: ref error.prev while accessing it
Date: Sat, 18 Apr 2020 01:58:08 +0200	[thread overview]
Message-ID: <853cb50c-63e1-5961-2495-c3bebd4b9aac@tarantool.org> (raw)
In-Reply-To: <20200417200638.GA14084@tarantool.org>

On 17/04/2020 22:06, Nikita Pettik wrote:
> 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.

Actually there was a real problem with that, but with tuples.
They have uint32 ref counter, and it really can overflow in Lua
sometimes, when GC is too lazy, and the same tuple is got
many many times from space:get(). That was fixed by separating
one bit as a flag of having an external 'big-ref' uint64 number.

So a user won't write exactly the same stupid code, but it
achievable implicitly, so as you won't even notice.

      reply	other threads:[~2020-04-17 23:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 23:36 Nikita Pettik
2020-04-16  0:19 ` Vladislav Shpilevoy
2020-04-16 12:34   ` Nikita Pettik
2020-04-16 21:17     ` Vladislav Shpilevoy
2020-04-17 20:06       ` Nikita Pettik
2020-04-17 23:58         ` Vladislav Shpilevoy [this message]

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=853cb50c-63e1-5961-2495-c3bebd4b9aac@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] box/error: ref error.prev while accessing it' \
    /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