if lua function returns empty table libtarantool's iterators segfault

Bug #1025547 reported by UNera
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tarantool
Fix Released
Medium
Dmitry Simonenko

Bug Description

I have part of code like this: https://github.com/mailru/tarantool/blob/master/client/tarantool/tc_print.c#L67

And I worte some tests for the code:

https://github.com/unera/dr-tarantool/blob/master/t/test-data/init.lua#L7

function test_return(...)
    return { ... }
end

if we call function 'test_return' with some arguments, the code works fine, but if function returns empty table, iterators will segfault.

A test that demonstrates the problem here: https://github.com/unera/dr-tarantool/blob/master/t/100-lua_segfault.t
Binary packet that was returned by tarantool can be found here: https://github.com/unera/dr-tarantool/raw/master/t/test-data/lua-return-empty-tuple-type_00022-code_000-ok.bin

tarantool returned package that has length = 28 bytes, code = 0

function 'tnt_reply' returned 0 for the package, and then tnt_iter* functions segfaulted.

Revision history for this message
Dmitry Simonenko (pmwkaa) wrote :

fixed on branch libtnt_iter_fix

Changed in tarantool:
status: New → Fix Committed
milestone: none → 1.4.8
assignee: nobody → Dmitry Simonenko (pmwkaa)
Kostja Osipov (kostja)
Changed in tarantool:
importance: Undecided → Medium
Kostja Osipov (kostja)
Changed in tarantool:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.