[Tarantool-patches] [PATCH] box/error: ref error.prev while accessing it

Nikita Pettik korablev at tarantool.org
Fri Apr 17 23:06:38 MSK 2020


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.


More information about the Tarantool-patches mailing list