From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 52B29469719 for ; Mon, 17 Feb 2020 23:01:25 +0300 (MSK) Received: by mail-lf1-f65.google.com with SMTP id z18so12749835lfe.2 for ; Mon, 17 Feb 2020 12:01:25 -0800 (PST) Date: Mon, 17 Feb 2020 23:01:17 +0300 From: Konstantin Osipov Message-ID: <20200217200117.GA12248@atlas> References: <20200217155953.25803-1-gorcunov@gmail.com> <20200217155953.25803-5-gorcunov@gmail.com> <20200217171940.GD11553@atlas> <20200217190508.GA2482@uranus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200217190508.GA2482@uranus> Subject: Re: [Tarantool-patches] [PATCH 4/4] box/txn: fix nil dereference in txn_rollback List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tml * Cyrill Gorcunov [20/02/17 22:07]: > b) error during journal_write > > txn_write > txn_write_to_wal > journal_write > wal_write > ... > entry->res = -1; > return -1; > txn_rollback(with fiber.txn != NULL), which > is fine. After you remove journal_entry_complete_cb from fail: branch of wal_write(), if you set txn to null only after successful journal_write, you'll be fine. On failure, the rollback will be done by txn_write(). > Guys, do I miss something obvious? The key moment > is dropping journal_entry_complete call from wal.c > on error path and defer setting fiber.txn = NULL > until journal_write passed without errors. Don't know how obvious this is, but it is something both me and Georgy are suggesting it seems. -- Konstantin Osipov, Moscow, Russia