Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] box/error: ref error.prev while accessing it
Date: Fri, 17 Apr 2020 20:06:38 +0000	[thread overview]
Message-ID: <20200417200638.GA14084@tarantool.org> (raw)
In-Reply-To: <4d22bf0c-a363-719c-4198-46616f42ed48@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.

  reply	other threads:[~2020-04-17 20:06 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 [this message]
2020-04-17 23:58         ` Vladislav Shpilevoy

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=20200417200638.GA14084@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@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