From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>,
tarantool-patches@freelists.org,
Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [tarantool-patches] [PATCH v6 1/1] box: fix checkpoint_delete
Date: Thu, 6 Dec 2018 15:38:32 +0300 [thread overview]
Message-ID: <d0217645-b089-b30f-bae0-76d99341098c@tarantool.org> (raw)
In-Reply-To: <f635ff4e5e4cca3b295de483b8d484886b3ec251.1544099108.git.kshcherbatov@tarantool.org>
Vova, please, review.
On 06/12/2018 15:25, Kirill Shcherbatov wrote:
> http://github.com/tarantool/tarantool/tree/kshch/gh-3858-fix-checkpoint-delete
> https://github.com/tarantool/tarantool/issues/3858
>
> The rlist_foreach_entry iterator was used for freeing resources.
> As a result there was dirty access to memory during next step of
> for-loop.
> Replaced with rlist_foreach_entry_safe valid for destructors.
>
> Closes #3858
> ---
> src/box/memtx_engine.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/box/memtx_engine.c b/src/box/memtx_engine.c
> index 9e05ecf63..5cf70ab94 100644
> --- a/src/box/memtx_engine.c
> +++ b/src/box/memtx_engine.c
> @@ -610,8 +610,8 @@ checkpoint_new(const char *snap_dirname, uint64_t snap_io_rate_limit)
> static void
> checkpoint_delete(struct checkpoint *ckpt)
> {
> - struct checkpoint_entry *entry;
> - rlist_foreach_entry(entry, &ckpt->entries, link) {
> + struct checkpoint_entry *entry, *tmp;
> + rlist_foreach_entry_safe(entry, &ckpt->entries, link, tmp) {
> entry->iterator->free(entry->iterator);
> free(entry);
> }
>
next prev parent reply other threads:[~2018-12-06 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-06 12:25 Kirill Shcherbatov
2018-12-06 12:38 ` Vladislav Shpilevoy [this message]
2018-12-06 13:00 ` Vladimir Davydov
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=d0217645-b089-b30f-bae0-76d99341098c@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=kshcherbatov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=vdavydov.dev@gmail.com \
--subject='Re: [tarantool-patches] [PATCH v6 1/1] box: fix checkpoint_delete' \
/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