From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (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 6F9AD469719 for ; Thu, 15 Oct 2020 09:50:07 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id h20so1968288lji.9 for ; Wed, 14 Oct 2020 23:50:07 -0700 (PDT) Date: Thu, 15 Oct 2020 09:50:03 +0300 From: Cyrill Gorcunov Message-ID: <20201015065003.GB173841@grain> References: <20201014132939.GA173841@grain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH 2/6] raft: factor out the code to wakeup worker fiber List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On Thu, Oct 15, 2020 at 12:40:36AM +0200, Vladislav Shpilevoy wrote: > >> - raft.is_broadcast_scheduled = true; > >> + if (raft.worker == NULL) { > >> + raft.worker = fiber_new("raft_worker", raft_worker_f); > >> + fiber_set_joinable(raft.worker, true); > >> + } > > > > When fiber_new return NULL you'll get nil dereference in fiber_set_joinable. > > Indeed, you are right! It seems it was there always. There is no a > beautiful way to fix it now, so I added a panic() here in case of OOM: Sure, thanks!