Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org,
	Alexander Turenko <alexander.turenko@tarantool.org>
Subject: [Tarantool-patches] [PATCH v2 0/3] Merger's NULL defererence
Date: Thu, 18 Jun 2020 00:06:48 +0300	[thread overview]
Message-ID: <cover.1592416673.git.alexander.turenko@tarantool.org> (raw)

Differences from v1
-------------------

- Added the patch to don't leave garbage on a reusable Lua stack (2.5th
  patch in v1 series).
- Dropped the patch, which trims luaL_ prefix from next() and destroy()
  implementations (1st patch in v1 series).
- [minor] Drop redundant `struct tuple;` definition from a test.
- [minor] Make `luacheck -r` happy with gh-4954-merger-via-c.test.lua.
- [minor] Small wording and formatting fixes.

See the v1 series for more detailed description of changes and the
related discussions:

https://lists.tarantool.org/pipermail/tarantool-patches/2020-June/017325.html

Overview of the patchset
------------------------

The first patch just fixes NULL pointer dereference that occurs due to
the wrong assumption: I did think that fiber().storage.lua.stack is
always exists and non-NULL.

The second patch fix merge sources to don't leave any garbage on a
reusable Lua stack (it may matter if we'll use a merge source from C
code).

The third commit is the optimization: it allows to don't create a new
Lua state in merger when possible.

Changelog entry
---------------

@ChangeLog

- merger: fix NULL pointer dereference when merger is called via the
  binary protocol (say, via net.box) (gh-4954)

Links
-----

https://github.com/tarantool/tarantool/issues/4954
Totktonada/gh-4954-fix-merger-segfault-full-ci

----

Alexander Turenko (3):
  merger: fix NULL dereference when called via iproto
  merger: clean fiber-local Lua stack after next()
  lua: expose temporary Lua state for iproto calls

 src/box/lua/call.c                            |  27 ++
 src/box/lua/merger.c                          | 200 ++++++++++++--
 src/lib/core/fiber.h                          |  14 +-
 test/CMakeLists.txt                           |   1 +
 test/box-tap/CMakeLists.txt                   |   4 +
 test/box-tap/check_merge_source.c             | 108 ++++++++
 test/box-tap/gh-4954-merger-via-c.test.lua    | 251 ++++++++++++++++++
 .../gh-4954-merger-via-net-box.test.lua       | 129 +++++++++
 8 files changed, 708 insertions(+), 26 deletions(-)
 create mode 100644 test/box-tap/CMakeLists.txt
 create mode 100644 test/box-tap/check_merge_source.c
 create mode 100755 test/box-tap/gh-4954-merger-via-c.test.lua
 create mode 100755 test/box-tap/gh-4954-merger-via-net-box.test.lua

-- 
2.25.0

             reply	other threads:[~2020-06-17 21:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 21:06 Alexander Turenko [this message]
2020-06-17 21:06 ` [Tarantool-patches] [PATCH v2 1/3] merger: fix NULL dereference when called via iproto Alexander Turenko
2020-06-18 22:48   ` Vladislav Shpilevoy
2020-06-19  8:50     ` Alexander Turenko
2020-06-19 23:32   ` Vladislav Shpilevoy
2020-06-21 18:28     ` Alexander Turenko
2020-07-01 20:36   ` Igor Munkin
2020-07-16 20:10     ` Alexander Turenko
2020-07-16 21:42       ` Igor Munkin
2020-07-16 22:44         ` Igor Munkin
2020-07-17  3:08         ` Alexander Turenko
2020-06-17 21:06 ` [Tarantool-patches] [PATCH v2 2/3] merger: clean fiber-local Lua stack after next() Alexander Turenko
2020-06-19  8:50   ` Alexander Turenko
2020-07-01 20:36   ` Igor Munkin
2020-07-16 20:11     ` Alexander Turenko
2020-07-16 22:07       ` Igor Munkin
2020-07-17  3:08         ` Alexander Turenko
2020-06-17 21:06 ` [Tarantool-patches] [PATCH v2 3/3] lua: expose temporary Lua state for iproto calls Alexander Turenko
2020-07-01 20:37   ` Igor Munkin
2020-07-16 20:11     ` Alexander Turenko
2020-07-16 22:33       ` Igor Munkin
2020-07-17  3:09         ` Alexander Turenko
2020-06-22 20:38 ` [Tarantool-patches] [PATCH v2 0/3] Merger's NULL defererence Vladislav Shpilevoy
2020-07-17 11:28 ` Alexander Turenko

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=cover.1592416673.git.alexander.turenko@tarantool.org \
    --to=alexander.turenko@tarantool.org \
    --cc=imun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 0/3] Merger'\''s NULL defererence' \
    /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