tarantool / tarantool/tarantool

merger: non-array tuple in a buffer leads to assertion fail

Open
#5,048 0 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

app bug crash
Dominant language
Lua
Stars
3.7k
Forks
419
Avg merge
1d 23h
Merged PRs (30d)
88

Description

Tarantool version: 2.5.0-62-gbb7c3d167 (in fact since merger was introduced in 2.2.0-268-gc7915eccd).

#!/usr/bin/env tarantool

local buffer = require('buffer')
local msgpack = require('msgpack')
local merger = require('merger')

local tuple = 1 -- Not an array!
local buf = buffer.ibuf()
msgpack.encode({tuple}, buf)

local exp_err = 'A tuple must be an array'
local source = merger.new_source_frombuffer(buf)
local ok, err = pcall(source.select, source)
assert(ok == true, ':select() should fail')
assert(err == exp_err, 'verify error message')

os.exit(0)

Expected result: zero exit code.

Actual result:

$ ./case.lua 
tarantool: /var/tmp/portage/dev-db/tarantool-9999/work/tarantool-9999/src/box/tuple.h:894: mp_tuple_assert: Assertion `mp_typeof(*tuple) == MP_ARRAY' failed.
Aborted

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.